[XeTeX] analogues of \pdfobj?

Heiko Oberdiek heiko.oberdiek at googlemail.com
Fri Aug 26 12:32:14 CEST 2011

On Fri, Aug 26, 2011 at 11:40:11AM +0200, Oleg Parashchenko wrote:

> does XeTeX provide analogues of the pdfTeX commands
> \pdfobj reserveobjnum {...}
> \pdfobj useobjnum {...}
> \pdflastobj

Yes and no.
Unhappily there isn't any comprehensive documentation of XeTeX.
The syntax of \special{pdf:...} are explained in the documentation
of dvipdfm and dvipdfmx-special.
However XeTeX can only output UTF-8 (AFAIK), thus for arbitrary
binary data it's tricky (Hexadecimal syntax for strings,
#-syntax for names, Filter ASCII85Decode or ASCIIHexDecode for streams, ...)

In your case:
* \pdfobj reserveobjnum and \pdflastobj are not necessary, the
  object numbers are remembered by arbitrary user names preceded
  by "@" in the code of the \special{pdf:...}. The object number
  is not known at TeX level, AFAIK there is no need for this.
* \pdfobj useobjnum/pdfobj: Objects can be constructed by
    \special{pdf:object ...}
    \special{pdf:put ...}
    \special{pdf:close ...}
    \special{pdf:stream ...} (dvipdfmx)
    \special{pdf:fstream ...} (dvipdfmx)

Yours sincerely
  Heiko Oberdiek

More information about the XeTeX mailing list