Click or drag to resize
Pdf Library for .NET

PdfDocumentConvertToPdfA Method

Converts this document to the specified PDF/A conformance level. Valid only on loaded documents — new documents bake conformance in via PdfDocument(PdfStandard), and HtmlToPdf output sets it via PdfStandard.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public void ConvertToPdfA(
	PdfStandard pdfStandard
)

Parameters

pdfStandard  PdfStandard
Target conformance level. Must be one of PdfA, PdfA2B, or PdfA3B. PDF/X and Full are rejected.
Exceptions
ExceptionCondition
PdfDocumentExceptionThrown when called on a document that is not a loaded document, when pdfStandard is not one of the supported PDF/A levels, or when the conversion fails (for example when a required font cannot be embedded).
Remarks
The conversion walks every font descriptor, re-embeds / subsets where required by the target profile, and writes the profile's XMP metadata + output intent. Subsequent Save(String) / Save(Stream) emits the conformant PDF. Typical cost: a few hundred ms for text-only documents; seconds for image-heavy docs. Missing font programs are resolved from the host's installed fonts (see PdfSystemFonts). Validate the output with veraPDF or Acrobat Preflight.
Example
PdfDocument document = new PdfDocument("input.pdf");
document.ConvertToPdfA(PdfStandard.PdfA2B);
document.Save("archive.pdf");
document.Close();
See Also