Cross-Platform Support

Designed for C# and VB.NET — Runs on .NET 10, 9, 8, .NET Framework 4.6.2+.

DevExpress Word Processing API – Quick Start

Set up DevExpress Word Processing API on your machine and build document processing workflows
in your next great DevExpress-powered .NET application.

Windows-based Installer

Run our Unified Installer (includes all DevExpress components and libraries) to start your free 30-day trial.

Free 30-Day Trial

NuGet

Install the DevExpress.Document.Processor NuGet package to start your free 30-day trial. Copy the installation command and add the package to your project using NuGet CLI.

dotnet add package DevExpress.Document.ProcessorCopy

Required Namespaces and Class

Namespaces:

DevExpress.XtraRichEdit
DevExpress.XtraRichEdit.API.Native

Class:

RichEditDocumentServer

Quick Start Code

  • C#
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using (FileStream fs = File.OpenRead("document.docx")) {
  RichEditDocumentServer wordProcessor = new RichEditDocumentServer();
  wordProcessor.LoadDocument(fs);
  wordProcessor.ExportToPdf(new FileStream("exported-doc.pdf", FileMode.Create));
}
Copy

Supported Document Elements

Use the DevExpress Word Processing API to create, access, and modify all core Word document elements.

Sections

Paragraphs/Text

Lists

Bookmarks

Hyperlinks

Tables

Fields & Controls

Shapes/Images

Charts

Watermarks

OLE Objects

Footnotes/Endnotes

Comments

Document Properties

Create & Manage Word Files

Create, modify, and organize Word documents programmatically. Use the DevExpress Word Processing API to generate,
merge, split, and customize documents with full control over structure, layout, and content.

Generate and Insert Content

Build documents programmatically or modify existing templates. Create and insert text, paragraphs, images, tables, charts, and other elements.

Documentation

Merge Word Files

Combine multiple Word documents into a single file while preserving formatting, styles, and document structure.

Documentation | Demo

Split Word Files

Divide documents into separate files by pages, sections, or custom ranges to simplify processing and distribution.

Documentation | Demo

Page Setup

Configure page settings such as paper size, orientation, margins, gutters, and other layout options.

Documentation

Advanced Page Layout Control

Manage headers/footers, page and line numbering, footnotes and endnotes, columns and section-specific layouts.

Documentation

Modify Document Properties

Read and update document metadata such as title, author, subject, keywords, and custom properties to improve classification and discoverability.

Documentation

  • C#
using DevExpress.Office.Utils;
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

// Load the first document
using var firstDocStream = new MemoryStream(File.ReadAllBytes("Document1.docx"));
using var wordProcessor = new RichEditDocumentServer();
wordProcessor.LoadDocument(firstDocStream, DocumentFormat.Docx);
Document document = wordProcessor.Document;

// Merge the second document into the first
document.AppendSection().StartType = SectionStartType.NextPage;
using var secondDocStream = new MemoryStream(File.ReadAllBytes("Document2.docx"));
document.AppendDocumentContent(secondDocStream, DocumentFormat.Docx);

// Configure page layout for all sections
foreach (Section section in document.Sections)
{
    section.Page.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.Letter;
    section.Page.Landscape = false;
    section.Margins.Left = Units.InchesToDocumentsF(1f);
    section.Margins.Right = Units.InchesToDocumentsF(1f);
}

// Update built-in document properties and save the merged result
document.DocumentProperties.Creator = "DevExpress";
document.DocumentProperties.Title = "Merged Report";
using var outputStream = new MemoryStream();
wordProcessor.SaveDocument(outputStream, DocumentFormat.Docx);
Copy

AI-ready Word Processing APIs

DevExpress Word Processing API offers backend-ready AI-powered extensions that can summarize, translate,
proofread, and chat with content using any AI model. Our AI extensions integrate seamlessly with both cloud-based
services (Azure OpenAI, OpenAI, Google Gemini) and offline models (Ollama, ONNX Runtime, AI Foundry Local)
via the Microsoft.Extensions.AI library and its IChatClient interface.

Integrate an AI Provider of Choice

Choose and integrate an AI service provider that meets your security, cost, and performance requirements.

Documentation

Summarize Word Documents

Generate concise executive summaries from lengthy Word documents — ideal for creating executive overviews, extracting key points from reports, and simplifying large volumes of content.

Documentation

Translate and Proofread Text

