Kompres HTML ing Swift SDK

Ngurangi ukuran HTML nggunakake Swift

Nggunakake REST API ing Swift, pangembang bisa ngompres HTML kanthi program. Kanthi solusi sing diwenehake, output bakal dadi file berkualitas tinggi sawise kompresi.

Ndeleng potongan kode

Compress HTML ing Swift

Nggunakake Swift API sing kuat, pangembang bisa ngompres HTML kanggo ngoptimalake isi lan ukuran file output. Ngurangi ukuran file dumadi kanthi ngresiki data lan sumber daya sing ora digunakake. Sampeyan uga bisa compress gambar kanggo nggawe ukuran file output malah luwih cilik.

Asil optimasi lan kompresi isi bisa disimpen ing HTML asli utawa format nyimpen sing kasedhiya - DOCX, DOC, RTF, PDF, HTML lan liya-liyane.

Ngurangi ukuran HTML file ing Swift

Kaya sing wis kasebut, SDK Swift kita ngidini sampeyan nyuda ukuran HTML kanthi program. Lan saiki sampeyan bisa nyoba fungsi sing kuat lan ngevaluasi cara ngompres HTML ing Swift kanthi conto ing ngisor iki:

Unggah file sing pengin dioptimalake / kompres
Kode roto
Pilih format target saka dhaptar
import AsposeWordsCloud

let config = Configuration(clientId: "####-####-####-####-####",
   clientSecret: "##################");
let api = try WordsAPI(configuration: config);

let requestDocument = InputStream(url: URL(string: "Input.html"))!;
let requestCompressOptions = CompressOptions()
  .setImagesQuality(imagesQuality: 75)
  .setImagesReduceSizeFactor(imagesReduceSizeFactor: 1);
let compressDocumentRequest = CompressDocumentOnlineRequest(
   document: requestDocument, compressOptions: requestCompressOptions);
let compressDocument = try api.compressDocumentOnline(request: compressDocumentRequest);

let convertDocument = ConvertDocumentRequest(
   document: compressDocument.document.values.first, format: "html");
_ = try api.convertDocument(request: convertDocument);
Kode roto
  
Nyalin kode Swift menyang clipboard

Carane ngompres HTML ing Swift

  1. Pasang Aspose.Words Cloud for Swift
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) menyang proyek Swift sampeyan
  3. Konfigurasi API nggunakake tombol app
  4. Muat sumber HTML kanggo ngompres
  5. Kompres HTML, ngresiki informasi sing ora digunakake
  6. Pilih format file output
  7. Entuk asil kompresi HTML minangka file sing kapisah

Pustaka Swift kanggo nggunakake kompresi HTML.

Sampeyan bisa nggunakake manajer paket Swift lan manajer dependensi Cocoapods kanggo nginstal Aspose.Words Cloud SDK for Swift. Informasi rinci babagan nginstal paket diwenehi ing bagean "Installation and Usage".

Minangka alternatif, sampeyan bisa clone Aspose.Words Cloud SDK for Swift saka GitHub lan nggunakake ing project.

Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.

Requirements Sistem

Swift 4.2 utawa luwih anyar

Deleng Repository Documentation kanggo ndeleng rincian liyane.

Format file liyane sing didhukung

Sampeyan bisa nindakake kompresi dokumen kanggo format file liyane:

5%

Langganan kanggo Aspose Update Product

Entuk buletin saben wulan lan tawaran langsung dikirim menyang kothak layang.

© Aspose Pty Ltd 2001-2024. Kabeh hak dilindhungi undhang-undhang.