Skip to main content

Module pdf

Module pdf 

Source
Expand description

Document assembly: pages of canvas content, document metadata, and the save path. Pdf is a plain struct — the fields are the composition, and Default fills everything optional.

Structs§

Attachment
A document-level attachment, embedded via the catalog’s /Names /EmbeddedFiles name tree (ISO 32000 §7.11.4). Unlike a page’s painted content, an attachment carries no rendering — only the bytes and the metadata a viewer shows about them.
Bookmark
One outline entry: a title, the page it jumps to, and nested children.
Date
A calendar date and time with a UTC offset, for /CreationDate and /ModDate. The writer never reads a clock — dates appear in output only when a caller provides them, keeping builds reproducible.
LinkAnnotation
A clickable rectangle on a page that opens a URI or jumps to a page in the same document (a /Link annotation with a /URI or /GoTo action; ISO 32000 §12.5.6.5, §12.6.4.7, §12.3.2).
Metadata
Document information written to the /Info dictionary. Every field is optional; an all-None value writes no dictionary at all.
Outline
A document’s bookmark panel: an ordered forest of Bookmark nodes, each linking to a page via an explicit /XYZ destination.
Page
One page: its size, rotation, painted content and link annotations.
PageLabel
One page-numbering range, taking effect from first_page (0-based) until the next range’s first_page or the document’s end (ISO 32000 §12.4.2). A document’s page_labels must include a range with first_page == 0 whenever it is non-empty.
Pdf
A document under construction. The fields are the composition: singleton slots are Options, pages keep the order given.
Viewer
Viewer preferences written to the catalog: initial layout, navigation mode, and the page opened at document start (ISO 32000 §7.7.2).

Enums§

LabelStyle
A page-numbering style for a PageLabel range, written as its /S (ISO 32000 §12.4.2, Table 159).
LinkTarget
Where a LinkAnnotation leads.
PageLayout
Initial page-layout mode, written as the catalog’s /PageLayout (ISO 32000 §7.7.2, Table 27).
PageMode
Initial navigation-panel mode, written as the catalog’s /PageMode (ISO 32000 §7.7.2, Table 28).
PageSize
A page size, in default user-space units (1/72 inch), portrait.