[luatex] pdf.reserveobj()

Andreas Matthias andreas.matthias at gmail.com
Wed Apr 28 13:50:31 CEST 2021


The example below should create two annotations. But actually just
the first annotation (`annot1`) is written to the pdf, the second (`annot2`)
is missing. Although the /Annots array contains two references, the
second one dangling. Why is the second annotation missing?

\pdfvariable compresslevel = 0
\directlua{
  local annot1 = node.new(node.id('whatsit'), node.subtype('pdf_annot'))
  node.write(annot1)

  local annot2 = node.new(node.id('whatsit'), node.subtype('pdf_annot'))
  local objnum = pdf.reserveobj()
  annot2.objnum = objnum
  node.write(annot2)
}
\bye


Andreas


More information about the luatex mailing list.