Cómo convertir PDF a PDF/A en C# usando IronPDF

How to Export PDF/A or PDF/A-3 Format Documents in C#

This article was translated from English: Does it need improvement?
Translated
View the article in English

As a PDF Association member, Iron Software actively supports the PDF/A standard and ensures IronPDF meets archival compliance requirements.

IronPDF supports export of PDFs to the PDF/A-3b standard. PDF/A-3B is a strict subset of the ISO PDF specification used to create archival versions of documents with the intent that they will always render exactly the same as when they were saved.

Quickstart: Convert PDFs to PDF/A-3b in C#

Easily convert your standard PDFs to the archival PDF/A-3b format using IronPDF in just a few lines of C# code. This ensures long-term document preservation and compliance with archival standards. By leveraging IronPDF's powerful capabilities, you can quickly transform your existing documents into PDF/A formats, guaranteeing consistent rendering and accessibility.

Nuget IconGet started making PDFs with NuGet now:

  1. Install IronPDF with NuGet Package Manager

    PM > Install-Package IronPdf

  2. Copy and run this code snippet.

    IronPdf.PdfDocument pdf = IronPdf.PdfDocument.FromFile("example.pdf");
    pdf.SaveAsPdfA("output.pdf");
  3. Deploy to test on your live environment

    Start using IronPDF in your project today with a free trial
    arrow pointer

Section 508 Compliance

IronPDF is happy to follow Google's initiative to increase PDF archiving and accessibility and the Section 508 Compliance of PDF documents.

In 2021, we moved to rendering PDFs from HTML using the Google Chromium HTML rendering engine. This allows our software to inherit the accessibility work Google has already implemented:

Get started with IronPDF

Comience a usar IronPDF en su proyecto hoy con una prueba gratuita.

Primer Paso:
green arrow pointer


PDF/A Versions

The two conformance levels that IronPDF supports are A and B. 'A' represents 'accessible,' and 'B' represents 'basic.' These levels are available across PDF/A-1, PDF/A-2, and PDF/A-3 standards. The information below has been taken from Adobe's documentation on PDF/A. By default, the PDF output generated through IronPDF is always PDF/A-3B (ISO 19005-3).

  • Level A conformance meets all requirements in its specification, allowing assistive software to improve accessibility for physically impaired users.
  • Level B has a lower level of conformance, with minimal compliance, focusing on preserving the visual appearance of the file long-term.

PDF/A-1: The PDF/A format is based on the original PDF 1.4 version.

PDF/A-2: Released in July 2011 as a new standard called ISO 32001-1, this standard includes all features of PDF versions up to 1.7 as well as new features. Its features include the support of JPEG2000 which is handy for scanned documents and specific requirements for customized XMP metadata.

PDF/A-3: This PDF/A format includes all of the requirements of Level 2. It also allows the embedding of additional file formats—like XML, CSV, and word processing formats—into PDF/A conforming documents.

Por favor notaIronPdf does not support converting a PDF with an attachment file to PDF/A-3B yet.

From an Existing PDF File

I have an example PDF "wikipedia.pdf," which was generated using IronPDF and saved as a PDF file.

I will load and re-save it as a PDF/A-3B compliant PDF file in this demonstration.

Input file: "wikipedia.pdf"

Code

:path=/static-assets/pdf/content-code-examples/how-to/pdfa-fromfile.cs
using IronPdf;

// Create a PdfDocument object or open any PDF File
PdfDocument pdf = PdfDocument.FromFile("wikipedia.pdf");

// Use the SaveAsPdfA method to save to file
pdf.SaveAsPdfA("pdf-a3-wikipedia.pdf", PdfAVersions.PdfA3b);
Imports IronPdf

' Create a PdfDocument object or open any PDF File
Private pdf As PdfDocument = PdfDocument.FromFile("wikipedia.pdf")

' Use the SaveAsPdfA method to save to file
pdf.SaveAsPdfA("pdf-a3-wikipedia.pdf", PdfAVersions.PdfA3b)
$vbLabelText   $csharpLabel

Output

The output file is PDF/A-3b compliant:

license complete

From an HTML Design or URL

I have an example HTML design "design.html," which I would like to render from HTML to PDF using IronPDF and then export as a PDF/A compliant file.

I will save it as a PDF/A-3B compliant PDF file in this demonstration.

HTML Design Example

:path=/static-assets/pdf/content-code-examples/how-to/pdfa-fromhtml.cs
using IronPdf;

