Kompres DOCX ing C++ SDK

Ngurangi ukuran DOCX nggunakake C++

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

Ndeleng potongan kode

Compress DOCX ing C++

Nggunakake C++ API sing kuat, pangembang bisa ngompres DOCX 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 DOCX asli utawa format nyimpen sing kasedhiya - DOCX, DOC, RTF, PDF, HTML lan liya-liyane.

Ngurangi ukuran DOCX file ing C++

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

Unggah file sing pengin dioptimalake / kompres
Kode roto
Pilih format target saka dhaptar
using namespace aspose::words::cloud;

auto config = std::make_shared<ApiConfiguration>(L"####-####-####-####-####",
   L"##################");
auto wordsApi = std::make_shared<WordsApi>(config);

auto requestDocument = std::shared_ptr<std::istream>(
   new std::ifstream(std::filesystem::path(L"Input.docx"), std::istream::binary));
auto requestCompressOptions = std::make_shared<aspose::words::cloud::models::CompressOptions>();
requestCompressOptions->setImagesQuality(std::make_shared<int32_t>(75));
requestCompressOptions->setImagesReduceSizeFactor(std::make_shared<int32_t>(1));
std::shared_ptr<requests::CompressDocumentOnlineRequest> compressDocumentRequest(
    new requests::CompressDocumentOnlineRequest(
        requestDocument, requestCompressOptions
    )
);
auto compressDocument = wordsApi->compressDocumentOnline(compressDocumentRequest);

auto requestDocument = std::shared_ptr<std::istream>(
   compressDocument->document->values.begin, std::istream::binary));
std::shared_ptr<requests::ConvertDocumentRequest> convertDocument(
    new requests::ConvertDocumentRequest(
        requestDocument, std::make_shared<std::wstring>(L"docx")
    )
);
wordsApi->convertDocument(convertDocument);
Kode roto
  
Nyalin kode C++ menyang clipboard

Carane ngompres DOCX ing C++

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

Pustaka C++ kanggo nggunakake kompresi DOCX.

Klone Aspose.Words Cloud SDK for C++ kode sumber saka GitHub. Sampeyan bisa nemokake informasi rinci babagan mbangun lan ngonfigurasi SDK ing bagean "How to use the SDK".

Kanggo entuk kredensial keamanan sing dibutuhake lan ngakses REST API kanthi cepet, tindakake Instructions iki ing dokumentasi.

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.