Skip to main content

Interface: DocumentOptions

Properties

PropertyTypeDescription
compress?booleanWhether eligible streams are compressed with FlateDecode.
conformance?DocumentConformanceProfilePDF/A or PDF/UA conformance profile to validate and emit.
defaultPageSize?PageSizePage size used when a page does not specify its own size.
defaults?TextDefaultsDocument-wide text defaults filled in when a text call omits them.
encryption?DocumentEncryptionOptionsPassword encryption settings for serialized output.
info?DocumentInfoDocument information dictionary values.
language?stringBCP 47 language tag for document or structure content.
linearize?booleanExperimental Whether to emit a linearization dictionary for Fast Web View style delivery. — limited to single-page unencrypted documents. Not compatible with object streams, encryption, or detached signatures.
objectStreams?booleanWhether to emit compressed object streams and xref streams.
outputIntent?DocumentOutputIntentOptionsICC output intent required by color-managed profiles such as PDF/A.
roleMap?PdfRoleMapMapping from custom structure roles to standard PDF roles.
shapeDefaults?ShapeStyleDocument-wide default styling for the PdfPage shape helpers (rect, line, circle, ellipse). Per-call ShapeStyle fields override these.
signature?DocumentSignatureOptionsDetached digital-signature options for serialized output.
structureRoot?false | PdfContainerTagRoot structure tag to emit, or false to suppress a custom root.
tagged?booleanWhether to emit tagged PDF structure metadata.
textShaper?TextShaperCustom text shaper for complex script shaping (Devanagari, Arabic, Thai, etc.). When provided, the shaper is called for each text run that requires shaping. If not provided, the default shaper handles basic ligature and joining-form substitution but will throw an UNSUPPORTED_SCRIPT error for Devanagari and other complex scripts. External shapers such as harfbuzzjs or fontkit can be plugged in to enable full shaping support.
title?stringDocument title applied to the information dictionary, structured XMP metadata, and display-title viewer preference.
xmpMetadata?XmpMetadataInputXMP metadata packet or structured XMP metadata input.