// Use the Chrome Renderer to make beautiful HTML designs
var chromeRenderer = new ChromePdfRenderer();

// Render an HTML design as a PdfDocument object using Chrome
PdfDocument pdf = chromeRenderer.RenderHtmlAsPdf("design.html");

// Use the SaveAsPdfA method to save to file
pdf.SaveAsPdfA("design-accessible.pdf", PdfAVersions.PdfA3b);
Imports IronPdf

' Use the Chrome Renderer to make beautiful HTML designs
Private chromeRenderer = New ChromePdfRenderer()

' Render an HTML design as a PdfDocument object using Chrome
Private pdf As PdfDocument = chromeRenderer.RenderHtmlAsPdf("design.html")

' Use the SaveAsPdfA method to save to file
pdf.SaveAsPdfA("design-accessible.pdf", PdfAVersions.PdfA3b)
$vbLabelText   $csharpLabel

The output file is PDF/A-3B compliant:

license complete

URL Example

I have the following website "https://www.microsoft.com," which I would like to render from URL to PDF using IronPDF and then export as a PDF/A compliant file.

I will save it as a PDF/A-3B compliant PDF file in this demonstration.

:path=/static-assets/pdf/content-code-examples/how-to/pdfa-fromurl.cs
using IronPdf;

// Use the Chrome Renderer to make beautiful HTML designs from URLs
var chromeRenderer = new ChromePdfRenderer();

// Render a Website as a PdfDocument object using Chrome
PdfDocument pdf = chromeRenderer.RenderUrlAsPdf("https://www.microsoft.com");

// Use the SaveAsPdfA method to save to file
pdf.SaveAsPdfA("website-accessible.pdf", PdfAVersions.PdfA3b);
Imports IronPdf

' Use the Chrome Renderer to make beautiful HTML designs from URLs
Private chromeRenderer = New ChromePdfRenderer()

' Render a Website as a PdfDocument object using Chrome
Private pdf As PdfDocument = chromeRenderer.RenderUrlAsPdf("https://www.microsoft.com")

' Use the SaveAsPdfA method to save to file
pdf.SaveAsPdfA("website-accessible.pdf", PdfAVersions.PdfA3b)
$vbLabelText   $csharpLabel

The output file is PDF/A-3B compliant:

license complete


Support Embedding Attachment

IronPdf provides the ability to embed files into a PDF document while converting it to PDF/A format. This can be achieved using various input types such as file paths, byte arrays, or streams.

Embed with File Paths

Allows embedding of files using their file paths. A collection of file paths is provided, and these files are included as attachments during the PDF/A conversion.

:path=/static-assets/pdf/content-code-examples/how-to/pdfa-attachment-path.cs
using IronPdf;
using System.Collections.Generic;

PdfDocument pdf = new PdfDocument("Google.pdf");

// Initialize collection of embed file as string of path
IEnumerable<string> embedPaths = new[] { "File1.xml", "File2.png" };

// Convert to Pdf/A-3B with embeded files
pdf.ConvertToPdfA(embedPaths);
Imports IronPdf
Imports System.Collections.Generic

Private pdf As New PdfDocument("Google.pdf")

' Initialize collection of embed file as string of path
Private embedPaths As IEnumerable(Of String) = { "File1.xml", "File2.png" }

' Convert to Pdf/A-3B with embeded files
pdf.ConvertToPdfA(embedPaths)
$vbLabelText   $csharpLabel

Embed with Byte Arrays

Enables embedding of files by providing the file content as byte arrays along with their respective file types. This is useful when files are already loaded into memory.

:path=/static-assets/pdf/content-code-examples/how-to/pdfa-attachment-byte.cs
using IronPdf;
using System.Collections.Generic;
using System.IO;


PdfDocument pdf = new PdfDocument("Google.pdf");

// Initialize collection of embed file as Bytes and their file type
byte[] fileData1 = File.ReadAllBytes("File1.png");
byte[] fileData2 = File.ReadAllBytes("File2.xml");

var embedFileConfig1 = new EmbedFileConfiguration(EmbedFileType.png);
embedFileConfig1.EmbedFileName = "logo.png";

var embedFileConfig2 = new EmbedFileConfiguration(EmbedFileType.xml)
{
    EmbedFileName = "supportSystem.xml",
    AFDesc = "Internal system",
    ConformanceLevel = ConformanceLevel.XRECHNUNG,
    SchemaNamespace = SchemaNamespace.Zugferd1,
    SchemaPrefix = SchemaPrefix.rsm,
    PropertyVersion = PropertyVersion.v1p0,
    AFRelationship = AFRelationship.Supplement,
};

