Builds PDF indirect object definitions (catalog, pages, page, stream).
Summary
Functions
Catalog: root of the document. References the Pages tree.
ExtGState dict carrying constant fill + stroke alpha.
FontDescriptor for an embedded TrueType font. metrics comes from
PrawnEx.Font.TrueType.parse/1.
Embedded TrueType font program: /FontFile2 stream, flate-compressed.
Image XObject: stream dict + data.
Returns the PDF fragment for an indirect object: "n 0 obj ... endobj"
Link annotation: /Type /Annot /Subtype /Link /Rect [ llx lly urx ury ] /A << /S /URI /URI (url) >>
Single page: /Type /Page, /Parent, /MediaBox, /Contents, /Resources. Optional /Annots.
Pages tree: /Type /Pages, /Count n, /Kids [id1 0 R, id2 0 R, ...]
General resources dict.
Resources dict with built-in font(s). font_names: list of e.g. ["Helvetica", "Times-Bold"]. Emits /F1, /F2, ... for each. Empty list defaults to ["Helvetica"].
Resources dict with fonts and XObject refs. xobject_refs: [{"Im1", 7}] -> /Im1 7 0 R
Stream object body: dictionary + stream data. Caller adds "n 0 obj " and "endobj".
Simple /TrueType font dict with WinAnsi encoding and explicit widths.
Functions
Catalog: root of the document. References the Pages tree.
ExtGState dict carrying constant fill + stroke alpha.
FontDescriptor for an embedded TrueType font. metrics comes from
PrawnEx.Font.TrueType.parse/1.
Embedded TrueType font program: /FontFile2 stream, flate-compressed.
Image XObject: stream dict + data.
filter: :dct—datais a full JPEG bitstream (/DCTDecode).filter: :flate—datais raw top-to-bottom RGB pixels (/FlateDecode).
Returns the PDF fragment for an indirect object: "n 0 obj ... endobj"
Link annotation: /Type /Annot /Subtype /Link /Rect [ llx lly urx ury ] /A << /S /URI /URI (url) >>
Single page: /Type /Page, /Parent, /MediaBox, /Contents, /Resources. Optional /Annots.
Pages tree: /Type /Pages, /Count n, /Kids [id1 0 R, id2 0 R, ...]
General resources dict.
font_entries — [{"F1", {:base14, "Helvetica"}} | {"F2", {:ref, id}}]
xobject_refs — [{"Im1", id}]; gs_refs — [{"GS1", id}].
Resources dict with built-in font(s). font_names: list of e.g. ["Helvetica", "Times-Bold"]. Emits /F1, /F2, ... for each. Empty list defaults to ["Helvetica"].
Resources dict with fonts and XObject refs. xobject_refs: [{"Im1", 7}] -> /Im1 7 0 R
Stream object body: dictionary + stream data. Caller adds "n 0 obj " and "endobj".
Simple /TrueType font dict with WinAnsi encoding and explicit widths.