An interesting box transformation I have found on the following page:
https://tex.stackexchange.com/a/169549/26458
is pdf-trans package. It seems there is no manual available. Only example is provided. However, I could not find even an example of boxgs{arg1}{arg2}. Could anybody explain the usage of the command? Especially the arguments spec?
Asked
Active
Viewed 93 times
1
Say OL
- 1,793
1 Answers
2
\boxgs is defined via
% box painted according to graphic state parameters (ie. on layer).
\def\boxgs#1#2{%
\hbox\transboxdef
\pdfliteral{q #1}%
\savebp\trans:def\wd\transbox
\box\transbox
\pdfliteral{#2 Q 1 0 0 1 \trans:def\space 0 cm}%
\transboxend}
So this is a lower level macro than the ones in the example file for standardard transformations such as rotate and scale etc.
The above definition uses other internal helper macros of the package but hopefully the basic intention is clear it sets a (following) box but preceded by the literal PDF in #1 and followed by the PDF in #2 together with some housekeeping PDF that is saving and restoring the state.
Hence the example that you link to
\boxgs{Q q 2 Tr 0.3 w 0.47 0.6157 0.38 RG 1 0 0 rg }{}%
\copy\qbox
is showing the contents of \qrbox transformed by the PDF operators Q q 2 Tr 0.3 w 0.47 0.6157 0.38 RG 1 0 0 rg (which do a translation and set some colours)
David Carlisle
- 757,742
PDF operators? Could you indicate the documentation? – Say OL Nov 24 '18 at 10:07