Discussion:
Bug: When nesting Form XObject reference in <box>, \pdfxform resources {<resources>} <box> -> missing user-provided <resources>
(too old to reply)
Alexander Grahn
2018-03-19 10:20:48 UTC
Permalink
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Kind regards,
Alexander
Karl Berry
2018-03-20 22:48:13 UTC
Permalink
Hi Alexander,
Post by Alexander Grahn
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.
Thanks for the report. I installed Hans's patch (thanks Hans!!) for this
in TL (r47051). It will be a couple days before binaries are updated. -k
Loading...