[pdftex] Doing it as niftily as pdftex.def ...

Andreas Matthias amat at kabsi.at
Sun Jun 1 17:13:37 CEST 2003


I'm on the track of pdftex.def but now I don't get along.
The following example rotates some text, first by using
\rotatebox and second by using \pdfliteral directly.


   \pdfcompresslevel=0
   \documentclass{minimal}
   \usepackage{graphicx}

   \begin{document}
   start \rotatebox{45}{foo} end

   \pdfliteral{}% just to break text object

   start \pdfliteral{q 0.70709  0.70709  -0.70709  0.70709  0 0 cm}%
   foo \pdfliteral{Q}\hskip10pt
   end
   \end{document}


After work \rotatebox simply ends the text object (ET) and
restores the graphics state (Q). This is nifty.

   BT
   /F8 9.963 Tf 0 0 Td[(fo)-27(o)]TJ
   ET
    Q

If I try to do the same with \pdfliteral (as in the example)
the CTM is changed just before Q. This is clumsy and useless.

   BT
   /F8 9.963 Tf 0 0 Td[(fo)-27(o)]TJ
   ET
   1 0 0 1 16.604 0 cm
   Q

Using `\pdfliteral direct {Q}' does not work, because then the
text object will /not/ be closed before Q. This is erroneous.

   BT
   /F8 9.963 Tf 0 0 Td[(fo)-27(o)]TJ
   Q
   [-1334(end)]TJ
   ET

I do not see what \rotatebox is doing differently. Can someone
give me a hint?


Ciao
Andreas



More information about the pdftex mailing list