[pdftex] Some problems with form Xobjects and \pdfliteral

Thomas Lavergne thomas.lavergne at reveurs.org
Thu May 21 14:35:31 CEST 2009

On Thu, May 21, 2009 at 02:07:28PM +0200, Paweł Jackowski wrote:
> Thomas,
>> This new Resources and XObject dictionary are not merged with the ones
>> produced by pdftex, so my entries are ignored by viewers. So I cannot
>> create myself a name for my form XObjects.
> Indeed, you can't.
>> A solution to solve this is to let pdftex create himself the names, for
>> this I have to use \pdfrefxobject. But this led to two problems :
> [...]
> Starting from 1.30.0 pdfTeX has a primitive \pdfxformname<objnum>.  
> Doesn't that help you?
> 	\setbox0=\hbox{qq}
> 	\immediate\pdfxform0
> 	\tt/Fm\pdfxformname\pdflastxform
> 	\end

First thanks for your quick reply and your help.

I doesn't know this primitive, I had not seen that my manual was
outdated. This a first step in solving my problem since this allow me to
get the XObject name cleanly.

But the main problem remains. In order to use the XObject in a
\pdfliteral, I need two things :
 - The object have to be in the pdf file, this is done by the \immediate
   preceding the \pdfxform to ensure the XObject is written.
 - The name have to be present in the XObject dictionary in the
   Ressource dictionnary of the current page. And it seems that pdftex
   add it only if it found a reference to the name in the document. And
   it doesn't found reference in \pdfliteral.

So even if I can get the name of the object with \pdfxformname, I still
must call \pdfrefxform in order to get the name defined. So I still have
my labels drawn somewhere else on the page.

With your example: If you look at the produced PDF, there is no XObject
dictionary in the ressources of the page. You have to add a \pdfrefxform
to get it.

Have you any idea for this problem ?



Thomas Lavergne                    "Entia non sunt multiplicanda praeter
                                     necessitatem." (Guillaume d'Ockham)
thomas.lavergne at reveurs.org                            http://oniros.org

More information about the pdftex mailing list