Cloud REST API giúp chỉnh sửa nhanh chóng mọi định dạng tài liệu phổ biến trong mọi loại ứng dụng PHP mà không cần cài đặt bất kỳ phần mềm bên ngoài nào.
Bắt đầu dùng thử miễn phíGroupDocs.Editor Cloud SDK cho PHP hỗ trợ chỉnh sửa và thao tác nhiều định dạng tệp tài liệu phổ biến trong các ứng dụng PHP. Chỉ cần tích hợp GroupDocs.Editor Cloud SDK cho PHP với GroupDocs.Editor Cloud REST API, tải lên tài liệu được hỗ trợ trong bất kỳ trình soạn thảo HTML WYSIWYG của bên thứ ba nào, thao tác tài liệu và lưu lại thành định dạng tài liệu gốc mà không làm thay đổi giao diện sau khi chỉnh sửa. Thư viện trình soạn thảo PHP hỗ trợ nhiều định dạng tài liệu bao gồm Microsoft Word (DOC, DOCX, WordML), Excel (XLS, XLSX, SpreadsheetML), Presentations (PPT, PPTX), HTML, XML, TXT và OpenDocument.
GroupDocs.Editor Cloud SDK cho PHP được xây dựng dưới dạng một lớp trên GroupDocs.Editor Cloud REST API giúp tiết kiệm thời gian phát triển đáng kể bằng cách quản lý các yêu cầu cấp thấp và xử lý phản hồi. Các nhà phát triển có thể tập trung vào việc viết mã cụ thể chỉ khi cần thiết trong dự án.
Hãy xem GroupDocs.Editor Cloud SDK cho PHP tại GitHub nếu bạn đang tìm kiếm mã nguồn để chú thích tệp trong Đám mây.
Bạn có thể dùng thử GroupDocs.Editor Low-Code PHP API mà không có bất kỳ hạn chế nào.
GroupDocs.Editor Cloud cũng có sẵn dưới dạng hình ảnh Docker có thể được sử dụng để tự lưu trữ dịch vụ. Hoặc bạn có thể xây dựng dịch vụ của riêng mình bằng cách sử dụng GroupDocs.Editor High-code APIs hiện đang điều khiển REST API của chúng tôi.
//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();