Translate documents into any supported language while preserving structure and layout. Use AI-powered proofreading to deliver polished and professional documents with improved clarity, tone, and grammar.

Documentation

Chat with Document Data

Turn Word Documents into searchable knowledge sources and let users ask questions in plain language — perfect for internal knowledge bases, document management systems, and enterprise workflows. Large files are automatically chunked for efficient AI processing (reduced token usage and fast response times in production environments).

Documentation

  • C#
using Azure.AI.OpenAI;
using DevExpress.AIIntegration;
using DevExpress.AIIntegration.Docs;
using DevExpress.Docs.Presentation;
using Microsoft.Extensions.AI;
using System.Globalization;

string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT");
string apiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_APIKEY");
string model = "gpt-4o-mini";

IChatClient client = new AzureOpenAIClient(
    new Uri(endpoint), new System.ClientModel.ApiKeyCredential(apiKey))
    .GetChatClient(model).AsIChatClient();
AIExtensionsContainerDefault aiContainer =
    AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(client);
var aiService = aiContainer.CreateAIDocProcessingService();

using var inputStream = new MemoryStream(File.ReadAllBytes("Document.docx"));
using var wordProcessor = new RichEditDocumentServer();
wordProcessor.LoadDocument(inputStream, DocumentFormat.Docx);
Document document = wordProcessor.Document;

// Proofread entire document 
await aiService.ProofreadAsync(wordProcessor, new CultureInfo("en-US"));

//Translate the first paragraph into German
Paragraph paragraph = wordProcessor.Document.Paragraphs[0];
await aiService.TranslateAsync(paragraph.Range, new CultureInfo("de-DE"));

// Summarize a document
string summary = await aiService.SummarizeAsync(wordProcessor, SummarizationMode.Extractive, CancellationToken.None);
Copy

Content Extraction

Find and replace document text. Analyze document structure and layout to extract content,
metrics, and positional data for advanced processing scenarios.

Find and Replace Text

Search for text throughout the document and replace it programmatically, with support for formatting and pattern-based matching.

Documentation

Obtain Document Statistics

Use advanced layout APIs to collect statistics such as page, line, word count, and access physical coordinates of document elements on a page.

Example

Document Iteration

Traverse document elements using an iterator and export content as simplified HTML, Markdown, or structured formats for reporting and automation.

Example

  • C#
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using System.Drawing;
using System.Text.RegularExpressions;

using var inputStream = new MemoryStream(File.ReadAllBytes("Document.docx"));
using var wordProcessor = new RichEditDocumentServer();
wordProcessor.LoadDocument(inputStream, DocumentFormat.Docx);
Document document = wordProcessor.Document;

// Find and replace a keyword
document.ReplaceAll("COMPANY_NAME", "Doe Corp", SearchOptions.WholeWord);

// Find and highlight all occurrences of a specific term
DocumentRange[] placeholders = document.FindAll("Confidential", SearchOptions.None);
foreach (DocumentRange placeholder in placeholders)
{
    CharacterProperties cp = document.BeginUpdateCharacters(placeholder);
    cp.Bold = true;
    cp.ForeColor = Color.DarkRed;
    document.EndUpdateCharacters(cp);
}

// Find and remove private information (email addresses) using regex
Regex emailPattern = new Regex(@"\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b",
    RegexOptions.IgnoreCase);
DocumentRange[] ranges = document.FindAll(emailPattern);
for (int i = ranges.Length - 1; i >= 0; i--)
    document.Delete(ranges[i]);

using var outputStream = new MemoryStream();
wordProcessor.SaveDocument(outputStream, DocumentFormat.Docx);
Copy

File Conversion & Export

Print and export Word documents with ease. Transform documents into PDF, HTML, and image formats
while preserving layout, formatting, and accessibility. Our cross-platform export implementation ensures
consistent results across Windows, macOS, and Linux environments.

Convert to Word Formats

Convert documents between various Word formats (DOCX, DOC, RTF, DOTX, XML, TXT and more) while maintaining content structure, layout, and formatting.

Documentation | Demo

Import and Export HTML

Import HTML documents or export Word content to HTML for seamless integration with web applications and workflows.

Documentation | Demo

Export Documents to PDF

Convert Word documents to PDF with high fidelity, while preserving layout, fonts, and visual elements across platforms. Define document properties, security settings, and attach files.

Documentation | Demo

Create Fillable PDF Forms

Generate interactive PDF forms with editable fields from Word documents with content controls.

