[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: extgstate patches for colorspace (23f8179)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon May 20 09:54:11 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : testlinkstuff
Link       : https://github.com/latex3/pdfresources/commit/23f8179507a4af46346f62ce220f0d0dd6dda189

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

commit 23f8179507a4af46346f62ce220f0d0dd6dda189
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon May 20 09:54:11 2019 +0200

    extgstate patches for colorspace


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

23f8179507a4af46346f62ce220f0d0dd6dda189
 pdfresources.dtx                       |   37 ++++++
 test-pageresource.tex                  |    1 +
 testfiles/extgstate-patches.luatex.tpf |  193 +++++++++++++++++++++++++++++++
 testfiles/extgstate-patches.pvt        |   19 ++++
 testfiles/extgstate-patches.tpf        |  194 ++++++++++++++++++++++++++++++++
 5 files changed, 444 insertions(+)

diff --git a/pdfresources.dtx b/pdfresources.dtx
index e0be452..c6855c3 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -786,6 +786,8 @@
 %<*package>
 \cs_set_eq:NN \pdf_pageresources_gput:nnn \driver_pdf_pageresources_gput:nnn
 \cs_set_eq:NN \pdf_pageresources_gput:nnnn \driver_pdf_pageresources_gput:nnnn
+\cs_generate_variant:Nn \pdf_pageresources_gput:nnnn {nnnx}
+\cs_generate_variant:Nn \pdf_pageresources_gput:nnn {nnx}
 %</package>
 %    \end{macrocode}
 % \subsection{The info dictionary}
@@ -1344,6 +1346,41 @@
   }
  }
 
+%colorspace.sty
+% rather difficult as no real places to inject patches
+% at first a try to avoid that it's ExtGState is missing:
+% it can not be avoided to recreate the objects (and so to get duplicates)
+% as colorspace uses temporary macros whose contents is lost.
+\AtEndPreamble
+{
+ \tl_if_exist:NT \spc at op
+ {
+  \driver_pdf_object_new:nn  {__spc_extgstate_op_false}{dict}
+  \driver_pdf_object_write:nn
+   {__spc_extgstate_op_false}
+   {/Type /ExtGState~/op~false~/OP~false}
+  \pdf_pageresources_gput:nnn
+   {ExtGState}
+   {SPCko}
+   {\driver_pdf_object_ref:n {__spc_extgstate_op_false}}
+  \driver_pdf_object_new:nn  {__spc_extgstate_op_true0}{dict}
+  \driver_pdf_object_write:nn{__spc_extgstate_op_true0}
+   {/Type /ExtGState~/op~true~/OP~true~/OPM~0}%
+  \pdf_pageresources_gput:nnn
+   {ExtGState}
+   {SPCmz}
+   {\driver_pdf_object_ref:n {__spc_extgstate_op_true0}}
+  \driver_pdf_object_new:nn  {__spc_extgstate_op_true1}{dict}
+  \driver_pdf_object_write:nn{__spc_extgstate_op_true1}
+   {/Type /ExtGState~/op~true~/OP~true~/OPM~1}%
+  \pdf_pageresources_gput:nnn
+   {ExtGState}
+   {SPCop}
+   {\driver_pdf_object_ref:n {__spc_extgstate_op_true1}}
+ \def\spc at Pageresources#1{}
+ }
+}
+
 %</package>
 %    \end{macrocode}
 % \PrintIndex
diff --git a/test-pageresource.tex b/test-pageresource.tex
index 03eb1fa..364fef6 100644
--- a/test-pageresource.tex
+++ b/test-pageresource.tex
@@ -54,6 +54,7 @@ hello
 abc
 
 \newpage \color{spot} xxxxxxxxxxxx
+\color{spot!50} xxxxxxxxx
 \end{document}
 
 abc