IEnumerable<EmbedFileByte> embedBytes = new[]
{
    new EmbedFileByte(fileData1, embedFileConfig1),
    new EmbedFileByte(fileData2, embedFileConfig2)
};

// Convert to Pdf/A-3B with embeded files
pdf.ConvertToPdfA(embedBytes).SaveAs("PdfACompliance.pdf");
Imports IronPdf
Imports System.Collections.Generic
Imports System.IO


Private pdf As New PdfDocument("Google.pdf")

' Initialize collection of embed file as Bytes and their file type
Private fileData1() As Byte = File.ReadAllBytes("File1.png")
Private fileData2() As Byte = File.ReadAllBytes("File2.xml")

Private embedFileConfig1 = New EmbedFileConfiguration(EmbedFileType.png)
embedFileConfig1.EmbedFileName = "logo.png"

Dim embedFileConfig2 = New EmbedFileConfiguration(EmbedFileType.xml) With {
	.EmbedFileName = "supportSystem.xml",
	.AFDesc = "Internal system",
	.ConformanceLevel = ConformanceLevel.XRECHNUNG,
	.SchemaNamespace = SchemaNamespace.Zugferd1,
	.SchemaPrefix = SchemaPrefix.rsm,
	.PropertyVersion = PropertyVersion.v1p0,
	.AFRelationship = AFRelationship.Supplement
}

Dim embedBytes As IEnumerable(Of EmbedFileByte) = {
	New EmbedFileByte(fileData1, embedFileConfig1),
	New EmbedFileByte(fileData2, embedFileConfig2)
}

' Convert to Pdf/A-3B with embeded files
pdf.ConvertToPdfA(embedBytes).SaveAs("PdfACompliance.pdf")
$vbLabelText   $csharpLabel

Embed with Streams

Provides the capability to embed files using streams for their content, along with their file types. This method is ideal for scenarios where file data is processed as a stream.

:path=/static-assets/pdf/content-code-examples/how-to/pdfa-attachment-stream.cs
using IronPdf;
using System.Collections.Generic;
using System.IO;

PdfDocument pdf = new PdfDocument("Google.pdf");

// Initialize collection of embed file as Stream and their file type
Stream stream1 = new MemoryStream(File.ReadAllBytes("File1.png"));
Stream stream2 = new MemoryStream(File.ReadAllBytes("File2.xml"));

var embedFileConfig1 = new EmbedFileConfiguration(EmbedFileType.png);
embedFileConfig1.EmbedFileName = "logo.png";

var embedFileConfig2 = new EmbedFileConfiguration(EmbedFileType.xml)
{
    EmbedFileName = "supportSystem.xml",
    AFDesc = "Internal system",
    ConformanceLevel = ConformanceLevel.XRECHNUNG,
    SchemaNamespace = SchemaNamespace.Zugferd1,
    SchemaPrefix = SchemaPrefix.rsm,
    PropertyVersion = PropertyVersion.v1p0,
    AFRelationship = AFRelationship.Supplement,
};

IEnumerable<EmbedFileStream> embedStreams = new[]
{
    new EmbedFileStream(stream1, embedFileConfig1),
    new EmbedFileStream(stream2, embedFileConfig2)
};

// Convert to Pdf/A-3B with embeded files
pdf.ConvertToPdfA(embedStreams).SaveAs("PdfACompliance.pdf");
Imports IronPdf
Imports System.Collections.Generic
Imports System.IO

Private pdf As New PdfDocument("Google.pdf")

' Initialize collection of embed file as Stream and their file type
Private stream1 As Stream = New MemoryStream(File.ReadAllBytes("File1.png"))
Private stream2 As Stream = New MemoryStream(File.ReadAllBytes("File2.xml"))

Private embedFileConfig1 = New EmbedFileConfiguration(EmbedFileType.png)
embedFileConfig1.EmbedFileName = "logo.png"

Dim embedFileConfig2 = New EmbedFileConfiguration(EmbedFileType.xml) With {
	.EmbedFileName = "supportSystem.xml",
	.AFDesc = "Internal system",
	.ConformanceLevel = ConformanceLevel.XRECHNUNG,
	.SchemaNamespace = SchemaNamespace.Zugferd1,
	.SchemaPrefix = SchemaPrefix.rsm,
	.PropertyVersion = PropertyVersion.v1p0,
	.AFRelationship = AFRelationship.Supplement
}

