Kompres HTML ing Dart/Flutter SDK

Ngurangi ukuran HTML nggunakake Dart

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

Ndeleng potongan kode

Compress HTML ing Dart

Nggunakake Dart 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 Dart

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

Unggah file sing pengin dioptimalake / kompres
Kode roto
Pilih format target saka dhaptar
import 'package:aspose_words_cloud/aspose_words_cloud.dart';

final config = Configuration("####-####-####-####-####", "##################");
final wordsApi = WordsApi(config);

final requestDocument = (await File('Input.html').readAsBytes()).buffer.asByteData();
final requestCompressOptions = CompressOptions();
requestCompressOptions.imagesQuality = 75;
requestCompressOptions.imagesReduceSizeFactor = 1;
final compressDocumentRequest = CompressDocumentOnlineRequest(
   requestDocument, requestCompressOptions);
final compressDocument = await wordsApi.compressDocumentOnline(compressDocumentRequest);

final convertDocument = ConvertDocumentRequest(compressDocument.document.values.first, 'html');
await wordsApi.convertDocument(convertDocument);
Kode roto
  
Nyalin kode Dart menyang clipboard

Carane ngompres HTML ing Dart

  1. Pasang Aspose.Words Cloud for Dart/Flutter
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) menyang proyek Dart 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 Dart kanggo nggunakake kompresi HTML.

Klone Aspose.Words Cloud SDK for Dart saka GitHub lan gunakake ing proyek sampeyan. Tambah dependensi iki menyang pubspec.yaml: dependencies: aspose_words_cloud: 22.4.0

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

Requirements Sistem

Deleng Repository Documentation kanggo ndeleng rincian.

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.