Skip to main content

Module image

Module image 

Source
Expand description

Image resources: \saveimageresource, \useimageresource, \lastsavedimageresourceindex and \lastsavedimageresourcepages.

Behaviour established black-box against LuaTeX 1.22:

  • \saveimageresource takes, in any order, width, height, depth (dimensions), attr {…}, named {…}, page n, colorspace n, userpassword {…}, ownerpassword {…} and a page box keyword (mediabox, cropbox, bleedbox, trimbox, artbox), then the file name in braces.
  • A resource’s index (\lastsavedimageresourceindex, \lastsavedboxresourceindex, the number \useimageresource and \useboxresource take) is the PDF object number reserved for it, so \the\lastsavedboxresourceindex\space 0 R refers to the form (pgf’s soft masks rely on this). pdf.getobjtype reports ximage or xform for it.
  • \useimageresource [width…] [height…] [depth…] n appends a rule node of subtype 2 (shown as \image(h+d)xw) in any mode.
  • Sizes given to either command are completed from the image’s natural aspect ratio: a width alone sets height = width × h₀ / w₀; a height (plus depth) alone sets width = (height + depth) × w₀ / h₀.
  • The image is written to the PDF when it is first shipped out, or at once with \immediate. Its file name, as found, is printed as <path> then: at once with \immediate, otherwise at the end of the page (after the page’s \writes), in the order of first use.

Structs§

BoxResource
A saved box resource (\saveboxresource): a TeX box written as a PDF form XObject when first used (or at once with \immediate).
ImageResource
A saved image resource.

Constants§

BOX_RESOURCE_RULE
Rule subtype of box-resource nodes (\useboxresource).
IMAGE_RULE
Rule subtype of image nodes.