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.

インストール
パッケージは、available Packagist にあり、Composer 経由で次のコマンドを実行してインストールできます。
composer require groupdocscloud/groupdocs-editor-cloud

要件
依存関係
SDK には次のパッケージが必要です。
| Package | Constraint |
|---|
| guzzlehttp/guzzle | ^6.5.8 or ^7.4.5 |
| ext-curl | * |
| ext-json | * |
| ext-mbstring | * |
クイックスタート
API 認証情報を取得する
GroupDocs.Editor Cloud を使用するには、GroupDocs.Cloud Dashboard でサインアップし、クライアント ID と クライアント シークレット を取得します。
API を初期化する
GroupDocs.Editor Cloud SDK for 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);
完全な例は CommonUtils.php を参照してください。
Word ドキュメントを編集する
初期化したら、この基本的な例を使用して、パスワードで保護された Word ドキュメントを読み込み、その HTML 表現を編集して、結果を保存します。
<?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";
完全な例は EditWordProcessingDocument.php を参照してください。
スプレッドシート ドキュメントを編集する
この例では、XLSX ファイルの最初のワークシートを読み込み、その HTML コンテンツを編集して、スプレッドシートを保存します。
<?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";
完全な例は EditSpreadsheetDocument.php を参照してください。
ドキュメント情報を取得する
パスワードで保護された Word ドキュメントのページ数を取得します。
<?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";
完全な例は GetDocumentInformation.php を参照してください。
サポートされているファイル タイプを取得する
サポートされているファイル形式を取得します。
<?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";
}
完全な例は GetSupportedFileTypes.php を参照してください。
GitHub の例
GroupDocs.Editor Cloud PHP Examples リポジトリには、以下をカバーするすぐに実行できるサンプルが含まれています。
| Category | Examples |
|---|
| ファイル タイプ | サポートされているファイル タイプ |
| ドキュメント情報 | ドキュメント情報、ライセンスの消費 |
| 編集操作 — Word | パスワードで保護されたファイルを含む、ワード プロセッシング ドキュメントの編集 |
| 編集操作 — Spreadsheet | ワークシートを選択してスプレッドシート ドキュメントを編集 |
| 編集操作 — Presentation | スライドを選択してプレゼンテーション ドキュメントを編集 |
| 編集操作 — DSV | 区切り文字で区切られた値ドキュメントの編集 |
| 編集操作 — Text | プレーン テキスト ドキュメントの編集 |
サンプルの実行方法
- 例のリポジトリ のクローンを作成するか、ダウンロードします。
Examples/CommonUtils.php を編集し、ClientId と ClientSecret を設定します。Examples ディレクトリに移動します。composer update を実行します。php RunExamples.php を実行します。
詳細については、次のサイトをご覧ください。 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