[latex3-commits] [git/LaTeX3-latex3-pdfresources] backendtest: working on extgstate ... (84079a6)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue Aug 6 16:39:01 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : backendtest
Link       : https://github.com/latex3/pdfresources/commit/84079a6494d38254ddd5c0848ad184e62dd64acc

>---------------------------------------------------------------

commit 84079a6494d38254ddd5c0848ad184e62dd64acc
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Aug 6 16:39:01 2019 +0200

    working on extgstate ...


>---------------------------------------------------------------

84079a6494d38254ddd5c0848ad184e62dd64acc
 experiments/colorspace-resources.tex |  22 ++++++++++++++++++++++
 experiments/extgstate.tex            |  24 ++++++++++++++++++------
 experiments/preflight-colorspace.PNG | Bin 0 -> 14871 bytes
 pdfresources.dtx                     |  17 ++++++++++++-----
 4 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/experiments/colorspace-resources.tex b/experiments/colorspace-resources.tex
new file mode 100644
index 0000000..c36e589
--- /dev/null
+++ b/experiments/colorspace-resources.tex
@@ -0,0 +1,22 @@
+\documentclass[12pt]{scrartcl}
+\usepackage{l3pdf,graphicx}
+\ExplSyntaxOn
+\pdf_uncompress:
+\ExplSyntaxOff
+\usepackage{colorspace}
+\definespotcolor{foo}{BarTone 555 GN}{.8,.2,.5,.3}
+\begin{document}
+This document uses a spot color on one page but not on the next.
+The /ColorSpace resource is identical for all pages. But preflight 
+has no problems to recognize that only page one has a spot color:
+
+\includegraphics[width=4cm]{preflight-colorspace}
+
+
+cde \textcolor{foo}{abc}
+
+\newpage
+
+cde
+
+\end{document}
diff --git a/experiments/extgstate.tex b/experiments/extgstate.tex
index 5a9050d..ebe8a82 100644
--- a/experiments/extgstate.tex
+++ b/experiments/extgstate.tex
@@ -8,26 +8,38 @@
 \ExplSyntaxOff
 
 \begin{document}
-abc
 \special{pdf:obj @pgfextgs1 <<>>}
-\special{pdf:obj @pgfextgs2 <<>>}
+abc 
+% not good one value overwrites the other
+%\special{pdf:pageresources <</ExtGState<< /bearopacity <</ca 1/CA 1>>>>>> }
+%\special{pdf:pageresources <</ExtGState<< /duckopacity <</ca 0.7/CA 0.7>>>>>> }
+
+%not good, is ignored
+%\special{pdf:pageresources <</ExtGState @pgfextgs1>> }
+
 \special{pdf:put @pgfextgs1 << /bearopacity <</ca 1/CA 1>>>>}
 \special{pdf:put @pgfextgs1 << /bearopacity <</ca 1/CA 1>>>>}
 \special{pdf:put @pgfextgs1 << /bearopacity <</ca 1/CA 1>>>>}
 \special{pdf:put @pgfextgs1 << /duckopacity <</ca 0.7/CA 0.7>>>>}
 \special{pdf:put @pgfextgs1 << /duckopacity <</ca 0.5/CA 0.5>>>>}
 
+%
+% this works fine, but must be done on every page. 
 \special{pdf:put @resources
       << /ExtGState @pgfextgs1 >>}
 
+% not good is ignored
+%\special{pdf:pageresources <</ExtGState @pgfextgs1>> }
+
 \newpage
-%on the same page this would not be good ...
+% repeat ...
 \special{pdf:put @resources
-      << /ExtGState @pgfextgs2 >>}
-
-\special{pdf:put @pgfextgs2 << /marmotopacity <</ca 0.5/CA 0.5>>>>}
+      << /ExtGState @pgfextgs1 >>}
 
+\special{pdf:put @pgfextgs1 << /marmotopacity <</ca 0.5/CA 0.5>>>>}
 
+% not good, only on page 2
+%\special{pdf:pageresources <</ExtGState<< /bearopacity <</ca 1/CA 1>>>>>> }
   abc
 \end{document}
 \newpage
diff --git a/experiments/preflight-colorspace.PNG b/experiments/preflight-colorspace.PNG
new file mode 100644
index 0000000..5c998d3
Binary files /dev/null and b/experiments/preflight-colorspace.PNG differ
diff --git a/pdfresources.dtx b/pdfresources.dtx
index d789a6b..1cfef7d 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -1224,12 +1224,19 @@
 %    \end{macrocode}
 %
 % =======================================
-% \subsection{page resources / ExtGState, ColorSpace, Shading, Pattern }
-% ===================================
-% \subsection{backend / pageresources}
-% \begin{NOTE}{UF} Implementation for dvips missing (perhaps impossible ...), for xetex untested.
-% \enquote{Correct} content needed at every shipout
+% \subsection{page resources: ExtGState, ColorSpace, Shading, Pattern }
+% \begin{NOTE}{UF}
+% Only for pdf/luatex and xdvipdfmx backend/pdf-code is needed to add values to this resources.
+% With dvips the resources are added through high-level code (e.g. transparency), so the
+% backend/pdf commands are no-ops.
+% For every resources there is only one object. References to these objects are added to
+% all pages and XObjects.
+% I don't see a need to set e.g. /ColorSpace pagewise: preflight handles this fine, see experiment
+% colorspace-resources.
+% As pgf does the same, there is a need to patch it for now. Ditto colorspace.
 % \end{NOTE}
+% ===================================
+% \subsubsection{ page resources / backend}
 %    \begin{macrocode}
 %<*package>
 % backend commands the command to fill the register





More information about the latex3-commits mailing list