[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: ocproperties in the catalog (797d54b)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed May 22 12:49:43 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : testlinkstuff
Link       : https://github.com/latex3/pdfresources/commit/797d54b375653cdc84633685f8ceda6ce2ca245f

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

commit 797d54b375653cdc84633685f8ceda6ce2ca245f
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed May 22 12:49:43 2019 +0200

    ocproperties in the catalog


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

797d54b375653cdc84633685f8ceda6ce2ca245f
 pdfresources.dtx                              |    8 +-
 testfiles/ocproperties.luatex.tpf             |  131 +++++++++++++++++++++++++
 testfiles/ocproperties.pvt                    |   22 +++++
 testfiles/{pagesattr.tpf => ocproperties.tpf} |  102 ++++++++++---------
 4 files changed, 212 insertions(+), 51 deletions(-)

diff --git a/pdfresources.dtx b/pdfresources.dtx
index 9a8c84e..c6aac9b 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -816,10 +816,10 @@
 \cs_new_protected:Npn\@@_catalog_OCProperties_gpush:
  {
   \int_compare:nNnT
-   {
+  {
     (\seq_count:N \g_@@_catalog_OCProperties_OCGS_seq)*
     (\seq_count:N \g_@@_catalog_OCProperties_Configs_seq)
-   } > {0}
+  } > {0}
   {
    \driver_pdf_object_new:nn   {g_@@_catalog_OCProperties_obj} {dict}
    \seq_gpop_left:NN \g_@@_catalog_OCProperties_Configs_seq \g_tmpa_tl
@@ -833,6 +833,7 @@
      /Configs~[\seq_use:Nn \g_@@_catalog_OCProperties_Configs_seq {~}]
      }
     }
+   \driver_pdf_catalog_gput:nn {OCProperties}{\driver_pdf_object_ref:n {g_@@_catalog_OCProperties_obj}}
   } %----------not finished
  }
 %</package>
@@ -864,6 +865,7 @@
 \AtBeginDocument %need to be decided ...
  {
   \@@_catalog_array_gpush:n {OutputIntents}
+  \@@_catalog_OCProperties_gpush:
   \prop_map_function:NN  \g_@@_catalog_prop \driver_pdf_catalog_gput:nn
  }
 %</package>
@@ -909,6 +911,8 @@
 % A token register that is added to the page object when the page is shipped out.
 % The following command copy more or less the driver commands but add a few tests
 % and warning if other packages or users have used the primitive commands.
+% ? should we use a prop and delay the filling of the register to shipout  like for
+% the page resources ? Do we need page related variants?
 %    \begin{macrocode}
 %<*package>
 \tl_new:N \g_@@_pageattr_tl
