@groupdocs/groupdocs.editor

25.4.0 • Public • Published

GroupDocs.Editor for Node.js

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.

Node.js Editor API Features

  • 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.

Supported File Formats for Editing

GroupDocs.Editor supports editing a wide range of document formats across various categories. Below are the supported formats:

WordProcessing family formats

DOC, DOCX, DOCM, DOT, DOTX, DOTM, FlatOPC, ODT, OTT, RTF, WordML

Spreadsheet family formats

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)

Presentation family formats

PPT, PPTX, PPTM, PPS, PPSX, PPSM, POT, POTX, POTM, ODP, OTP, FODP (Create, Import, Auto Detection)

Fixed-layout family formats

PDF

Email family formats

EML, EMLX, MSG, MBOX, TNEF, MHT, PST, OFT, OST, VCF (Auto Detection only), ICS (Auto Detection only)

eBook family formats

ePub, MOBI, AZW3

Markup formats

HTML (Import, Auto Detection only), MHTML, CHM (Import, Auto Detection only), XML (Import, Auto Detection only), JSON (Import, Auto Detection only), MD

Other formats

TXT (Import, Export, Auto Detection)

Platform Independence

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.

Installation

To install the library, use the following command:

npm install @groupdocs/groupdocs.editor

Load document As Responsive HTML using Node.js

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();

Edit DOCX As Protected PDF via Node.js

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);

Resources

Package Sidebar

Install

npm i @groupdocs/groupdocs.editor

Weekly Downloads

27

Version

25.4.0

License

End User License Agreement.html

Unpacked Size

79.4 kB

Total Files

6

Last publish

Collaborators

  • groupdocs.npm
  • groupdocs.conversion.npm
  • groupdocs.conversion
  • saudaspose