This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/dotnet/conversion/pdf-to-pdfa.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Convert PDF to PDF/A with C# | Nutrient .NET SDK

This guide uses the GdPicture.API package. For new projects, we recommend the Nutrient.SDK package. Refer to the PDF to PDF/A with Nutrient.SDK guide.

PDF/A conversion prepares PDF documents for long-term archiving. It enforces preservation rules so documents remain readable and self-contained over time. For background on the standard, refer to the complete guide to PDF/A.

Use this workflow when you need to:

  • Meet archival or retention requirements
  • Preserve document rendering for long-term storage
  • Remove external dependencies from PDF files

Prepare the project

Register the SDK license before running conversion operations. For setup details, refer to the getting started with .NET SDK guide.

using GdPicture14;
LicenseManager licence = new LicenseManager();
licence.RegisterKEY(""); // Set your license key

Load the PDF document

Create a GdPicturePDF instance and load the source file:

using GdPicturePDF pdf = new GdPicturePDF();
pdf.LoadFromFile(@"input.pdf");

Convert to PDF/A

Convert the loaded document to PDF/A-2b:

pdf.ConvertToPDFA(@"output.pdf", PdfConversionConformance.PDF_A_2b, false, false);

ConvertToPDFA takes the following parameters:

  1. The path to the output document. If the file already exists, the method overwrites it.
  2. A member of the PdfConversionConformance enumeration that sets the PDF/A conformance level of the output.
  3. Whether to allow vectorization when a page can’t be converted directly.
  4. Whether to allow rasterization when a page can be neither converted directly nor vectorized.

With false, false, as in the example above, the SDK only uses direct conversion. If a page needs vectorization or rasterization, ConvertToPDFA stops and returns GdPictureStatus.PdfConversionFailed. To let the SDK fall back to these techniques, set the corresponding parameters to true. For their side effects, refer to the configuring PDF/A conversion section below.

PDF/A conformance levels

The SDK supports all PDF/A versions and conformance levels:

Conformance levelPdfConversionConformance member
PDF/A-1aPDF_A_1a
PDF/A-1bPDF_A_1b
PDF/A-2aPDF_A_2a
PDF/A-2uPDF_A_2u
PDF/A-2bPDF_A_2b
PDF/A-3aPDF_A_3a
PDF/A-3uPDF_A_3u
PDF/A-3bPDF_A_3b
PDF/A-4PDF_A_4
PDF/A-4ePDF_A_4e
PDF/A-4fPDF_A_4f

Select the level that matches your archival policy.

Configuring PDF/A conversion

PDF/A documents have a stricter structure than regular PDF documents. To meet the selected conformance level, conversion may change the document’s content or appearance. For example, the SDK embeds fonts, converts color spaces to compliant ones, adds archival metadata, validates embedded resources, and adds, edits, or removes document structure elements.

When direct conversion of a page isn’t possible, the SDK can use two fallback techniques, if you allow them:

  • Vectorization — Page elements that can’t be used directly, typically fonts and paths, are embedded as vector graphics.
  • Rasterization — Page content that can’t be used directly is embedded as raster images. If vectorization is allowed but fails, the SDK tries rasterization next.

Both techniques lose fonts and text information, because text becomes shapes or images. To recover the text, run OCR on the output, as described in the PDF to searchable PDF guide.

Close the document

CloseDocument releases the loaded document and its resources. Disposing of the GdPicturePDF object does the same, so call CloseDocument when you keep the object alive after a conversion — for example, to process the next file.

Handle errors

LoadFromFile and ConvertToPDFA return GdPictureStatus values. In production, validate:

  • Input file availability and format
  • Operation status after loading and conversion
  • Output conformance with your validation tools

The example below checks the status after each call, reports when the document needs vectorization or rasterization, and closes the document:

using GdPicturePDF checkedPdf = new GdPicturePDF();
GdPictureStatus status = checkedPdf.LoadFromFile(@"input.pdf");
if (status != GdPictureStatus.OK)
{
throw new Exception($"Loading the PDF failed: {status}");
}
status = checkedPdf.ConvertToPDFA(@"output_checked.pdf", PdfConversionConformance.PDF_A_2b, false, false);
if (status == GdPictureStatus.PdfConversionFailed)
{
throw new Exception("The document needs vectorization or rasterization to meet PDF/A-2b.");
}
if (status != GdPictureStatus.OK)
{
throw new Exception($"PDF/A conversion failed: {status}");
}
checkedPdf.CloseDocument();

For status-handling patterns, refer to the handling errors with .NET SDK guide.

Common use cases

PDF/A is common in legal archives, government records, medical and financial record retention, and research and publication archives.

Conclusion

This guide converts a standard PDF file to PDF/A for archiving and compliance-oriented document storage.