diff --git a/testfiles/ocproperties.luatex.tpf b/testfiles/ocproperties.luatex.tpf
new file mode 100644
index 0000000..67d1f0b
--- /dev/null
+++ b/testfiles/ocproperties.luatex.tpf
@@ -0,0 +1,131 @@
+%PDF-1.5
+%ÌÕÁÔÅØÐÄÆ
+6 0 obj
+<< /OCGS [1 0 R 2 0 R]/D 102 0 R/Configs [99 0 R 100 0 R 101 0 R] >>
+endobj
+9 0 obj
+<< /Length 111 >>        
+stream
+BT
+/F15 9.96264 Tf
+1 0 0 1 148.712 707.125 Tm [<001C0023>-28<002B>]TJ
+1 0 0 1 303.133 139.255 Tm [<0052>]TJ
+ET
+endstream
+endobj
+8 0 obj
+<< /Type /Page /Contents 9 0 R /Resources 7 0 R /MediaBox [ 0 0 595.276 841.89 ] /Parent 11 0 R >>
+endobj
+7 0 obj
+<< /ExtGState 1 0 R /ColorSpace 2 0 R /Pattern 3 0 R /Shading 4 0 R /Properties 5 0 R  /Font << /F15 10 0 R >> /ProcSet [ /PDF /Text ] >>
+endobj
+1 0 obj
+<<  >>
+endobj
+2 0 obj
+<<  >>
+endobj
+3 0 obj
+<<  >>
+endobj
+4 0 obj
+<<  >>
+endobj
+5 0 obj
+<<  >>
+endobj
+12 0 obj
+[ 28 [ 500 ] 35 [ 556 ] 43 [ 444 ] 82 [ 500 ] ]
+endobj
+14 0 obj
+<< /Length 11 >>         
+[BINARY STREAM]
+endobj
+15 0 obj
+<< /Subtype /CIDFontType0C /Length 955 >>        
+[BINARY STREAM]
+endobj
+13 0 obj
+<< /Type /FontDescriptor /FontName /NSMWQI+LMRoman10-Regular /Flags 4 /FontBBox [ -430 -290 1417 1127 ] /Ascent 1127 /CapHeight 683 /Descent -290 /ItalicAngle 0 /StemV 93 /XHeight 431 /FontFile3 15 0 R /CIDSet 14 0 R >>
+endobj
+16 0 obj
+<< /Length 734 >>        
+stream
+%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-NSMWQI-LMRoman10-Regular-0)
+%%Title: (TeX-NSMWQI-LMRoman10-Regular-0 TeX NSMWQI-LMRoman10-Regular 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (NSMWQI-LMRoman10-Regular)
+/Supplement 0
+>> def
+/CMapName /TeX-Identity-NSMWQI-LMRoman10-Regular def
+/CMapType 2 def
+1 begincodespacerange
+<0000> <FFFF>
+endcodespacerange
+0 beginbfrange
+endbfrange
+4 beginbfchar
+<001C> <0061>
+<0023> <0062>
+<002B> <0063>
+<0052> <0031>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+endstream
+endobj
+10 0 obj
+<< /Type /Font /Subtype /Type0 /Encoding /Identity-H /BaseFont /NSMWQI+LMRoman10-Regular /DescendantFonts [ 17 0 R ] /ToUnicode 16 0 R >>
+endobj
+17 0 obj
+<< /Type /Font /Subtype /CIDFontType0 /BaseFont /NSMWQI+LMRoman10-Regular /FontDescriptor 13 0 R /W 12 0 R /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> >>
+endobj
+11 0 obj
+<< /Type /Pages  /Count 1 /Kids [ 8 0 R ] >>
+endobj
+18 0 obj
+<< /Type /Catalog /Pages 11 0 R /OCProperties 6 0 R >>
+endobj
+19 0 obj
+<< /Producer (LuaTeX) /Creator (TeX) /Trapped /False >>
+endobj
+xref
+0 20
+0000000000 65535 f 
+0000000541 00000 n 
+0000000563 00000 n 
+0000000585 00000 n 
+0000000607 00000 n 
+0000000629 00000 n 
+0000000020 00000 n 
+0000000388 00000 n 
+0000000274 00000 n 
+0000000104 00000 n 
+0000002855 00000 n 
+0000003209 00000 n 
+0000000651 00000 n 
+0000001825 00000 n 
+0000000715 00000 n 
+0000000786 00000 n 
+0000002061 00000 n 
+0000003009 00000 n 
+0000003270 00000 n 
+0000003341 00000 n 
+trailer
+<< /Size 20 /Root 18 0 R /Info 19 0 R >>
+startxref
+3413
+%%EOF
diff --git a/testfiles/ocproperties.pvt b/testfiles/ocproperties.pvt
new file mode 100644
index 0000000..09a2230
--- /dev/null
+++ b/testfiles/ocproperties.pvt
@@ -0,0 +1,22 @@
+\input{regression-test}
+\documentclass{article}
+\usepackage{pdfresources}
+\ExplSyntaxOn
+\driver_pdf_compresslevel:n {0}
+\driver_pdf_compress_objects:n {0}
+
+%some senseless additions to test the commands
+\pdf_catalog_OCProperties_OCGS_gput:n{1~0~R}
+\pdf_catalog_OCProperties_OCGS_gput:n{2~0~R}
+\pdf_catalog_OCProperties_Configs_gput:n {99~0~R}
+\pdf_catalog_OCProperties_Configs_gput:n {100~0~R}
+\pdf_catalog_OCProperties_Configs_gput:n {101~0~R}
+%sets the /D-entries
+\pdf_catalog_OCProperties_Configs_default_gput:n{102~0~R}
+\ExplSyntaxOff
+
+\begin{document}
+abc
+
+
+\end{document}
diff --git a/testfiles/pagesattr.tpf b/testfiles/ocproperties.tpf
similarity index 55%
copy from testfiles/pagesattr.tpf
copy to testfiles/ocproperties.tpf
index 688c8ae..85b13bd 100644
--- a/testfiles/pagesattr.tpf
+++ b/testfiles/ocproperties.tpf
@@ -1,28 +1,31 @@
 %PDF-1.5
 %ÐÔÅØ
-8 0 obj
+6 0 obj
+<< /OCGS [1 0 R 2 0 R]/D 102 0 R/Configs [99 0 R 100 0 R 101 0 R] >>
+endobj
+9 0 obj
 <<
-/Length 91        
+/Length 81        
 >>
 stream
 BT
-/F8 9.9626 Tf 148.712 707.125 Td [(some)-333(te)-1(xt)]TJ 154.421 -567.87 Td [(1)]TJ
+/F8 9.9626 Tf 148.712 707.125 Td [(ab)-28(c)]TJ 154.421 -567.87 Td [(1)]TJ
 ET
 endstream
 endobj
-7 0 obj
+8 0 obj
 <<
 /Type /Page
-/Contents 8 0 R
-/Resources 6 0 R
+/Contents 9 0 R
+/Resources 7 0 R
 /MediaBox [0 0 595.276 841.89]
-/Parent 10 0 R
+/Parent 11 0 R
 >>
 endobj
-6 0 obj
+7 0 obj
 <<
 /ExtGState 1 0 R /ColorSpace 2 0 R /Pattern 3 0 R /Shading 4 0 R /Properties 5 0 R 
-/Font << /F8 9 0 R >>
+/Font << /F8 10 0 R >>
 /ProcSet [ /PDF /Text ]
 >>
 endobj
@@ -41,22 +44,22 @@ endobj
 5 0 obj
 <<  >>
 endobj
-11 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 555.6 444.4 305.6 500 555.6 277.8 305.6 527.8 277.8 833.3 555.6 500 555.6 527.8 391.7 394.4 388.9 555.6 527.8 722.2 527.8]
-endobj
 12 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
