If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.
If you experience errors, when you try to download a file, make sure your network policies (enforced by your company or ISP) allow downloading ZIP and/or MSI files.

Pemasangan
Paketnya adalah tersedia di Packagist dan dapat diinstal melalui Composer dengan menjalankan perintah berikut:
composer require groupdocscloud/groupdocs-editor-cloud

Persyaratan
- PHP 8.2 atau lebih baru
- Composer
- Ekstensi PHP — curl, json, mbstring
- Kredensial GroupDocs Cloud — Client ID and Client Secret dari Dashboard
Ketergantungan
SDK memerlukan paket-paket berikut:
| Package | Constraint |
|---|
| guzzlehttp/guzzle | ^6.5.8 or ^7.4.5 |
| ext-curl | * |
| ext-json | * |
| ext-mbstring | * |
Mulai Cepat
Dapatkan kredensial API Anda
Untuk menggunakan GroupDocs.Editor Cloud, daftar di GroupDocs.Cloud Dashboard dan dapatkan ID Klien dan Rahasia Klien Anda.
Inisialisasi API
Gunakan kode berikut untuk mulai menggunakan GroupDocs.Editor Cloud SDK untuk PHP:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$editApi = new GroupDocs\Editor\EditApi($configuration);
Lihat contoh lengkap di CommonUtils.php.
Edit dokumen Word
Setelah diinisialisasi, gunakan contoh dasar ini untuk memuat dokumen Word yang dilindungi kata sandi, mengedit representasi HTML-nya, dan menyimpan hasilnya.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Editor\Model;
use GroupDocs\Editor\Model\Requests;
$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$editApi = new GroupDocs\Editor\EditApi($configuration);
$fileApi = new GroupDocs\Editor\FileApi($configuration);
$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("WordProcessing/password-protected.docx");
$fileInfo->setPassword("password");
$loadOptions = new Model\WordProcessingLoadOptions();
$loadOptions->setFileInfo($fileInfo);
$loadOptions->setOutputPath("output");
$loadResult = $editApi->load(new Requests\loadRequest($loadOptions));
$htmlFile = $fileApi->downloadFile(new Requests\downloadFileRequest($loadResult->getHtmlPath()));
$html = file_get_contents($htmlFile->getRealPath());
$html = str_replace("Sample test text", "Hello world", $html);
file_put_contents($htmlFile->getRealPath(), $html);
$fileApi->uploadFile(new Requests\uploadFileRequest($loadResult->getHtmlPath(), $htmlFile->getRealPath()));
$saveOptions = new Model\WordProcessingSaveOptions();
$saveOptions->setFileInfo($fileInfo);
$saveOptions->setOutputPath("output/edited.docx");
$saveOptions->setHtmlPath($loadResult->getHtmlPath());
$saveOptions->setResourcesPath($loadResult->getResourcesPath());
$saveResult = $editApi->save(new Requests\saveRequest($saveOptions));
echo "Document edited: " . $saveResult->getPath() . "\n";
Lihat contoh lengkap di EditWordProcessingDocument.php.
Edit Dokumen Spreadsheet
Contoh ini memuat lembar kerja pertama dari file XLSX, mengedit konten HTML-nya, dan menyimpan spreadsheet.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Editor\Model;
use GroupDocs\Editor\Model\Requests;
$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$editApi = new GroupDocs\Editor\EditApi($configuration);
$fileApi = new GroupDocs\Editor\FileApi($configuration);
$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("Spreadsheet/four-sheets.xlsx");
$loadOptions = new Model\SpreadsheetLoadOptions();
$loadOptions->setFileInfo($fileInfo);
$loadOptions->setOutputPath("output");
$loadOptions->setWorksheetIndex(0);
$loadResult = $editApi->load(new Requests\loadRequest($loadOptions));
$htmlFile = $fileApi->downloadFile(new Requests\downloadFileRequest($loadResult->getHtmlPath()));
$html = file_get_contents($htmlFile->getRealPath());
$html = str_replace("This is sample sheet", "This is sample sheep", $html);
file_put_contents($htmlFile->getRealPath(), $html);
$fileApi->uploadFile(new Requests\uploadFileRequest($loadResult->getHtmlPath(), $htmlFile->getRealPath()));
$saveOptions = new Model\SpreadsheetSaveOptions();
$saveOptions->setFileInfo($fileInfo);
$saveOptions->setOutputPath("output/edited.xlsx");
$saveOptions->setHtmlPath($loadResult->getHtmlPath());
$saveOptions->setResourcesPath($loadResult->getResourcesPath());
$saveResult = $editApi->save(new Requests\saveRequest($saveOptions));
echo "Document edited: " . $saveResult->getPath() . "\n";
Lihat contoh lengkap di EditSpreadsheetDocument.php.
Ambil jumlah halaman untuk dokumen Word yang dilindungi kata sandi.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Editor\Model;
use GroupDocs\Editor\Model\Requests;
$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$infoApi = new GroupDocs\Editor\InfoApi($configuration);
$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("WordProcessing/password-protected.docx");
$fileInfo->setPassword("password");
$response = $infoApi->getInfo(new Requests\getInfoRequest($fileInfo));
echo "Page Count = " . $response->getPageCount() . "\n";
Lihat contoh lengkap di GetDocumentInformation.php.
Dapatkan Jenis File yang Didukung
Ambil format file yang didukung.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$infoApi = new GroupDocs\Editor\InfoApi($configuration);
$response = $infoApi->getSupportedFileFormats();
foreach ($response->getFormats() as $format) {
echo $format->getFileFormat() . " - " . $format->getExtension() . "\n";
}
Lihat contoh lengkap di GetSupportedFileTypes.php.
Contoh di GitHub
Itu GroupDocs.Editor Cloud PHP Examples repositori menyertakan contoh siap dijalankan yang meliputi:
| Category | Examples |
|---|
| Jenis File | Jenis file yang didukung |
| Informasi Dokumen | Informasi dokumen, konsumsi lisensi |
| Operasi Edit — Word | Edit dokumen pengolah kata, termasuk file yang dilindungi kata sandi |
| Operasi Edit — Spreadsheet | Edit dokumen spreadsheet dengan pilihan lembar kerja |
| Operasi Edit — Presentasi | Edit dokumen presentasi dengan pilihan slide |
| Operasi Edit — DSV | Edit dokumen nilai yang dipisahkan pembatas |
| Operasi Edit — Teks | Edit dokumen teks biasa |
Cara menjalankan contoh
- Kloning atau unduh repositori contoh
- Sunting
Examples/CommonUtils.php dan atur milikmu ClientId dan ClientSecret - Pergi ke
Examples direktori - Jalankan
composer update - Jalankan
php RunExamples.php
Untuk lebih jelasnya, kunjungi Getting Started.

Document Editing API | PHP Cloud API | GroupDocs.Editor Cloud | REST API | Word Processing Formats | Spreadsheet Formats | Presentation Formats | Text Formats | CSV Files | DOCX Documents | XLSX Documents | PPTX Presentations | Password-Protected Files | Cloud Storage Integration | Document Info Retrieval | File Operations | WYSIWYG Editing | Multi-Platform Support | Secure API Access | HTML Editing | Cross-platform API