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?


\boxgs is defined via

% box painted according to graphic state parameters (ie. on layer).

  \pdfliteral{q #1}%
  \pdfliteral{#2 Q 1 0 0 1 \trans:def\space 0 cm}%

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 }{}%

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.