Skip to main content

Module pdfext

Module pdfext 

Source
Expand description

\pdfextension (LuaTeX manual §3.2.2): PDF literals, matrices, colour stacks, objects, annotations, links, destinations, outlines and document-level dictionaries.

Commands that act at shipout become whatsit nodes in the current list; document-level data is collected in PdfState for the backend.

§Object numbers

The engine and the PDF writer share one object counter (PdfState::counter), so the numbers TeX and Lua see (\pdffeedback lastobj, pdf.getpageref, …) are those in the file. Observed in LuaTeX 1.22:

  • \pdfextension annot and startlink take their number when they are scanned; continuation rectangles of a link get theirs at shipout.
  • A named or numbered destination gets its number the first time it is referred to (by an outline or open action when it is scanned, by a link when the page is written) or met at shipout, whichever comes first. Pages likewise (goto page, \pdffeedback pageref).
  • \pdfextension outline allocates the action (written at once), the numbers of the destination it refers to, the entry, and the title (written at once as (title) and a newline).
  • Destinations that were referred to but never defined are written at the end as [ last-page 0 R /Fit ], in the reverse order of their allocation, each with a warning.

Modules§

colorstack_cmd
Colour-stack commands.
literal_mode
Literal modes (mode of pdf_literal whatsits).

Structs§

ActiveLink
A link whose \pdfextension endlink has not been shipped yet.
ColorStack
Colour-stack definition.
DestEntry
A destination known by its identifier.
DestView
The view of \pdfextension dest.
DocItems
Document-level items computed at the end of the run for the backend.
LateLuaContext
State of the \latelua call being executed at shipout.
LinkPiece
One rectangle of a link, as written.
LuaPdfTexts
Dictionary texts set from Lua (pdf.setcatalog and friends). They are independent of the token lists set at the TeX end and are written after them; None means never set (the getters return nil).
Outline
An outline entry (\pdfextension outline).
PageItems
The interactive items of the page being shipped, handed to the backend when the page ends.
PdfObject
A PDF object created with \pdfextension obj.
PdfState
Document-level PDF state.

Enums§

ActionTarget
What an action refers to.
DestId
Identifies a destination (name {…} or num n).
DestKind
The destination types of \pdfextension dest.
DestPos
A destination’s view in page coordinates (sp), for the backend.
ObjKind
Kinds of PDF object numbers, as pdf.getobjtype names them.
PdfAction
An action specification (user, goto, thread).

Type Aliases§

AnnotBody
An annotation’s rectangle (sp, page coordinates) and text.