GroupDocs.Editor for Node.js is a document editing API developed by GroupDocs, a part of Aspose. It allows developers to integrate document editing functionality into their applications.
- Edit document content in any web-browser.
- Edit document pages separately.
- Customizable resource management options for CSS, fonts & images.
- Render documents to HTML for editing.
- Extract document text along with words' coordinates.
- Extract basic information about source documents such as file type, pages count, and so on.
- Auto-detect document type.
- Replace missing font or use custom fonts for rendering.
- Edit word processing documents in a flow or paged mode.
- Fetch language information for multilingual document editing.
- Extract font information to provide consistent editing and appearance behavior.
- Edit multi-tabbed spreadsheets.
- Supports DSV (Delimiter-Separated Values) documents.
- Specify separator, flexible numeric, and data conversion for CSV & TSV files.
- Optimize memory usage for large CSV & TSV files.
- Fix incorrect XML document structure.
- Recognize URIs and email addresses in XML files.
- Set character encoding of the input text document.
- Grab document metadata information.
- Fetch whole HTML document or BODY content.
- Get an HTML document along with all its resources (stylesheets, images).
- Open any supported format file in HTML format and save it to disk.
- Fetch HTML markup from DB or remote storage.
GroupDocs.Editor supports editing a wide range of document formats across various categories. Below are the supported formats:
DOC, DOCX, DOCM, DOT, DOTX, DOTM, FlatOPC, ODT, OTT, RTF, WordML
XLS, XLT, XLSX, XLSM, XLTX, XLTM, XLSB, XLAM, SpreadsheetML, ODS, FODS, SXC, DIF (Import, Export, Auto Detection), DSV (Import only), CSV (Import, Export, Auto Detection), TSV (Import, Export, Auto Detection)
PPT, PPTX, PPTM, PPS, PPSX, PPSM, POT, POTX, POTM, ODP, OTP, FODP (Create, Import, Auto Detection)
EML, EMLX, MSG, MBOX, TNEF, MHT, PST, OFT, OST, VCF (Auto Detection only), ICS (Auto Detection only)
ePub, MOBI, AZW3
HTML (Import, Auto Detection only), MHTML, CHM (Import, Auto Detection only), XML (Import, Auto Detection only), JSON (Import, Auto Detection only), MD
TXT (Import, Export, Auto Detection)
GroupDocs.Editor for Node.js does not require any external software or third-party tool to be installed. GroupDocs.Editor for Node.js supports any 32-bit or 64-bit operating system where Node.js is installed.
To install the library, use the following command:
npm install @groupdocs/groupdocs.editor
const inputPath = Constants.SAMPLE_DOCX;
// Load document as file via path and without load options
const editor1 = new Editor(inputPath);
editor1.dispose();
// Load document as file via path and with load options
const wordLoadOptions = new WordProcessingLoadOptions();
wordLoadOptions.setPassword("some password");
const editor2 = new Editor(inputPath, wordLoadOptions);
editor2.dispose();
const inputFilePath = Constants.SAMPLE_DOCX;
const editor = new Editor(inputFilePath, new WordProcessingLoadOptions());
const defaultWordProcessingDoc = await editor.edit();
// Modify its content somehow. Because there is no attached WYSIWYG-editor, this code simulates document editing
let allEmbeddedInsideString = defaultWordProcessingDoc.getEmbeddedHtml();
let allEmbeddedInsideStringEdited = allEmbeddedInsideString.replace("Subtitle", "Edited subtitle");// Modified version
// Create new EditableDocument instance from modified HTML content
const editedDoc = EditableDocument.fromMarkup(allEmbeddedInsideStringEdited, null);
// Save edited document as RTF, specified through file path
const outputRtfPath = Constants.getOutputFilePath("editedDoc", "rtf");
const rtfSaveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Rtf);
await editor.save(editedDoc, outputRtfPath, rtfSaveOptions);