Nggunakake REST API ing PHP, pangembang bisa ngompres dokumen ing DOC, DOCX, RTF, PDF, lan format liyane. Kanthi solusi sing diwenehake, output bakal dadi file berkualitas tinggi sawise kompresi.
Nggunakake PHP API sing kuat, pangembang bisa ngompres file kanggo ngoptimalake konten 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 format file asli utawa format nyimpen sing kasedhiya - DOCX, DOC, RTF, PDF, HTML lan liya-liyane.
Kaya sing wis kasebut, SDK PHP kita ngidini sampeyan nyuda ukuran dokumen kanthi program ing format apa wae sing didhukung. Contone, sampeyan bisa nyuda ukuran PDF file, DOCX, DOC, RTF, ODT, EPUB, HTML lan format liyane. Lan saiki sampeyan bisa nyoba fungsi sing kuat lan ngevaluasi cara ngompres dokumen ing PHP kanthi conto ing ngisor iki:
use Aspose\Words\WordsApi;
$wordsApi = new WordsApi('####-####-####-####-####', '##################');
$requestDocument = "Input.docx";
$requestCompressOptions = new CompressOptions(array(
"images_quality" => 75,
"images_reduce_size_factor" => 1,
));
$compressDocumentRequest = new CompressDocumentOnlineRequest(
$requestDocument, $requestCompressOptions, NULL, NULL, NULL, NULL
);
$compressDocument = $wordsApi->compressDocumentOnline($compressDocumentRequest);
$convertDocument = new ConvertDocumentRequest(
$compressDocument->document()->values(), "docx", NULL, NULL, NULL, NULL
);
$wordsApi->convertDocument($convertDocument);
Instal 'Aspose.Words Cloud SDK for PHP' saka gudang Packagist. Mung mbukak composer require aspose-cloud/aspose-words-cloud kanggo nginstal SDK, banjur gunakake require_once('vendor/autoload.php'); kanggo ngimpor menyang proyek sampeyan.
Minangka alternatif, sampeyan bisa kanthi manual kloning Aspose.Words Cloud SDK for PHP saka GitHub. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.
PHP 7.1 utawa luwih anyar
Deleng Repository Documentation kanggo ndeleng rincian liyane.