Back to Devexpress

Use PDF Document API to Convert PDF Documents to PDF/A Format

officefileapi-404727-pdf-document-api-document-manipulation-convert-documents.md

latest3.2 KB
Original Source

Use PDF Document API to Convert PDF Documents to PDF/A Format

  • Jan 16, 2026
  • 2 minutes to read

You can use the PdfDocumentConverter class to convert PDF documents to PDF/A-1b, PDF/A-2b, and PDF/A-3b.

Run Demo: PDF/A Document Conversion

Important

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use these examples in production code.

Follow the steps below to convert a PDF document to PDF/A-1b, PDF/A-2b, or PDF/A-3b:

  1. Create a PdfDocumentConverter object.
  2. Call the Convert(PdfCompatibility) method and pass a PdfCompatibility value as a parameter.
  3. Call SaveDocument(String) or SaveDocument(Stream) to specify the path where the resulting document should be saved.

You can also check the conversion status of the document and see issues encountered during conversion. Use the PdfDocumentConverter.ConversionReport property to access the PdfConversionReport object.

The following code snippet converts the “PdfAConversionDemo.pdf” file to PdfA2b format and displays the conversion status and issues in the console:

csharp
using DevExpress.Pdf;
// ...
// Obtain a file to convert.
var filePath = "PdfAConversionDemo.pdf";
var converter = new PdfDocumentConverter(filePath);
// Convert the file to the specified format.
converter.Convert(PdfCompatibility.PdfA2b);
converter.SaveDocument("PdfAConversionDemoResult.pdf");

// Specify and display a conversion report.
var status = converter.ConversionReport.ConversionStatus;
Console.WriteLine($"Status: {status}");
Console.WriteLine("Issues:");
var issues = converter.ConversionReport.Issues;
foreach (var issue in issues){
    Console.WriteLine($"{issue.Severity}: {issue.Message}");
}
vb
Imports DevExpress.Pdf
' ...
' Obtain a file to convert.
Private filePath = "PdfAConversionDemo.pdf"
Private converter = New PdfDocumentConverter(filePath)
' Convert the file to the specified format.
converter.Convert(PdfCompatibility.PdfA2b)
converter.SaveDocument("PdfAConversionDemoResult.pdf")

' Specify and display a conversion report.
Dim status = converter.ConversionReport.ConversionStatus
Console.WriteLine($"Status: {status}")
Console.WriteLine("Issues:")
Dim issues = converter.ConversionReport.Issues
For Each issue In issues
    Console.WriteLine($"{issue.Severity}: {issue.Message}")
Next issue

The image below displays the conversion report.