Dim embedStreams As IEnumerable(Of EmbedFileStream) = {
	New EmbedFileStream(stream1, embedFileConfig1),
	New EmbedFileStream(stream2, embedFileConfig2)
}

' Convert to Pdf/A-3B with embeded files
pdf.ConvertToPdfA(embedStreams).SaveAs("PdfACompliance.pdf")
$vbLabelText   $csharpLabel

Explore the EmbedFileConfiguration

When converting a PdfDocument to a PDF/A-3 format that includes embedded files, it’s important to configure parameters such as EmbedFilePath, EmbedFileByte, or EmbedFileStream. These settings let you specify the type of file being embedded, its name, and any custom XMP metadata you wish to include.

Proper configuration ensures that the embedded content is organized effectively and complies with PDF/A-3 standards. Customizing the XMP metadata allows for additional information about the embedded files, enhancing the overall usability and accessibility of the document. Using the EmbedFileConfiguration class developers can easily customize the values and formats for the file.

var config = new EmbedFileConfiguration
{
    EmbedFileName = "Attachment.xml",
    AFDesc = "Associated File Description",
    ConformanceLevel = ConformanceLevel.EN16931,
    SchemaNamespace = SchemaNamespace.facturX,
    SchemaPrefix = SchemaPrefix.fx,
    PropertyVersion = PropertyVersion.v1,
    AFRelationship = AFRelationship.Alternative
};

// Load a PDF document
var document = PdfDocument.FromFile("wikipedia.pdf");

// Configure embedded file parameters
document.EmbedFileFromFilePath("path/to/attachment", config);

// Save the document as PDF/A-3b
document.SaveAsPdfA3B("output-with-configured-attachment.pdf");
var config = new EmbedFileConfiguration
{
    EmbedFileName = "Attachment.xml",
    AFDesc = "Associated File Description",
    ConformanceLevel = ConformanceLevel.EN16931,
    SchemaNamespace = SchemaNamespace.facturX,
    SchemaPrefix = SchemaPrefix.fx,
    PropertyVersion = PropertyVersion.v1,
    AFRelationship = AFRelationship.Alternative
};

// Load a PDF document
var document = PdfDocument.FromFile("wikipedia.pdf");

// Configure embedded file parameters
document.EmbedFileFromFilePath("path/to/attachment", config);

// Save the document as PDF/A-3b
document.SaveAsPdfA3B("output-with-configured-attachment.pdf");
Dim config = New EmbedFileConfiguration With {
	.EmbedFileName = "Attachment.xml",
	.AFDesc = "Associated File Description",
	.ConformanceLevel = ConformanceLevel.EN16931,
	.SchemaNamespace = SchemaNamespace.facturX,
	.SchemaPrefix = SchemaPrefix.fx,
	.PropertyVersion = PropertyVersion.v1,
	.AFRelationship = AFRelationship.Alternative
}

' Load a PDF document
Dim document = PdfDocument.FromFile("wikipedia.pdf")

' Configure embedded file parameters
document.EmbedFileFromFilePath("path/to/attachment", config)

' Save the document as PDF/A-3b
document.SaveAsPdfA3B("output-with-configured-attachment.pdf")
$vbLabelText   $csharpLabel
  • EmbedFileName: A string property representing the name of the embedded file in the PDF/A document. By default, this string is empty.
  • AFDesc: A string property representing the associated file description for the embedded file. By default, this string is empty.
  • ConformanceLevel: The conformance level of embedding XML files applying to XMP Metadata of PDF/A document. Default is ConformanceLevel.EN16931. IronPDF provides different values via the ConformanceLevel enum.
  • SchemaNamespace: The PDF/A Schema NamespaceURI embedding the XML file and applying it to the XMP metadata of the PDF/A document. Default is SchemaNamespace.facturX, with various options available for developers in the SchemaNamespace enum.
  • SchemaPrefix: The PDF/A Schema Prefix for embedding an XML file applying to the XMP Metadata of a PDF/A document. Default is SchemaPrefix.fx, with several options available in the SchemaPrefix enum.
  • PropertyVersion: The property version of the embedding XML file applied to XMP Metadata of PDF/A document. Default is PropertyVersion.v1, with multiple options in the PropertyVersion enum.
  • AFRelationship: The relation of the associated file (embedded file) to the PDF/A document. Several options are available in the AFRelationship enum.

