GroupDocs.Editor

Load, edit, and save documents through an HTML round-trip — with a single, consistent API across .NET, Java, Node.js, and Python.

4 platforms 60+ formats Latest v26.6.1

Choose your platform selecting one updates the snippets below

.NET v26.6.1
dotnet add package GroupDocs.Editor
Java v26.1.0
com.groupdocs:groupdocs-editor
Python via .NET v26.5.0
pip install groupdocs-editor-net

Getting started with .NET

using System;
using GroupDocs.Editor;
using GroupDocs.Editor.Options;

// Pass source document to initialize the Editor
var editor = new Editor("input.docx");

// Open document for edit
var originalDoc = editor.Edit();

// Get document as HTML
var srcHtml = originalDoc.GetEmbeddedHtml();

// Edit document contents
var editedHtml = srcHtml.Replace("Old text", "New text");

// Load edited document from HTML
var editedDoc = EditableDocument.FromMarkup(editedHtml, null);

// Save edited document to file with desired format
var saveOptions = new WordProcessingSaveOptions();
editor.Save(editedDoc, "output.docx", saveOptions);
import com.groupdocs.editor.*;
import com.groupdocs.editor.options.*;

// Pass source document to initialize the Editor
Editor editor = new Editor("input.docx");

// Open document for edit
EditableDocument originalDoc = editor.edit();

// Get document as HTML
String srcHtml = originalDoc.getEmbeddedHtml();

// Edit document contents
String editedHtml = srcHtml.replace("Old text", "New text");

// Load edited document from HTML
EditableDocument editedDoc = EditableDocument.fromMarkup(editedHtml, null);

// Save edited document to file with desired format
WordProcessingSaveOptions saveOptions = new WordProcessingSaveOptions();
editor.save(editedDoc, "output.docx", saveOptions);
const groupdocs = require('@groupdocs/groupdocs.editor');

// Pass the source document to initialize the Editor
const editor = new groupdocs.Editor("input.docx");

// Open the document for editing
const originalDoc = editor.edit();

// Get the document as HTML, then edit its contents
const editedHtml = originalDoc.getEmbeddedHtml().replace("Old text", "New text");

// Load the edited document back from HTML
const editedDoc = groupdocs.EditableDocument.fromMarkup(editedHtml, null);

// Save the edited document to the desired format
editor.save(editedDoc, "output.docx", new groupdocs.WordProcessingSaveOptions());
from groupdocs.editor import Editor, EditableDocument
from groupdocs.editor.formats import WordProcessingFormats
from groupdocs.editor.options import WordProcessingSaveOptions

# Pass source document to initialize the Editor
with Editor("input.docx") as editor:

    # Open document for edit
    original = editor.edit()

    # Get document as HTML
    html = original.get_embedded_html()

    # Edit document contents
    edited_html = html.replace("Old text", "New text")

    # Load edited document from HTML
    edited = EditableDocument.from_markup(edited_html)

    # Save edited document to file with desired format
    editor.save(edited, "output.docx", WordProcessingSaveOptions(WordProcessingFormats.DOCX))

Popular classes & namespaces

Key capabilities

  • Edit via HTML round-trip
  • Load, edit & save documents
  • Format-specific options
  • Protect documents
  • Extract content
  • Word, Excel, PowerPoint & more

Supported formats

WordExcelPowerPointTextHTMLEmail

…and 50+ more word-processing, spreadsheet, and web formats.

Resources