Trình soạn thảo tài liệu REST API để xây dựng các công cụ chỉnh sửa và thao tác tài liệu nâng cao bằng Java Cloud SDK trên nền tảng web, thiết bị di động, máy tính để bàn hoặc đám mây.
Bắt đầu dùng thử miễn phíGroupDocs.Editor Cloud SDK for Java dễ dàng tích hợp với GroupDocs.Editor Cloud REST API, cho phép thêm các tính năng chỉnh sửa tài liệu trong các ứng dụng Java mà không cần cài đặt MS Office hoặc các ứng dụng bổ sung khác. Sử dụng Java editor SDK – tăng tốc tác vụ thao tác tài liệu trên nhiều định dạng tài liệu được hỗ trợ bao gồm Microsoft Word, bảng tính Excel, Presentations, TXT, HTML và XML. Chỉ cần lấy tài liệu vào bất kỳ trình soạn thảo HTML WYSIWYG nào, chỉnh sửa khi cần và lưu lại thành định dạng tài liệu gốc với độ chính xác và hiệu quả thực sự.
Thực hiện tất cả các thao tác chỉnh sửa tài liệu được yêu cầu nhiều nhất trên các định dạng tệp được hỗ trợ. GroupDocs.Editor Cloud SDK for Java đượ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 Java 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 Java 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 các dịch vụ Java 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).
Configuration configuration = new Configuration(MyAppSid, MyAppKey);
// Create necessary API instances
EditApi editApi = new EditApi(configuration);
FileApi fileApi = new FileApi(configuration);
// The document already uploaded into the storage.
// Load it into editable state
FileInfo fileInfo = new FileInfo();
fileInfo.setFilePath("WordProcessing/password-protected.docx");
fileInfo.setPassword("password");
WordProcessingLoadOptions loadOptions = new WordProcessingLoadOptions();
loadOptions.setFileInfo(fileInfo);
loadOptions.setOutputPath("output");
LoadResult loadResult = editApi.load(new LoadRequest(loadOptions));
// Download html document
File file = fileApi.downloadFile(new DownloadFileRequest(loadResult.getHtmlPath(), null, null));
// Edit something...
List lines = Files.readAllLines(file.toPath());
List newLines = new ArrayList();
for (String line : lines) {
newLines.add(line.replaceAll("Sample test text", "Hello world"));
}
Files.write(file.toPath(), newLines);
// Upload html back to storage
fileApi.uploadFile(new UploadFileRequest(loadResult.getHtmlPath(), file, Common.MYStorage));
// Save html back to docx
WordProcessingSaveOptions saveOptions = new WordProcessingSaveOptions();
saveOptions.setFileInfo(fileInfo);
saveOptions.setOutputPath("output/edited.docx");
saveOptions.setHtmlPath(loadResult.getHtmlPath());
saveOptions.setResourcesPath(loadResult.getResourcesPath());
DocumentResult saveResult = editApi.save(new SaveRequest(saveOptions));
System.out.println("Document edited: " + saveResult.getPath());