DevExpress PDF Document API

The DevExpress PDF Document API is a non-visual .NET library that allows you to generate, convert, merge, split, edit, password-protect, and digitally sign PDF files. Add markup annotations and fill interactive forms, extract text, apply digital signatures, and redact PDFs directly from .NET code.

Get Started

Install the DevExpress.Document.Processor NuGet package

  • CLI
dotnet add package DevExpress.Document.Processor

Code Example - Encrypt PDF with Access Permissions

  • C#
using DevExpress.Pdf;

using var pdfProcessor = new PdfDocumentProcessor();
pdfProcessor.LoadDocument("pdfDocument.pdf");
PdfEncryptionOptions encryptionOptions = new PdfEncryptionOptions();
encryptionOptions.DataExtractionPermissions = PdfDocumentDataExtractionPermissions.NotAllowed;
encryptionOptions.OwnerPasswordString = "OwnerPassword";
encryptionOptions.UserPasswordString = "UserPassword";
encryptionOptions.Algorithm = PdfEncryptionAlgorithm.AES256;
MemoryStream pdfEncryptedStream = new MemoryStream();
pdfProcessor.SaveDocument(pdfEncryptedStream, new PdfSaveOptions() { EncryptionOptions = encryptionOptions })

Code Example - Merge two PDF documents into a Single File

  • C#
using DevExpress.Pdf;

using var pdfProcessor = new PdfDocumentProcessor();
pdfProcessor.CreateEmptyDocument();
pdfProcessor.AppendDocument(docStream1);
pdfProcessor.AppendDocument(docStream2);
MemoryStream mergedPdfStream = new MemoryStream();
pdfProcessor.SaveDocument(mergedPdfStream);
mergedPdfStream.Position = 0;

Key Features

The DevExpress PDF Document API allows you to manage PDF documents in code:

  • Generate or edit document content
  • Merge or split files, manage pages
  • Annotate and comment PDF files
  • Create, fill, and edit interactive forms
  • Password-protect documents
  • Digitally sign PDF files
  • Convert to PDF/A compliant files
  • Attach ZUGFeRD invoices
  • Print and export to image formats
  • And much more

Learning Materials