[XeTeX] Overprinting (was Outputing PDFs in CMYK ColorSpace)

Clinton Gormley clint at traveljury.com
Fri Jan 22 03:18:23 CET 2010


I've figured out that the reason overprint.sty
( http://tex.aanhet.net/overprint/ ) doesn't work with xelatex is
because it only tests for 'pdftex.def'.

I tried just removing the test, but there is pdftex specific stuff in
there, and I haven't a clue where to start looking for the equivalent in
xelatex

I'm a complete newbie and am hoping that somebody could help out
converting the code to work with xelatex.

living in hope...

clint

Code below:

\let\set at op\relax

\newif\if at op
\def\overprint{%
  \@optrue
  \set at op
  \ignorespaces
}
\def\knockout{%
  \@opfalse
  \set at op
  \ignorespaces
}

\def\testname{pdftex.def}
\ifx \Gin at driver \testname
  % Create graphics state dictionaries with overprint settings
  % Delay this until after the preamble
  % because of restrictions of the pdf format.
  %
  \AtBeginDocument{
    \immediate\pdfobj{<< /Type /ExtGState /op false /OP false /OPM 0 >>}
    \edef\op at off{\the\pdflastobj}
    \immediate\pdfobj{<< /Type /ExtGState /op true /OP true /OPM 1 >>}
    \edef\op at on{\the\pdflastobj}
    \immediate\pdfobj{ << %
      /GSko \op at off\space 0 R %
      /GSop \op at on\space 0 R >>}
    \edef\@extgs{\the\pdflastobj}
    \edef\next{\global\noexpand\pdfpageresources={\the\pdfpageresources
      \space /ExtGState \@extgs\space 0 R }}
    \next
    %\edef\next{\global\noexpand\pdfpageresources={\the\pdfpageresources
    %  \space /ExtGState #1\space 0 R }}
    %\next{\@extgs}
  }
  % macros for setting and resetting overprint state
  \def\set at op{%
    \if at op
      \pdfliteral direct {/GSop gs}%
    \else
      \pdfliteral direct {/GSko gs}%
    \fi
    \aftergroup\reset at op}
  \def\reset at op{%
    \if at op
      \pdfliteral direct {/GSop gs}%
    \else
      \pdfliteral direct {/GSko gs}%
    \fi
  }
\fi




More information about the XeTeX mailing list