Documentation | Demo

Export Accessible & Compliant PDFs

Export documents to PDF/UA-compliant files with proper tagging to support screen readers. Generate PDF/A-compliant documents for long-term archiving.

Documentation | Demo

Export Pages to Image Formats

Export document pages as images (PNG, JPEG, BMP, SVG, and more) for previews, thumbnails, or further processing.

Documentation | Demo

Print Word Files

Print documents programmatically on Windows, Linux, and macOS with full control over page settings and output.

Documentation

Asynchronous Document Processing

Load, save, and export documents asynchronously to improve performance in server and cloud environments.

  • C#
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.Export.Image;
using DevExpress.Drawing;
using DevExpress.XtraPrinting;

using var wordProcessor = new RichEditDocumentServer();
wordProcessor.LoadDocument("Document.docx");

// Export to PDF with options
var pdfOptions = new PdfExportOptions();
pdfOptions.ImageQuality = PdfJpegImageQuality.Highest;
pdfOptions.DocumentOptions.Author = "DevExpress";
using var pdfStream = new MemoryStream();
wordProcessor.ExportToPdf(pdfStream, pdfOptions);

// Export to HTML 
wordProcessor.Options.Export.Html.EmbedImages = true;
using var htmlStream = new MemoryStream();
wordProcessor.SaveDocument(htmlStream, DocumentFormat.Html);

// Export to RTF
using var rtfStream = new MemoryStream();
wordProcessor.SaveDocument(rtfStream, DocumentFormat.Rtf);

// Export pages as images
IReadOnlyList<Stream> imageStreams = wordProcessor.Document.ExportToImage(
    new RichEditImageExportOptions()
    {
        Format = DXImageFormat.Png,
        Resolution = 300
    });
Copy

Document Protection & Security

Protect sensitive content and control document access with built-in security features. Encrypt files, restrict editing,
apply watermarks, and add digital signatures to ensure document integrity and authenticity.

Encrypt with Password

Secure documents with password-based encryption to prevent unauthorized access and protect sensitive information.

Documentation | Demo

Restrict Document Modification

Control how documents can be edited by applying protection modes such as Read-Only, Allow Comments, Fill-in-Forms, or Tracked Changes.

Documentation | Demo

Manage Editable Ranges

Define user permissions within protected documents by creating editable ranges. Allow specific users or groups to modify designated sections while keeping the rest of the document locked.

Documentation

Sign Word Documents

Apply digital signatures to verify document authenticity and ensure content has not been altered after signing.

Documentation | Demo

Apply Watermarks

Add text or image watermarks to document pages to indicate status, ownership, or confidentiality. Customize content, position, and appearance across the document.

Documentation

  • C#
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using var inputStream = new MemoryStream(File.ReadAllBytes("Document.docx"));
using var wordProcessor = new RichEditDocumentServer();
wordProcessor.LoadDocument(inputStream, DocumentFormat.Docx);
Document document = wordProcessor.Document;

// Grant editing permissions to specific users/groups
RangePermissionCollection rangePermissions = document.BeginUpdateRangePermissions();
DocumentRange editableRange = document.Paragraphs[0].Range;
RangePermission rp = rangePermissions.CreateRangePermission(editableRange);
rp.Group = "Everyone";
rangePermissions.Add(rp);
document.EndUpdateRangePermissions(rangePermissions);

// Apply read-only protection with a password
document.Protect("readonly_password", DocumentProtectionType.ReadOnly);

// Save as a password-encrypted file
EncryptionSettings encryptionSettings = new EncryptionSettings();
encryptionSettings.Type = EncryptionType.Strong;
encryptionSettings.Password = "encryption_password";

using var outputStream = new MemoryStream();
wordProcessor.SaveDocument(outputStream, DocumentFormat.Docx, encryptionSettings);
Copy

Mail Merge & Placeholders

Automate document generation and deliver fully personalized, data-driven content with ease. Manage field,
bookmark, and interactive control placeholders. Initiate mail merge operations from multiple data sources, and build
complex, multilevel reports programmatically.

Advanced Field Support

Leverage a wide range of built in field codes such as DATE, HYPERLINK, PAGE, TOC, IF, MERGEFIELD, DOCVARIABLE, and more. Insert metadata, conditional content, tables of contents, images, and dynamic values.

Documentation

Manage Document Fields

Add, edit, or remove fields/placeholders programmatically. Update, lock, or convert fields to static text as needed.

