Click or drag to resize
Pdf Library for .NET

PdfDocument(PdfStandard) Constructor

Creates an empty PDF document that conforms to the specified PDF standard — use this when you want from-scratch output to be PDF/A (archival) or PDF/X (print exchange) compliant. Equivalent to PdfDocument when pdfStandard is Full.

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

Parameters

pdfStandard  PdfStandard
Target conformance level: any PDF/A level or PdfX; Full produces a standard (non-conformant) document.
Remarks

Conformance level must be chosen before any pages are added: the conformance metadata and the output intent are written into the document when it is created.

Saving a PDF/A-1B document takes an additional pass to add the /CIDSet font information required by ISO 19005-1, which adds roughly 300–800 ms on small documents. PDF/A-2B and PDF/A-3B do not need that pass.

Font limitation — from-scratch PDF/A only. PDF/A rejects the 14 built-in PDF standard fonts (Helvetica, Times, Courier, Symbol, ZapfDingbats) because the spec requires fonts to be actually embedded as TrueType/OpenType. Using CreateStandardFont(PdfStandardFont, Single) on a document created with this constructor throws a PdfConformanceException at font- construction time. Until a public TrueType font API is available, from-scratch PDF/A output is limited to shapes-only content (rectangles, circles, lines, images). The HtmlToPdf path is unaffected — the converter embeds every font it uses as a TrueType subset.

Example
PdfDocument document = new PdfDocument(PdfStandard.PdfA2B);
PdfPage page = document.AddPage();
document.Save("archive.pdf");
document.Close();
See Also