GroupDocs.Editor for Node.js via Java at a glance

API to edit, convert, and save documents, spreadsheets, slides, and e-books in Node.js applications.

Illustration editor

Effortlessly edit multiple documents in Node.js

Seamlessly edit multiple PDF and Office files with support for a wide range of formats. GroupDocs.Editor for Node.js via Java makes document editing fast and hassle-free.

Convert documents to HTML/CSS

Convert documents to pure HTML/CSS markup compatible with WYSIWYG editors, allowing easy and efficient document editing in a web environment.

Save edited documents in various formats

Save your edited documents back to their original format or export them to other formats such as PDF, ensuring flexibility and compatibility.

Platform independence

GroupDocs.Editor for Node.js supports the following operating systems, frameworks, and package managers.

Amazon
Docker
Azure
Eclipse
IntelliJ
Windows
Linux
Maven

Supported file formats

GroupDocs.Editor supports operations with the following file formats on import and export (full list).

Microsoft Office formats

  • Word: DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF
  • Excel: XLS, XLSX, XLSM, XLSB, XLTM, XLTX, XLT, XLAM
  • PowerPoint: PPT, PPTX, PPS, PPSX

Other document formats

  • Fixed-layout formats: PDF, XPS (export only)
  • OpenDocument: ODT, OTT, ODS, FODS, ODP, OTP, FODP
  • Delimited text tables: CSV, TSV, DSV (arbitrary separator)
  • Other table formats: SXC, DIF
  • eBook: ePub, AZW3, Mobi, TXT
  • Markup: HTML, MHTML, Markdown (MD), XML, CHM, JSON
  • Email formats: EML, EMLX, MSG, MBOX, TNEF, MHT, PST, OFT, OST, VCF, ICS

Main features

Seamlessly load, edit and save in different formats Office documents, Emails, eBooks, and PDF.

Feature icon

Edit files

Edit the content of various document formats including PDF, DOCX, XLSX, PPTX, and more.

Feature icon

Translate to HTML/CSS

Convert documents to HTML/CSS for easy editing with WYSIWYG editors like CKEditor or TinyMCE.

Feature icon

Save edited documents

Save the edited HTML/CSS back to the original document format or export to PDF.

Feature icon

Extract document information

Extract information such as page count, size, and encryption status from documents.

Feature icon

Support for various formats

Edit a wide range of document formats including Microsoft Office files, PDFs, and more.

Feature icon

Password protection

Load and edit password-protected documents with ease, and protecting the output documents with password protection.

Feature icon

Edit email

Edit and save the email messages and letters in MSG, EML, EMLX, MBOX and many other formats, including editing metadata like Subject, To, CC, BCC, From, Title, Date and so on.

Feature icon

Font extraction

Extract fonts from WordProcessing documents for use in the editing process.

Feature icon

Preview pages

Generate image representations of document pages to better understand content and structure.

Code samples

Some use cases of typical operations using GroupDocs.Editor for Node.js via Java

Replace text in DOCX

This example shows loading and editing a content of the input DOCX file programmatically by replacing text content on another. After that the modified document content is saved back as a new DOCX document.

Edit input DOCX by replacing text and save it back to DOCX


// Load input document by path and specify load options if necessary
const loadOptions = new WordProcessingLoadOptions();
const editor = new Editor("input.docx", loadOptions);

// Open document for edit and obtain the "EditableDocument"
const original = editor.edit();

// Replace text - this emulates the content editing
const modifiedContent = original.getEmbeddedHtml().replace("old text", "new text");

// Create new "EditableDocument" instance from edited content
const edited = EditableDocument.fromMarkup(modifiedContent, null);

// Prepare save options with desired output formatX
const saveOptions = new WordProcessingSaveOptions(WordProcessingFormats.Docx);

// Save edited document content to DOCX
await editor.save(edited, "output.docx", saveOptions);

// Dispose all resources
edited.dispose(); original.dispose(); editor.dispose();

Edit content of particular Excel worksheet

The Spreadsheet document (like XLS, XLSX, XLSM, ODS and so on) may have one or more worksheets (tabs). GroupDocs.Editor allows to edit content of one worksheet at a time. After being edited, this worksheet may be saved to the separate Spreadsheet document (where only this specific worksheet will be saved), or the edited worksheet can be inserted back to the original document, where it can either replace the original worksheet or be saved together, along with original one. This example shows loading XLSX document, editing its 2nd worksheet and saving it as a new separate document in XLSX and CSV formats.

Edit particular worksheet of XLSX and save as XLSX and CSV


// Load input XLSX by path and specify load options if necessary
const loadOptions = new SpreadsheetLoadOptions();
const editor = new Editor("input.xlsx", loadOptions);

// Create and adjust the edit options - set 2nd worksheet to edit
const editOptions = new SpreadsheetEditOptions();
editOptions.setWorksheetIndex(1);

// Open this 2nd worksheet for edit and obtain the "EditableDocument"
const originalWorksheet = editor.edit(editOptions);

// Replace text - this emulates the content editing
const modifiedContent = originalWorksheet.getEmbeddedHtml().replace("Cell Text", "Edited Cell Text");

// Create new "EditableDocument" instance from edited worksheet
const editedWorksheet = EditableDocument.fromMarkup(modifiedContent, null);

// Save edited worksheet to new XLSX document
const saveSpreadsheetOptions = new SpreadsheetSaveOptions(SpreadsheetFormats.Xlsx);
await editor.save(editedWorksheet, "output.xlsx", saveSpreadsheetOptions);

// Save edited worksheet to new CSV document with comma (,) delimiter/separator
const saveTextOptions = new DelimitedTextSaveOptions(",");
await editor.save(editedWorksheet, "output.csv", saveTextOptions);

// Dispose all resources
editedWorksheet.dispose(); originalWorksheet.dispose(); editor.dispose();

Ready to get started?

Download GroupDocs.Editor for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English
OSZAR »