Documentation

Insert Dynamic Content

Embed calculated values, images, hyperlinks, and conditional rich text to generate documents with dynamic content.

Documentation

Mail Merge Documents

Generate personalized letters, invoices, and reports by merging templates with data from databases, objects, collections, XML, and other sources.

Documentation | Demo

Build Multilevel Reports with Regions

Create hierarchical and master detail reports using region markers to organize and present complex datasets.

Documentation | Demo

Create a Form with Content Controls

Build interactive Word forms with checkboxes, drop-down lists, date pickers, and rich text content controls.

Documentation

Use Bookmark Placeholders

Mark locations in templates using bookmarks and insert dynamic content programmatically.

Documentation

Insert Table of Contents

Generate Table of Contents from document entries and headings. Customize levels and associated styles.

Documentation

  • C#
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using var wordProcessor = new RichEditDocumentServer();
Document document = wordProcessor.Document;

// Insert merge fields programmatically
document.AppendText("Invoice for ");
document.Fields.Create(document.Range.End, "MERGEFIELD CustomerName");
document.Paragraphs.Append();
document.AppendText("Total Amount: ");
document.Fields.Create(document.Range.End, "MERGEFIELD OrderTotal \\# $#,##0.00");

// Bind a data source and configure merge options
MailMergeOptions mergeOptions = document.CreateMailMergeOptions();
mergeOptions.MergeMode = MergeMode.NewSection;
mergeOptions.DataSource = new[] {
        new { CustomerName = "Jane Cooper", OrderTotal = 1250.00m },
        new { CustomerName = "John Smith", OrderTotal = 890.50m }
    };

// Execute mail merge and save
using var outputStream = new MemoryStream();
wordProcessor.MailMerge(mergeOptions, outputStream, DocumentFormat.Docx);
Copy

Review & Comment

Collaborate on documents, track changes, and process feedback programmatically.
Add comments, compare document versions, and control revision history to streamline
review workflows within your .NET applications.

Process Comment Threads

Insert, edit, and remove comments to provide feedback or annotate documents. Reply to comments to support structured, threaded collaboration.

Documentation

Track Changes and Revisions

Enable change tracking, customize display options, review edits, and accept or reject modifications programmatically to finalize documents or preserve revision history.

Documentation

Compare Word Files

Compare document versions to identify differences in text, formatting, and structure. Generate a result document with tracked changes for further review.

Documentation

  • C#
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

// Load the original document
using var originalDocStream = new MemoryStream(File.ReadAllBytes("Document_Original.docx"));
using var original = new RichEditDocumentServer();
original.LoadDocument(originalDocStream, DocumentFormat.Docx);

// Load the revised document
using var revisedDocStream = new MemoryStream(File.ReadAllBytes("Document_Revised.docx"));
using var revised = new RichEditDocumentServer();
revised.LoadDocument(revisedDocStream, DocumentFormat.Docx);

// Configure comparison options
CompareDocumentOptions options = new CompareDocumentOptions();
options.ComparisonLevel = ComparisonLevel.Word;
options.CompareFormatting = true;
options.CompareCaseChanges = true;
options.Author = "Jane Doe";

// Compare documents with options
Document comparisonResult = original.Document.Compare(revised.Document, options);

using var outputStream = new MemoryStream();
comparisonResult.SaveDocument(outputStream, DocumentFormat.Docx);
Copy

Document Formatting

Control document appearance and layout using advanced formatting capabilities. Apply styles and direct formatting,
customize text and tables, manage fonts, and support international text flow options.

Text Styles & Formatting

Apply and manage paragraph and character styles. Add fine-grained emphasis or ensure consistent formatting across the entire document.

Documentation

Table Styles & Formatting

Format tables with custom styles, borders, shading, alignment, and layout options. Use conditional styles to format headers, first columns, and banded rows/columns.

Documentation

Right-to-Left Support

Create and format documents for right-to-left (RTL) languages with proper text flow and alignment.

CJK Text Wrapping

Handle Chinese, Japanese, and Korean text with advanced wrapping rules for accurate layout and readability.

Enable Hyphenation

Hyphenate words automatically using dictionaries based on language-specific rules.

Documentation

Font Management

Control font usage, specify fonts for substitutions, embed fonts in documents, or use non-system fonts from external sources to ensure consistent rendering across platforms.

Documentation

  • C#
using DevExpress.Office.Utils;
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using System.Drawing;

