Cloud REST API til hurtigt at redigere alle populære dokumentformater i enhver type PHP-applikation uden at installere ekstern software.
Start gratis prøveperiodeGroupDocs.Editor Cloud SDK til PHP understøtter redigering og manipulation af en masse populære dokumentfilformater i PHP-applikationer. Du skal blot integrere GroupDocs.Editor Cloud SDK til PHP med GroupDocs.Editor Cloud REST API, uploade understøttet dokument i enhver tredjeparts WYSIWYG HTML-editor, manipuler dokumentet og gem det tilbage til det originale dokumentformat uden at forstyrre udseendet efter redigering. PHP-editorbiblioteket understøtter en række dokumentformater, herunder Microsoft Word (DOC, DOCX, WordML), Excel (XLS, XLSX, SpreadsheetML), Præsentationer (PPT, PPTX), HTML, XML, TXT og OpenDocument.
GroupDocs.Editor Cloud SDK til PHP er bygget som et lag oven på GroupDocs.Editor Cloud REST API, der sparer værdifuld udviklingstid ved at administrere anmodninger på lavt niveau og håndtere svar. Udviklerne kan kun fokusere på at skrive den specifikke kode op efter behov i projektet.
Tjek GroupDocs.Editor Cloud SDK til PHP på GitHub, hvis du leder efter kildekoden til at kommentere filen i skyen .
Du kan prøv GroupDocs.Editor Low-Code PHP API’er uden nogen begrænsninger.
GroupDocs.Editor Cloud er også tilgængelig som Docker-billede, der kan bruges til at selv-hoste tjenesten. Eller du kan bygge dine egne tjenester ved hjælp af GroupDocs.Editor High-code API’er, som i øjeblikket driver vores REST API’er.
//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();