Cloud REST API は、外部ソフトウェアをインストールせずに、任意の PHP アプリケーションで、すべての一般的な文書フォーマットを迅速に編集できます。
無料トライアルを開始GroupDocs.Editor Cloud SDK for PHP は、PHP アプリケーション内で多数の一般的な文書ファイル形式の編集と操作をサポートします。GroupDocs.Editor Cloud SDK for PHP を GroupDocs.Editor Cloud REST API と統合するだけで、サードパーティ製 WYSIWYG HTML エディタに対応した文書をアップロードし、文書を操作して、編集後も外観を崩さずに元の文書形式で保存できます。PHP エディタライブラリは、Microsoft Word(DOC、DOCX、WordML)、Excel(XLS、XLSX、SpreadsheetML)、プレゼンテーション(PPT、PPTX)、HTML、XML、TXT、および OpenDocument など、さまざまな文書形式をサポートしています。
GroupDocs.Editor Cloud SDK for PHP は、GroupDocs.Editor Cloud REST API の上にレイヤーとして構築されており、低レベルのリクエスト管理とレスポンス処理により開発時間を大幅に削減します。開発者はプロジェクトで必要な特定のコードの記述に専念できます。
クラウドでファイルに注釈を付けるためのソースコードをお探しの場合は、https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-php の GroupDocs.Editor Cloud SDK(PHP 用、GitHub)をご確認ください。
制限なく、Low-Code PHP APIs を 試すGroupDocs.Editor ことができます。
GroupDocs.Editor Cloud は、Docker イメージとしても提供されており、サービスを self-host する際に使用できます。また、現在弊社の REST APIs を駆動している GroupDocs.Editor High-code APIs を利用して独自のサービスを構築することも可能です。
//Get your App SID, App Key and Storage Name at https://dashboard.groupdocs.cloud (free registration is required).
$AppSid = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$AppKey = ""; // Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid($AppSid);
$configuration->setAppKey($AppKey);
$editApi = new GroupDocs\Editor\EditApi($configuration);
$fileApi = new GroupDocs\Editor\FileApi($configuration);
// The document already uploaded into the storage
// Load it into editable state
$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));
// Download html document
$htmlFile = $fileApi->downloadFile(new Requests\downloadFileRequest($loadResult->getHtmlPath()));
$html = file_get_contents($htmlFile->getRealPath());
// Edit something...
$html = str_replace("This is sample sheet", "This is sample sheep", $html);
// Upload html back to storage
file_put_contents($htmlFile->getRealPath(), $html);
$uploadRequest = new Requests\uploadFileRequest($loadResult->getHtmlPath(), $htmlFile->getRealPath());
$fileApi->uploadFile($uploadRequest);
// Save html back to xlsx
$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));
// Done.
echo "Document edited: " . $saveResult->getPath();