+13 0 obj
 <<
-/Length1 1455
-/Length2 9286
+/Length1 1407
+/Length2 7801
 /Length3 0
-/Length 10741     
+/Length 9208      
 >>
 [BINARY STREAM]
 endobj
-13 0 obj
+14 0 obj
 <<
 /Type /FontDescriptor
-/FontName /CTWJDN+CMR10
+/FontName /EVYFYC+CMR10
 /Flags 4
 /FontBBox [-40 -250 1009 750]
 /Ascent 694
@@ -65,36 +68,36 @@ endobj
 /ItalicAngle 0
 /StemV 69
 /XHeight 431
-/CharSet (/e/m/o/one/s/t/x)
-/FontFile 12 0 R
+/CharSet (/a/b/c/one)
+/FontFile 13 0 R
 >>
 endobj
-9 0 obj
+10 0 obj
 <<
 /Type /Font
 /Subtype /Type1
-/BaseFont /CTWJDN+CMR10
-/FontDescriptor 13 0 R
+/BaseFont /EVYFYC+CMR10
+/FontDescriptor 14 0 R
 /FirstChar 49
-/LastChar 120
-/Widths 11 0 R
+/LastChar 99
+/Widths 12 0 R
 >>
 endobj
-10 0 obj
+11 0 obj
 <<
 /Type /Pages
 /Count 1
-/Kids [7 0 R]
-/YYY (y22) /ZZZ (zzz) /SSS (somesetting) 
+/Kids [8 0 R]
 >>
 endobj
-14 0 obj
+15 0 obj
 <<
 /Type /Catalog
-/Pages 10 0 R
+/Pages 11 0 R
+/OCProperties 6 0 R
 >>
 endobj
-15 0 obj
+16 0 obj
 <<
 /Producer (pdfTeX)
 /Creator (TeX)
@@ -102,28 +105,29 @@ endobj
 >>
 endobj
 xref
-0 16
+0 17
 0000000000 65535 f 
-0000000427 00000 n 
-0000000449 00000 n 
-0000000471 00000 n 
-0000000493 00000 n 
-0000000515 00000 n 
-0000000276 00000 n 
-0000000164 00000 n 
+0000000502 00000 n 
+0000000524 00000 n 
+0000000546 00000 n 
+0000000568 00000 n 
+0000000590 00000 n 
 0000000015 00000 n 
-0000012014 00000 n 
-0000012153 00000 n 
-0000000537 00000 n 
-0000000944 00000 n 
-0000011783 00000 n 
-0000012253 00000 n 
-0000012304 00000 n 
+0000000350 00000 n 
+0000000238 00000 n 
+0000000099 00000 n 
+0000010428 00000 n 
+0000010567 00000 n 
+0000000612 00000 n 
+0000000897 00000 n 
+0000010203 00000 n 
+0000010625 00000 n 
+0000010696 00000 n 
 trailer
-<< /Size 16
-/Root 14 0 R
-/Info 15 0 R
+<< /Size 17
+/Root 15 0 R
+/Info 16 0 R
  >>
 startxref
-12376
+10768
 %%EOF





More information about the latex3-commits mailing list