using var inputStream = new MemoryStream(File.ReadAllBytes("Document.docx"));
using var wordProcessor = new RichEditDocumentServer();
wordProcessor.LoadDocument(inputStream, DocumentFormat.Docx);
Document document = wordProcessor.Document;

// Create and register a custom heading style
ParagraphStyle headingStyle = document.ParagraphStyles.CreateNew();
headingStyle.Name = "CustomHeading1";
headingStyle.FontName = "Segoe UI";
headingStyle.FontSize = 18;
headingStyle.Bold = true;
headingStyle.ForeColor = Color.FromArgb(0x1F, 0x49, 0x7D);
headingStyle.Alignment = ParagraphAlignment.Left;
headingStyle.SpacingBefore = Units.InchesToDocumentsF(0.2f);
headingStyle.SpacingAfter = Units.InchesToDocumentsF(0.1f);
headingStyle.OutlineLevel = 1;
document.ParagraphStyles.Add(headingStyle);

// Apply the heading style to the first paragraph
document.Paragraphs[0].Style = headingStyle;

using var outputStream = new MemoryStream();
wordProcessor.SaveDocument(outputStream, DocumentFormat.Docx);
Copy

Graphic Object Support

Enhance documents with visual elements. Insert and customize shapes, connectors, groups, images,
charts, and embedded objects to create professional and informative content.

Insert Shapes & Connectors

Add, remove, and customize shapes, text boxes, and connectors to highlight content and improve document structure.

Documentation

Manage Document Pictures

Insert images in multiple formats (PNG, JPG, BMP, SVG, and more) and manage their size, position, cropping, and formatting within the document.

Documentation

Create and Customize Charts

Generate and customize 80+ chart types (2D or 3D types). Create combination graphs that combine multiple chart types on a single diagram. Use Office 2016 chart types such as Funnel, Histogram, Treemap, and Waterfall.

Documentation

Embed Files as OLE Objects

Link and embed external files as OLE objects to include additional content or references.

Documentation

Format Shapes

Customize fill, outline, size, positioning, rotation, text wrapping, and other effects. Group and ungroup shapes and elements.

Documentation

Accessibility Settings

Set alternative text and descriptions for compatibility with accessibility tools. Mark visuals as decorative so that screen readers skip content.

Documentation

  • C#
using DevExpress.Office.Services;
using DevExpress.XtraSpreadsheet.Services;
using DevExpress.XtraRichEdit.API.Native;
using DevExpress.Spreadsheet.Charts;
using DevExpress.Spreadsheet;
using System.Drawing;

OfficeCharts.Instance.ActivateCrossPlatformCharts();

using var wordProcessor = new RichEditDocumentServer();
Document document = wordProcessor.Document;
document.Unit = DevExpress.Office.DocumentUnit.Inch;

// Insert a clustered column chart
Shape chartShape = document.Shapes.InsertChart(document.Range.End,
    DevExpress.XtraRichEdit.API.Native.ChartType.ColumnClustered);
chartShape.AltText = "Quarterly Sales Chart";
chartShape.Size = new SizeF(6f, 3.5f);

// Populate the chart with sample quarterly data
ChartObject chart = (ChartObject)chartShape.ChartFormat.Chart;
Worksheet worksheet = (Worksheet)chartShape.ChartFormat.Worksheet;
worksheet["B2"].Value = "Quarter";
worksheet["C2"].Value = "Revenue ($K)";
worksheet["D2"].Value = "Units Sold";
worksheet["B3"].Value = "Q1"; worksheet["C3"].Value = 420; worksheet["D3"].Value = 210;
worksheet["B4"].Value = "Q2"; worksheet["C4"].Value = 580; worksheet["D4"].Value = 295;
worksheet["B5"].Value = "Q3"; worksheet["C5"].Value = 670; worksheet["D5"].Value = 340;
worksheet["B6"].Value = "Q4"; worksheet["C6"].Value = 830; worksheet["D6"].Value = 415;
chart.SelectData(worksheet["B2:D6"]);
chart.Title.SetValue("2025 Quarterly Performance");

using var outputStream = new MemoryStream();
wordProcessor.SaveDocument(outputStream, DocumentFormat.Docx);
Copy

FAQ — Word Processing API

 
Is Microsoft Word® required to create documents with the DevExpress Word Processing API?

