Builds PDF indirect object definitions (catalog, pages, page, stream).
Summary
Functions
Catalog: root of the document. References the Pages tree.
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, ...]
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".
Functions
Catalog: root of the document. References the Pages tree.
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, ...]
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".