diff --git a/testfiles/extgstate-patches.luatex.tpf b/testfiles/extgstate-patches.luatex.tpf
new file mode 100644
index 0000000..6bc2eda
--- /dev/null
+++ b/testfiles/extgstate-patches.luatex.tpf
@@ -0,0 +1,193 @@
+%PDF-1.5
+%ÌÕÁÔÅØÐÄÆ
+9 0 obj
+<< /Type /ExtGState /op false /OP false >>
+endobj
+10 0 obj
+<< /Type /ExtGState /op true /OP true /OPM 0 >>
+endobj
+11 0 obj
+<< /Type /ExtGState /op true /OP true /OPM 1 >>
+endobj
+12 0 obj
+<< /SPCko 9 0 R /SPCmz 10 0 R /SPCop 11 0 R >>
+endobj
+13 0 obj
+<< /Type/ExtGState /op false /OP false >>
+endobj
+14 0 obj
+<< /Type/ExtGState /op true /OP true /OPM 0 >>
+endobj
+15 0 obj
+<< /Type/ExtGState /op true /OP true /OPM 1 >>
+endobj
+1 0 obj
+<< /SPCko 13 0 R /SPCmz 14 0 R /SPCop 15 0 R /TRP.6 <</ca .6/CA .6>> /TRP1 <</ca 1/CA 1>> /pgf at CA0.4  << /CA 0.4 >> /pgf at ca0.4  << /ca 0.4 >>  >>
+endobj
+2 0 obj
+<< /pgfprgb  [/Pattern /DeviceRGB]  >>
+endobj
+3 0 obj
+<<  >>
+endobj
+4 0 obj
+<<  >>
+endobj
+5 0 obj
+<<  >>
+endobj
+18 0 obj
+<< /Length 512 >>        
+stream
+/TRP1 gs
+/SPCop gs 
+0 g 0 G
+0 g 0 G
+0 g 0 G
+1 0 0 1 148.712 638.852 cm
+q 
+0 G 
+0 g 
+0.3985 w 
+q 
+q 
+/pgf at CA0.4 gs 
+/pgf at ca0.4 gs 
+1 0 0 rg 1 0 0 RG
+0.0 0.0 m 
+0.0 0.0 m 
+0.0 28.3468 l 
+28.3468 28.3468 l 
+28.3468 0.0 l 
+h 
+28.3468 28.3468 m 
+f 
+0 g 0 G
+Q 
+Q 
+n 
+Q 
+1 0 0 1 -148.712 -638.852 cm
+BT
+/F25 9.96264 Tf
+1 0 0 1 148.712 626.896 Tm [<001C0023>-28<002B>]TJ
+/TRP.6 gs
+1 0 0 1 163.935 626.896 Tm [<0073007300730073007300730073007300730073>]TJ
+/TRP1 gs
+0 g 0 G
+1 0 0 1 303.133 89.365 Tm [<0052>]TJ
+0 g 0 G
+ET
+endstream
+endobj
+17 0 obj
+<< /Type /Page /Contents 18 0 R /Resources 16 0 R /MediaBox [ 0 0 612 792 ] /Parent 20 0 R >>
+endobj
+16 0 obj
+<< /ExtGState 1 0 R /ColorSpace 2 0 R /Pattern 3 0 R /Shading 4 0 R /Properties 5 0 R  /Font << /F25 19 0 R >> /ProcSet [ /PDF /Text ] >>
+endobj
+21 0 obj
+[ 28 [ 500 ] 35 [ 556 ] 43 [ 444 ] 82 [ 500 ] 115 [ 750 ] ]
+endobj
+23 0 obj
+<< /Length 15 >>         
+[BINARY STREAM]
+endobj
+24 0 obj
+<< /Subtype /CIDFontType0C /Length 1138 >>       
+[BINARY STREAM]
+endobj
+22 0 obj
+<< /Type /FontDescriptor /FontName /LGSPPO+LMRoman10-Regular /Flags 4 /FontBBox [ -430 -290 1417 1127 ] /Ascent 1127 /CapHeight 683 /Descent -290 /ItalicAngle 0 /StemV 93 /XHeight 431 /FontFile3 24 0 R /CIDSet 23 0 R >>
+endobj
+25 0 obj
+<< /Length 748 >>        
+stream
+%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-LGSPPO-LMRoman10-Regular-0)
+%%Title: (TeX-LGSPPO-LMRoman10-Regular-0 TeX LGSPPO-LMRoman10-Regular 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (LGSPPO-LMRoman10-Regular)
+/Supplement 0
+>> def
+/CMapName /TeX-Identity-LGSPPO-LMRoman10-Regular def
+/CMapType 2 def
+1 begincodespacerange
+<0000> <FFFF>
+endcodespacerange
+0 beginbfrange
+endbfrange
+5 beginbfchar
+<001C> <0061>
+<0023> <0062>
+<002B> <0063>
+<0052> <0031>
+<0073> <0058>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+endstream
+endobj
+19 0 obj
+<< /Type /Font /Subtype /Type0 /Encoding /Identity-H /BaseFont /LGSPPO+LMRoman10-Regular /DescendantFonts [ 26 0 R ] /ToUnicode 25 0 R >>
+endobj
+26 0 obj
+<< /Type /Font /Subtype /CIDFontType0 /BaseFont /LGSPPO+LMRoman10-Regular /FontDescriptor 22 0 R /W 21 0 R /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> >>
+endobj
+20 0 obj
+<< /Type /Pages  /Count 1 /Kids [ 17 0 R ] >>
+endobj
+27 0 obj
+<< /Type /Catalog /Pages 20 0 R >>
+endobj
+28 0 obj
+<< /Producer (LuaTeX) /Creator (TeX) /Trapped /False >>
+endobj
+xref
+0 29
+0000000006 65535 f 
+0000000453 00000 n 
+0000000614 00000 n 
+0000000668 00000 n 
+0000000690 00000 n 
+0000000712 00000 n 
+0000000007 00000 f 
+0000000008 00000 f 
+0000000000 00000 f 
+0000000020 00000 n 
+0000000078 00000 n 
+0000000142 00000 n 
+0000000206 00000 n 
+0000000269 00000 n 
+0000000327 00000 n 
+0000000390 00000 n 
+0000001416 00000 n 
+0000001306 00000 n 
+0000000734 00000 n 
+0000003987 00000 n 
+0000004341 00000 n 
+0000001570 00000 n 
+0000002943 00000 n 
+0000001646 00000 n 
+0000001721 00000 n 
+0000003179 00000 n 
+0000004141 00000 n 
+0000004403 00000 n 
+0000004454 00000 n 
+trailer
+<< /Size 29 /Root 27 0 R /Info 28 0 R >>
+startxref
+4526
+%%EOF
diff --git a/testfiles/extgstate-patches.pvt b/testfiles/extgstate-patches.pvt
new file mode 100644
index 0000000..8cd224c
--- /dev/null
+++ b/testfiles/extgstate-patches.pvt
@@ -0,0 +1,19 @@
+\input{regression-test}
+\RequirePackage[enable-debug,check-declarations]{expl3}
+\RequirePackage[patches]{pdfresources}
+
+\documentclass{article}
+\ExplSyntaxOn
+\driver_pdf_compresslevel:n {0}
+\driver_pdf_compress_objects:n {0}
+\ExplSyntaxOff
+\usepackage{tikz,transparent}
+\usetikzlibrary{patterns,shadings}
+\usepackage[overprint]{colorspace}
+
+
+\begin{document}
+\tikz\fill[opacity=0.4,red](0,0)rectangle (1,1);
+
+abc\texttransparent{0.6}{XXXXXXXXXX}
+\end{document}
\ No newline at end of file
diff --git a/testfiles/extgstate-patches.tpf b/testfiles/extgstate-patches.tpf
new file mode 100644
index 0000000..18f7437
--- /dev/null
+++ b/testfiles/extgstate-patches.tpf
@@ -0,0 +1,194 @@
+%PDF-1.5
+%ÐÔÅØ
+9 0 obj
+<< /Type /ExtGState /op false /OP false >>
+endobj
+10 0 obj
+<< /Type /ExtGState /op true /OP true /OPM 0 >>
+endobj
+11 0 obj
+<< /Type /ExtGState /op true /OP true /OPM 1 >>
+endobj
+12 0 obj
+<< /SPCko 9 0 R /SPCmz 10 0 R /SPCop 11 0 R >>
+endobj
+13 0 obj
+<< /Type/ExtGState /op false /OP false >>
+endobj
+14 0 obj
+<< /Type/ExtGState /op true /OP true /OPM 0 >>
+endobj
+15 0 obj
+<< /Type/ExtGState /op true /OP true /OPM 1 >>
+endobj
+1 0 obj
+<< /SPCko 13 0 R /SPCmz 14 0 R /SPCop 15 0 R /TRP.6 <</ca .6/CA .6>> /TRP1 <</ca 1/CA 1>> /pgf at CA0.4  << /CA 0.4 >> /pgf at ca0.4  << /ca 0.4 >>  >>
+endobj
+2 0 obj
+<< /pgfprgb  [/Pattern /DeviceRGB]  >>
+endobj
+3 0 obj
+<<  >>
+endobj
+4 0 obj
+<<  >>
+endobj
+5 0 obj
+<<  >>
+endobj
+18 0 obj
+<<
+/Length 429       
+>>
+stream
+/TRP1 gs
+/SPCop gs 
+0 g 0 G
+0 g 0 G
+0 g 0 G
+1 0 0 1 148.712 638.852 cm
+q 
+0 G 
+0 g 
+0.3985 w 
+q 
+q 
+/pgf at CA0.4 gs 
+/pgf at ca0.4 gs 
+1 0 0 rg 1 0 0 RG
+0.0 0.0 m 
+0.0 0.0 m 
+0.0 28.3468 l 
+28.3468 28.3468 l 
+28.3468 0.0 l 
+h 
+28.3468 28.3468 m 
+f 
+0 g 0 G
+Q 
+Q 
+n 
+Q 
+1 0 0 1 -148.712 -638.852 cm
+BT
+/F8 9.9626 Tf 148.712 626.896 Td [(ab)-28(c)]TJ
+/TRP.6 gs
+ [(XXXXXXXXXX)]TJ
+/TRP1 gs
+0 g 0 G
+ 154.421 -537.531 Td [(1)]TJ
+0 g 0 G
+ET
+endstream
+endobj
+17 0 obj
+<<
+/Type /Page
+/Contents 18 0 R
+/Resources 16 0 R
+/MediaBox [0 0 612 792]
+/Parent 20 0 R
+>>
+endobj
+16 0 obj
+<<
+/ExtGState 1 0 R /ColorSpace 2 0 R /Pattern 3 0 R /Shading 4 0 R /Properties 5 0 R 
+/Font << /F8 19 0 R >>
+/ProcSet [ /PDF /Text ]
+>>
+endobj
+21 0 obj
+[500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8 472.2 472.2 777.8 750 708.3 722.2 763.9 680.6 652.8 784.7 750 361.1 513.9 777.8 625 916.7 750 777.8 680.6 777.8 736.1 555.6 722.2 750 750 1027.8 750 750 611.1 277.8 500 277.8 500 277.8 277.8 500 555.6 444.4]
+endobj
+22 0 obj
+<<
+/Length1 1421
+/Length2 8159
+/Length3 0
+/Length 9580      
+>>
+[BINARY STREAM]
+endobj
+23 0 obj
+<<
+/Type /FontDescriptor
+/FontName /BYEZUZ+CMR10
+/Flags 4
+/FontBBox [-40 -250 1009 750]
+/Ascent 694
+/CapHeight 683
+/Descent -194
+/ItalicAngle 0
+/StemV 69
+/XHeight 431
+/CharSet (/X/a/b/c/one)
+/FontFile 22 0 R
+>>
+endobj
+19 0 obj
+<<
+/Type /Font
+/Subtype /Type1
+/BaseFont /BYEZUZ+CMR10
+/FontDescriptor 23 0 R
+/FirstChar 49
+/LastChar 99
+/Widths 21 0 R
+>>
+endobj
+20 0 obj
+<<
+/Type /Pages
+/Count 1
+/Kids [17 0 R]
+>>
+endobj
+24 0 obj
+<<
+/Type /Catalog
+/Pages 20 0 R
+>>
+endobj
+25 0 obj
+<<
+/Producer (pdfTeX)
+/Creator (TeX)
+/Trapped /False
+>>
+endobj
+xref
+0 26
+0000000006 65535 f 
+0000000448 00000 n 
+0000000609 00000 n 
+0000000663 00000 n 
+0000000685 00000 n 
+0000000707 00000 n 
+0000000007 00000 f 
+0000000008 00000 f 
+0000000000 00000 f 
+0000000015 00000 n 
+0000000073 00000 n 
+0000000137 00000 n 
+0000000201 00000 n 
+0000000264 00000 n 
+0000000322 00000 n 
+0000000385 00000 n 
+0000001325 00000 n 
+0000001217 00000 n 
+0000000729 00000 n 
+0000011668 00000 n 
+0000011807 00000 n 
+0000001478 00000 n 
+0000001763 00000 n 
+0000011441 00000 n 
+0000011866 00000 n 
+0000011917 00000 n 
+trailer
+<< /Size 26
+/Root 24 0 R
+/Info 25 0 R
+ >>
+startxref
+11989
+%%EOF





More information about the latex3-commits mailing list