Character Display Issues

PDF/A requires that all characters in the document are mapped to a visually and semantically correct font. While not all fonts must be embedded, the font used must support the required glyphs. If an incorrect or incomplete font is used, certain characters may appear broken, missing, or incorrectly rendered—especially in languages with special scripts or symbols.

For example, in the issue below, the top sample uses the correct font and displays the characters properly, while the bottom sample fails to render them correctly due to font mismatch.

display issue

Ready to see what else you can do? Check out our tutorial page here: Create PDFs.

Preguntas Frecuentes

¿Cómo puedo convertir un PDF al formato PDF/A en C#?

Puedes utilizar las funciones de conversión de IronPDF para convertir un PDF estándar en un formato PDF/A en C#. Esto se realiza cargando el documento PDF y guardándolo con el nivel de conformidad PDF/A especificado.

¿Cuál es la diferencia entre PDF/A-3b y otros estándares PDF/A?

PDF/A-3b es un subconjunto de la especificación ISO PDF enfocado en la preservación a largo plazo de documentos asegurando que se rendericen de forma consistente. A diferencia de otros estándares PDF/A, PDF/A-3b permite la inserción de archivos adicionales, como XML o CSV, dentro del documento.

¿Cómo puedo insertar archivos en un documento PDF/A usando C#?

IronPDF permite insertar archivos como XML o CSV en un documento PDF/A a través de rutas de archivo, matrices de bytes o flujos. Esto se configura usando la clase EmbedFileConfiguration para establecer parámetros como el nombre del archivo, descripción y metadatos.

¿Se puede convertir contenido HTML o URL a PDF/A-3b?

Sí, IronPDF puede convertir contenido HTML o URLs a PDF/A-3b. Esto implica renderizar el HTML o URL en un formato PDF y luego guardar el documento con conformidad PDF/A-3b.

¿Cuáles son las características de accesibilidad compatibles con los documentos PDF/A?

IronPDF utiliza el motor de renderizado HTML Chromium de Google, que hereda funciones de accesibilidad implementadas por Google, por lo tanto, soporta la accesibilidad para documentos PDF/A conformes con los estándares de la Sección 508.

¿Cómo puedo asegurarme de que mis documentos PDF/A cumplen con la Sección 508?

IronPDF puede asegurar que tus documentos PDF/A cumplen con la Sección 508 aprovechando las características de accesibilidad del motor de renderizado HTML Chromium de Google, que ayuda a hacer los PDFs accesibles para software de asistencia.

¿Cuál es el propósito de la clase EmbedFileConfiguration?

La clase EmbedFileConfiguration en IronPDF permite a los desarrolladores configurar parámetros para insertar archivos en documentos PDF/A, como especificar metadatos de archivo y asegurar el cumplimiento con los estándares PDF/A-3.

¿Puedo convertir PDFs con adjuntos al formato PDF/A-3b?

IronPDF puede convertir PDFs con adjuntos a PDF/A-3b, pero los adjuntos deben ser configurados específicamente e insertados utilizando los métodos apropiados proporcionados por IronPDF.

¿Qué beneficios ofrece IronPDF para la conversión a PDF/A?

IronPDF ofrece varios beneficios para la conversión a PDF/A, incluyendo el cumplimiento con estándares archivísticos, soporte para varios formatos de entrada, la capacidad de insertar archivos adicionales y la inclusión de personalización comprensiva de metadatos.

¿IronPDF es compatible con .NET 10 al convertir a formatos PDF/A?

Sí. IronPDF es totalmente compatible con .NET 10 y admite funciones de conversión PDF/A como SaveAsPdfA y renderizado mediante ChromePdfRenderer. Puede usarlo en proyectos .NET 10 sin necesidad de soluciones alternativas. También admite la implementación en Windows, Linux, macOS y contenedores, siempre que esté orientado a .NET 10.

Curtis Chau
Escritor Técnico

Curtis Chau tiene una licenciatura en Ciencias de la Computación (Carleton University) y se especializa en el desarrollo front-end con experiencia en Node.js, TypeScript, JavaScript y React. Apasionado por crear interfaces de usuario intuitivas y estéticamente agradables, disfruta trabajando con frameworks modernos y creando manuales bien ...

Leer más
¿Listo para empezar?
Nuget Descargas 16,154,058 | Versión: 2025.11 recién lanzado