GroupDocs.Editor for Java API 是编辑 Microsoft Word、Excel、PowerPoint、Open Office 文档和演示文稿的正确选择。 GroupDocs.Editor 是一个独立的 API,适用于需要高性能的服务器端和后端系统。它不依赖于任何软件,如 Microsoft 或 Open Office。
GroupDocs.Editor for Java 为开发人员提供了一种使用几行代码编辑 DOCM 文件的简单直接的方法。
WordProcessingLoadOptions
类创建 Editor
类的实例并加载 DOCM 文件WordProcessingEditOptions
类实例Editor.Edit()
方法并获得 HTML 格式的 DOCM 文档,该文档可以使用任何所见即所得的编辑器轻松编辑。Editor.Save()
方法并使用 WordProcessingSaveOptions
类保存编辑的 DOCM 文件使用 GroupDocs.Editor for Java API 进行基本文档编辑可以通过几个简单的步骤来完成。所有主要平台和操作系统都支持我们的 API。在执行以下代码之前,请确保您的系统上安装了以下先决条件。
// Load the DOCM file into Editor with the optional WordProcessingLoadOptions
Editor editor = new Editor("source.docm", new WordProcessingLoadOptions());
// Create and adjust the edit options
WordProcessingEditOptions editOptions = new WordProcessingEditOptions();
// Open input DOCM document for edit — obtain an intermediate document, that can be edited
EditableDocument beforeEdit = editor.edit(editOptions);
// Grab DOCM document content and associated resources from editable document
string content = beforeEdit.getContent();
// Send the content to WYSIWYG-editor, edit it there, and send edited content back to the server-side
// This step simulates a such operation
string updatedContent = content.replace("Subtitle", "Edited subtitle");
// Grab edited content and resources from WYSIWYG-editor and create a new EditableDocument instance from it
EditableDocument afterEdit = EditableDocument.fromMarkup(updatedContent, null);
// Create a save options and select a desired output format
WordProcessingSaveOptions saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docm);
// Save edited DOCM document to the file
editor.save(afterEdit, "edited.docm", saveOptions);
立即访问 GroupDocs.Editor 现场演示 网站编辑 DOCM。 现场演示有以下好处
无需下载 API
无需编写任何代码
只需上传源文件
获取下载链接以保存文件
您还可以编辑其他文件格式。请参阅下面的完整列表。
(Microsoft Word Binary Format)
(Office 2007+ Word Document)
(Microsoft Word Template File )
(Microsoft Excel Spreadsheet (Legacy))
(Open XML Workbook)
(Macro-enabled Spreadsheet)
(Microsoft PowerPoint 97-2003)
(Open XML presentation Format)
(Macro-enabled Presentation File)
(Open Ebook Format)
(Open eBook File)
(Hyper Text Markup Language)
(Web Page Archive Format)
(Text Document)
(XML File)
(Comma Seperated Values)
(Rich Text Format)
(OpenDocument Text File Format)
(Outlook Message Item File)
(E-Mail Message)