Skip to main content

Module pdf

Module pdf 

Source
Expand description

PDF export: display structure in, PDF bytes out.

The painter for print. Everything it needs already exists on the page — glyph ids, absolute positions, page trim — so this stage places what layout decided and decides nothing itself.

Glyphs are shown at their own x, not at the font’s: kerning and justification put them where they are, and a PDF that re-derived positions from advances would disagree with the preview. The text each run was shaped from travels with it, so the writer can build the glyph-to-character map that makes the text selectable.

Links and the outline are layout’s too: each link arrives on its page with the areas it covers and the place it goes, and each outline entry with the place of its heading.

Enums§

PdfError
What can go wrong turning the display structure into a PDF.

Functions§

write
Writes one laid-out book as PDF bytes.