[luatex] Bug: When nesting Form XObject reference in <box>, \pdfxform resources {<resources>} <box> -> missing user-provided <resources>

Hans Hagen j.hagen at xs4all.nl
Mon Mar 19 11:52:49 CET 2018


On 3/19/2018 11:20 AM, Alexander Grahn wrote:
> Dear all,
> 
> it seems that I discovered a bug in connection with nested Form XObjects
> (pdftex built-in \pdfxform) that occurs in pdfTeX as well as in LuaTeX.
> 
> The \pdfxform built-in provides the optional `resources {<resources>}'
> argument, as in
> 
>    \pdfxform resources {<resources>} <box>
> 
> , in order to allow the user to insert additional entries in the /Resources
> dictionary of the Form XObject to be produced from box register <box>.
> 
> This works as advertised for ordinary box content (1st \pdfxform in the code
> below), but as soon as another Form XObject is referenced inside <box>, the
> `resources {...}' argument is ignored and user-provided <resources> are missing
> in the generated PDF code (2nd \pdfxform).
> 
> Here is a minimal example for pdfTeX and LuaTeX for demonstration. The PDF
> object numbers mentioned in the comments are different in the PDF output from
> LuaTeX.
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> % Bug: When nesting Form XObject reference in <box>,
> %      \pdfxform resources {<resources>} <box>
> %      --> missing user-provided <resources>
> 
> \input luatex85.sty
> 
> \pdfcompresslevel=0
> \pdfobjcompresslevel=0
> 
> \setbox0=\hbox{World}
> \edef\wrldwd{\the\wd0}
> 
> \pdfxform
> attr {}
> resources {/Properties <</Key1 (Val1)>>} % OK
> 0
> 
> %nesting Form XObject reference
> \setbox0=\hbox{Hello \hbox to \wrldwd {\pdfrefxform\pdflastxform\hss}!}
> 
> \pdfxform
> attr {}
> % /Properties <<...>> missing in /Resources dict (object `8 0'), ref'ed in
> resources {/Properties <</Key2 (Val2)>>}%       Form XObject (object `2 0')
> 0
> 
> \pdfrefxform\pdflastxform
> 
> \bye
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

there is no nesting stack kept there ...

\immediate\pdfxform ...

works ok

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the luatex mailing list