summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def44
1 files changed, 26 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
index 1ba7515684b..d39078338a5 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
@@ -1,4 +1,5 @@
% Copyright 2006 by Till Tantau
+% CMYK and grayscale shadings adaptation copyright 2019 by David Purton
%
% This file may be distributed and/or modified
%
@@ -12,7 +13,8 @@
% Common driver commands for all drivers that produce pdf via the
% detour of a dvi file
-
+% For unique object name:
+\newcount\pgfsys@objnum\pgfsys@objnum\@ne
% Hboxes
@@ -24,37 +26,41 @@
{%
\pgf@parsefunc{#3}%
\pgf@process{\pgfpoint{\pgf@max}{#2}}%
- \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgf@max\space height \the\pgf@y}}}\@temp%
+ \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade\the\pgfsys@objnum\space width \the\pgf@max\space height \the\pgf@y}}}\@temp%
\edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: put @resources <<
/Shading << /Sh << /ShadingType 2
- /ColorSpace /DeviceRGB
+ /ColorSpace \pgf@shading@device\space
/Domain [\pgf@pdfparseddomain]
/Coords [\pgf@doma\space0 \pgf@domb\space0]
/Function \pgf@pdfparsedfunction
/Extend [false false] >> >> >>}}}\@temp% <<
\pgfutil@insertatbegincurrentpage{\special{pdf: content /Sh sh}%
\special{pdf: endxobj}}%
- \expandafter\xdef\csname @pgfshading#1!\endcsname{%
- \hbox to\the\pgf@max{\vbox to#2{\vfil\special{pdf: usexobj @pgfshade#1}}\hfil}}%
+ \xdef\pgfutil@tempa{%
+ \hbox to\the\pgf@max{\vbox to#2{\vfil\special{pdf: usexobj @pgfshade\the\pgfsys@objnum}}\hfil}}%
}%
+ \global\expandafter\let\csname @pgfshading#1!\endcsname=\pgfutil@tempa
+ \global\advance\pgfsys@objnum\@ne
}
\def\pgfsys@vertshading#1#2#3{%
{%
\pgf@parsefunc{#3}%
\pgf@process{\pgfpoint{\pgf@max}{#2}}%
- \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgf@y\space height \the\pgf@max\space}}}\@temp%
+ \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade\the\pgfsys@objnum\space width \the\pgf@y\space height \the\pgf@max\space}}}\@temp%
\edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: put @resources <<
/Shading << /Sh << /ShadingType 2
- /ColorSpace /DeviceRGB
+ /ColorSpace \pgf@shading@device\space
/Domain [\pgf@pdfparseddomain]
/Coords [0 \pgf@doma\space0 \pgf@domb]
/Function \pgf@pdfparsedfunction
/Extend [false false] >> >> >>}}}\@temp% <<
\pgfutil@insertatbegincurrentpage{\special{pdf: content /Sh sh}%
\special{pdf: endxobj}}%
- \expandafter\xdef\csname @pgfshading#1!\endcsname{%
- \hbox to#2{\vbox to\the\pgf@max{\vfil\special{pdf: usexobj @pgfshade#1}}\hfil}}%
+ \xdef\pgfutil@tempa{%
+ \hbox to#2{\vbox to\the\pgf@max{\vfil\special{pdf: usexobj @pgfshade\the\pgfsys@objnum}}\hfil}}%
}%
+ \global\expandafter\let\csname @pgfshading#1!\endcsname=\pgfutil@tempa
+ \global\advance\pgfsys@objnum\@ne
}
\def\pgfsys@radialshading#1#2#3{%
{%
@@ -70,19 +76,21 @@
\pgf@sys@bp@correct{\pgf@xa}%
\pgf@sys@bp@correct{\pgf@ya}%
\pgfutil@tempdima=2\pgf@max\relax%
- \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgfutil@tempdima\space height \the\pgfutil@tempdima}}}\@temp%
+ \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade\the\pgfsys@objnum\space width \the\pgfutil@tempdima\space height \the\pgfutil@tempdima}}}\@temp%
\edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: put @resources <<
/Shading << /Sh << /ShadingType 3
- /ColorSpace /DeviceRGB
+ /ColorSpace \pgf@shading@device\space
/Domain [\pgf@pdfparseddomain]
/Coords [\pgf@sys@tonumber{\pgf@xa} \pgf@sys@tonumber{\pgf@ya} \pgf@doma\space \pgf@sys@tonumber{\pgf@x} \pgf@sys@tonumber{\pgf@y} \pgf@domb]
/Function \pgf@pdfparsedfunction
/Extend [true false] >> >> >>}}}\@temp% <<
\pgfutil@insertatbegincurrentpage{\special{pdf: content /Sh sh}%
\special{pdf: endxobj}}%
- \expandafter\xdef\csname @pgfshading#1!\endcsname{%
- \hbox to\the\pgfutil@tempdima{\vbox to\the\pgfutil@tempdima{\vfil\special{pdf: usexobj @pgfshade#1}}\hfil}}%
+ \xdef\pgfutil@tempa{%
+ \hbox to\the\pgfutil@tempdima{\vbox to\the\pgfutil@tempdima{\vfil\special{pdf: usexobj @pgfshade\the\pgfsys@objnum}}\hfil}}%
}%
+ \global\expandafter\let\csname @pgfshading#1!\endcsname=\pgfutil@tempa
+ \global\advance\pgfsys@objnum\@ne
}%
\def\pgf@sys@pdf@dvi@tracker{
@@ -123,15 +131,15 @@
\pgf@sys@pdf@any@resourcesfalse%
\ifpgf@sys@pdf@extgs@exists%
\pgf@sys@pdf@any@resourcestrue%
- \ifpgf@sys@pdf@extgs@created \else \special{pdf: obj @pgfextgs <<>>} \global\pgf@sys@pdf@extgs@createdtrue \fi% <<
+ \ifpgf@sys@pdf@extgs@created \else \special{pdf: obj @pgfextgs <<>>} \global\pgf@sys@pdf@extgs@createdtrue \fi% <<
\fi%
\ifpgf@sys@pdf@colorspaces@exists%
\pgf@sys@pdf@any@resourcestrue%
- \ifpgf@sys@pdf@colorspaces@created \else \special{pdf: obj @pgfcolorspaces <<>>} \global\pgf@sys@pdf@colorspaces@createdtrue \fi% <<
+ \ifpgf@sys@pdf@colorspaces@created \else \special{pdf: obj @pgfcolorspaces <<>>} \global\pgf@sys@pdf@colorspaces@createdtrue \fi% <<
\fi%
\ifpgf@sys@pdf@patterns@exists%
\pgf@sys@pdf@any@resourcestrue%
- \ifpgf@sys@pdf@patterns@created \else \special{pdf: obj @pgfpatterns <<>>} \global\pgf@sys@pdf@patterns@createdtrue \fi% <<
+ \ifpgf@sys@pdf@patterns@created \else \special{pdf: obj @pgfpatterns <<>>} \global\pgf@sys@pdf@patterns@createdtrue \fi% <<
\fi%
\ifpgf@sys@pdf@any@resources%
\special{pdf: put @resources <<
@@ -159,6 +167,6 @@
\endinput
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
-%%% End:
+%%% End: