[luatex] Problems with page_objnum_provider / PDF cannot be read by Adobe Acrobat

Patrick Gundlach patrick at gundla.ch
Tue Oct 22 16:09:14 CEST 2019


Hi all,

this code creates a PDF with 100 pages which looks fine in Skim (a Mac PDF viewer), but fails to render in Adobe Acrobat.

When I set the number of pages to 10, everything is fine.

(Everything > 10 seems to break Adobe Acrobat - current release)

Patrick



\startluacode
   local list
   local n = 0
   callback.register("page_objnum_provider",function(objnum)
       if not list then
           list = { }
           for i=1,tex.count[0] do
               list[i] = pdf.getpageref(i)
           end
           list[#list],   list[1] = list[1], list[#list]
           list[#list-1], list[2] = list[2], list[#list-1]
       end
       n = n + 1
       return list[n]
   end)
\stopluacode

\starttext

   \dorecurse{11}{
       \startTEXpage #1 \stopTEXpage
   }

\stoptext


(PDF available at https://download.speedata.de/private/test.pdf)





More information about the luatex mailing list