No. You do not need to install Microsoft Word® to generate DOC, DOCX, RTF, or other supported formats. The DevExpress Word Processing Document API is a standalone library designed to create/load/modify/save/export Microsoft Word® documents programmatically.

Does the Word Processing API support .NET?

Yes. DevExpress Word Processing API supports .NET 10, .NET 9, and .NET 8. Our Word file generation API works in apps that run on Windows, Linux, and macOS. You can deploy your apps on Azure and AWS.

What .NET Framework versions does the Word Processing API support?

DevExpress Word Processing API supports .NET Framework 4.6.2, 4.7, and 4.8 (current version v25.2). For complete version compatibility information, refer to our prerequisites documentation: Office File API Prerequisites.

How is the Word Processing API licensed?

DevExpress Word Processing API is licensed per developer. Each developer using the API requires an individual license. Licensing is not based on the number of machines, deployments, CPUs, or end users.

The Word Processing API is available through two licensing options:

For complete licensing terms, refer to the DevExpress End-User License Agreement.

Which NuGet package do I need for the Word Processing API?

For .NET install the DevExpress.Document.Processor NuGet package.

For .NET Framework projects using the DevExpress Unified Component Installer, reference the following v25.2+ assemblies:

  • DevExpress.Data.dll
  • DevExpress.Drawing.dll
  • DevExpress.Office.Core.dll
  • DevExpress.RichEdit.Core.dll
  • DevExpress.Printing.Core.dll
  • DevExpress.Pdf.Core.dll
What can I do with the Word Processing API?

The DevExpress Word Processing Document API allows you to create, load, modify, save, and export Word documents programmatically. You can format document text, manage page layout, work with sections and page numbering, add headers and footers, insert tables and images, create mail merge documents, track changes and compare documents, work with content controls and fields, protect documents with passwords, digitally sign documents, search and replace text, convert between supported formats (DOCX, DOC, RTF, HTML, TXT, ODT), and export to PDF.

Which Microsoft Word® file formats does the DevExpress Word Processing API support? What other file formats are supported?

The DevExpress Word Processing Document API supports Microsoft’s DOC and DOCX file formats. Our Word Processing API also supports RTF.

Does the Word Processing API include AI-powered features?

Yes. The DevExpress Word Processing API includes AI-powered extensions optimized for document processing. These extensions integrate with language models via Microsoft.Extensions.AI (IChatClient interface) and support both cloud-based services (Azure OpenAI, OpenAI, Google Gemini) and local models (Ollama, ONNX Runtime).

Available AI capabilities include:

  • Proofread - Reviews grammar, spelling, and style in real time
  • Translate - Translates document content while preserving formatting
  • Summarize - Generates concise summaries (abstractive or extractive modes)
  • Ask AI - Answers contextual questions about document content using RAG

To use AI extensions, install the DevExpress.AIIntegration.Docs NuGet package.

Refer to our documentation for implementation details: AI-powered Extensions for DevExpress Office File API.

How do I export a Word document to PDF?
  • C#
using DevExpress.XtraRichEdit;

using (var wordProcessor = new RichEditDocumentServer()) {
    wordProcessor.LoadDocument("report.docx");
    wordProcessor.ExportToPdf("report.pdf");
}
Copy
How do I create a mail merge document?
  • C#
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using (var wordProcessor = new RichEditDocumentServer()) {
    Document doc = wordProcessor.Document;

    // Create simple template with merge fields
    doc.AppendText("Dear ");
    doc.Fields.Create(doc.Range.End, "MERGEFIELD FirstName");
    doc.AppendText(",\n\nThank you!\n\nSincerely,\nThe Team");

    // Create data source
    var data = new[] {
        new { FirstName = "John", LastName = "Doe" },
        new { FirstName = "Jane", LastName = "Smith" }
    };

    // Perform mail merge
    MailMergeOptions options = doc.CreateMailMergeOptions();
    options.DataSource = data;
    options.MergeMode = MergeMode.NewSection;
    wordProcessor.MailMerge(options, "output.docx", DocumentFormat.OpenXml);
}
Copy
How do I compare two document revisions?
  • C#
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

var original = new RichEditDocumentServer();
var revised = new RichEditDocumentServer();
original.LoadDocument("original.docx");
revised.LoadDocument("revised.docx");
Document comparison = original.Document.Compare(revised.Document);
comparison.SaveDocument("comparison.docx", DocumentFormat.Docx);
Copy
How do I get started with the Word Processing Document API?