[latex3-commits] [git/LaTeX3-latex3-pdfresources] backendtest: pdfpagesattr sorted (77f3377)

Ulrike Fischer fischer at troubleshooting-tex.de
Fri Jun 21 23:46:28 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : backendtest
Link       : https://github.com/latex3/pdfresources/commit/77f33777be8f6a2c3d3c2343a763b7887f75ef2f

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

commit 77f33777be8f6a2c3d3c2343a763b7887f75ef2f
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Fri Jun 21 23:46:28 2019 +0200

    pdfpagesattr sorted


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

77f33777be8f6a2c3d3c2343a763b7887f75ef2f
 build.lua                                          |  2 +-
 pdfresources.dtx                                   | 34 ++++++++------
 testfiles/pagesattr.luatex.tpf                     | 53 ++++++++--------------
 testfiles/pagesattr.pvt                            |  3 --
 testfiles/pagesattr.tpf                            | 44 ++++++------------
 .../{infodict.xetex.tpf => pagesattr.xetex.tpf}    |  9 ++--
 6 files changed, 58 insertions(+), 87 deletions(-)

diff --git a/build.lua b/build.lua
index 1fde1c0..ea9f598 100644
--- a/build.lua
+++ b/build.lua
@@ -10,5 +10,5 @@ installfiles = {"*.sty","*.cls","*.def","*.lua"}
 sourcefiles =  {"*.dtx","*.ins","hluatex-experimental.def","tmpl3shipout.sty"}
 
 checkruns = 3
-checkengines = {"luatex","pdftex"}
+checkengines = {"luatex","pdftex","xetex"}
 
diff --git a/pdfresources.dtx b/pdfresources.dtx
index db1b19d..b6a2698 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -215,35 +215,39 @@
 % \end{NOTE}
 %    \begin{macrocode}
 %<*package>
-\bool_if:nT {\sys_if_engine_pdftex_p: && \sys_if_output_pdf_p: || \sys_if_engine_luatex_p:}
+%pdftex
+\bool_if:nT {\sys_if_engine_pdftex_p: && \sys_if_output_pdf_p:}
 {
- \cs_new_protected:Npx \@@_backend_pagesattr:n #1
+ \cs_new_protected:Npn \@@_backend_Pages_primitive:n #1
   {
-    \exp_not:N \tex_global:D
-    \cs_if_exist:NTF \tex_pdfpagesattr:D
-      { \tex_pdfpagesattr:D }
-      { \tex_pdfvariable:D pagesattr }
-      {#1}
+    \tex_global:D \tex_pdfpagesattr:D {#1}
   }
 }
+%luatex
+\sys_if_engine_luatex:T
+ {
+  \cs_new_protected:Npn \@@_backend_Pages_primitive:n #1
+   {
+     \tex_directlua:D {pdf.setpagesattributes("#1")}
+   }
+ }
 %dvips
 \bool_if:nT {\sys_if_engine_pdftex_p: && !\sys_if_output_pdf_p: }
 {
- \cs_new_protected:Npx \@@_backend_pagesattr:n #1
+ \cs_new_protected:Npx \@@_backend_Pages_primitive:n #1
   {
-    \tex_special:D{ps:~[#1~/PAGES~pdfmark}
+    \tex_special:D{ps:~[#1~/PAGES~pdfmark} %]
   }
 }
 
-%need to be checked/
+%xetex
 \sys_if_engine_xetex:T
  {
-  \cs_new_protected:Npn \@@_backend_pagesattr:n #1
+  \cs_new_protected:Npn \@@_backend_Pages_primitive:n #1
    {
     \@@_backend:n{put~@pages~<<#1>>}
    }
  }
-
 %</package>
 %    \end{macrocode}
 % \subsubsection{pdfpagesattr/management}
@@ -258,9 +262,9 @@
 %   \begin{syntax}
 %     \cs{pdf_pagesattr_gput:nn} \Arg{name} \Arg{value}
 %   \end{syntax}
-%   Adds |/|\meta{name} \meta{value} the |/Pages| dictionary.
+%   Adds |/|\meta{name} \meta{value} to the |/Pages| dictionary.
 %   It is always stored globally. The content is written to the pdf
-%   at the end of the compilation,so values can be added, changed or removed until then.
+%   at the end of the compilation, so values can be added, changed or removed until then.
 %   \meta{name} should be a valid pdf name without the leading slash,
 %   \meta{value} should be a valid pdf value. Any escaping or (re)encoding must be
 %   done explictly. If a \meta{name} is used twice, only the last \meta{value}
@@ -318,7 +322,7 @@
 % push to the register command / issue the special
 \cs_new_protected:Npn \@@_pagesattr_gpush:
   {
-    \exp_args:Nx \@@_backend_pagesattr:n
+    \exp_args:Nx \@@_backend_Pages_primitive:n
     {
      \@@_tree_map_dict_item:n {Pages}
     }
diff --git a/testfiles/pagesattr.luatex.tpf b/testfiles/pagesattr.luatex.tpf
index a8b7c52..ce8fcd1 100644
--- a/testfiles/pagesattr.luatex.tpf
+++ b/testfiles/pagesattr.luatex.tpf
@@ -14,22 +14,7 @@ endobj
 << /Type /Page /Contents 8 0 R /Resources 6 0 R /MediaBox [ 0 0 595.276 841.89 ] /Parent 10 0 R >>
 endobj
 6 0 obj
-<< /ExtGState 1 0 R /ColorSpace 2 0 R /Pattern 3 0 R /Shading 4 0 R /Properties 5 0 R  /Font << /F25 9 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
-<<  >>
+<< /Font << /F25 9 0 R >> /ProcSet [ /PDF /Text ] >>
 endobj
 11 0 obj
 [ 50 [ 444 ] 75 [ 833 ] 81 [ 500 500 ] 98 [ 394 ] 105 [ 389 ] 116 [ 528 ] ]
@@ -94,7 +79,7 @@ endobj
 << /Type /Font /Subtype /CIDFontType0 /BaseFont /KRCLMV+LMRoman10-Regular /FontDescriptor 12 0 R /W 11 0 R /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> >>
 endobj
 10 0 obj
-<< /Type /Pages /YYY (y22) /ZZZ (zzz) /SSS (somesetting)    /Count 1 /Kids [ 7 0 R ] >>
+<< /Type /Pages /YYY (y22) /ZZZ (zzz) /SSS (somesetting)   /Count 1 /Kids [ 7 0 R ] >>
 endobj
 17 0 obj
 << /Type /Catalog /Pages 10 0 R >>
@@ -104,27 +89,27 @@ endobj
 endobj
 xref
 0 19
-0000000000 65535 f 
-0000000477 00000 n 
-0000000499 00000 n 
-0000000521 00000 n 
-0000000543 00000 n 
-0000000565 00000 n 
+0000000001 65535 f 
+0000000002 00000 f 
+0000000003 00000 f 
+0000000004 00000 f 
+0000000005 00000 f 
+0000000000 00000 f 
 0000000325 00000 n 
 0000000211 00000 n 
 0000000020 00000 n 
-0000003323 00000 n 
-0000003676 00000 n 
-0000000587 00000 n 
-0000002251 00000 n 
-0000000679 00000 n 
-0000000754 00000 n 
-0000002487 00000 n 
-0000003476 00000 n 
-0000003780 00000 n 
-0000003831 00000 n 
+0000003129 00000 n 
+0000003482 00000 n 
+0000000393 00000 n 
+0000002057 00000 n 
+0000000485 00000 n 
+0000000560 00000 n 
+0000002293 00000 n 
+0000003282 00000 n 
+0000003585 00000 n 
+0000003636 00000 n 
 trailer
 << /Size 19 /Root 17 0 R /Info 18 0 R >>
 startxref
-3903
+3708
 %%EOF
diff --git a/testfiles/pagesattr.pvt b/testfiles/pagesattr.pvt
index 934dc11..b962c20 100644
--- a/testfiles/pagesattr.pvt
+++ b/testfiles/pagesattr.pvt
@@ -10,9 +10,6 @@ some text
 %test local:
 {\pdf_pagesattr_gput:nn {ZZZ}{(zzz)}}
 
-%test "wrong" primitive call:
- \__pdf_backend_pagesattr:n{/WWW~(someusersetting)}
-
 %test doublette
  \pdf_pagesattr_gput:nn {YYY}{(y22)}
 
diff --git a/testfiles/pagesattr.tpf b/testfiles/pagesattr.tpf
index 688c8ae..8bbcf96 100644
--- a/testfiles/pagesattr.tpf
+++ b/testfiles/pagesattr.tpf
@@ -21,26 +21,10 @@ endobj
 endobj
 6 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 >>
 /ProcSet [ /PDF /Text ]
 >>
 endobj
-1 0 obj
-<<  >>
-endobj
-2 0 obj
-<<  >>
-endobj
-3 0 obj
-<<  >>
-endobj
-4 0 obj
-<<  >>
-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
@@ -103,27 +87,27 @@ endobj
 endobj
 xref
 0 16
-0000000000 65535 f 
-0000000427 00000 n 
-0000000449 00000 n 
-0000000471 00000 n 
-0000000493 00000 n 
-0000000515 00000 n 
+0000000001 65535 f 
+0000000002 00000 f 
+0000000003 00000 f 
+0000000004 00000 f 
+0000000005 00000 f 
+0000000000 00000 f 
 0000000276 00000 n 
 0000000164 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 
+0000011820 00000 n 
+0000011959 00000 n 
+0000000343 00000 n 
+0000000750 00000 n 
+0000011589 00000 n 
+0000012059 00000 n 
+0000012110 00000 n 
 trailer
 << /Size 16
 /Root 14 0 R
 /Info 15 0 R
  >>
 startxref
-12376
+12182
 %%EOF
diff --git a/testfiles/infodict.xetex.tpf b/testfiles/pagesattr.xetex.tpf
similarity index 87%
copy from testfiles/infodict.xetex.tpf
copy to testfiles/pagesattr.xetex.tpf
index 24dba61..9dd412f 100644
--- a/testfiles/infodict.xetex.tpf
+++ b/testfiles/pagesattr.xetex.tpf
@@ -13,10 +13,11 @@ endobj
 <</Resources 7 0 R/Type/Page/Parent 8 0 R/Contents[6 0 R]>>
 endobj
 8 0 obj
-<</Type/Pages/Count 1/Kids[3 0 R]/MediaBox[0 0 595.28 841.89]>>
+<</YYY(y22)/ZZZ(zzz)/SSS(somesetting)/Type/Pages/Count 1/Kids[3 0 R]/MediaBox[0 0
+595.28 841.89]>>
 endobj
 2 0 obj
-<</Creator(TeX)/Producer(xdvipdfmx)/Title(A Title)/Author(Some Author)/CreationDate(D:20160520090000-00'00')>>
+<</Creator(TeX)/Producer(xdvipdfmx)/CreationDate(D:20160520090000-00'00')>>
 endobj
 1 0 obj
 <</Pages 8 0 R/Type/Catalog>>
@@ -80,7 +81,7 @@ xref
 0 14
 0000000000 65535 f 
 0000000559 00000 n 
-0000000433 00000 n 
+0000000468 00000 n 
 0000000279 00000 n 
 0000002684 00000 n 
 0000003134 00000 n 
@@ -93,7 +94,7 @@ xref
 0000002553 00000 n 
 0000002620 00000 n 
 trailer
-<</Root 1 0 R/Info 2 0 R/ID[<736b672455ecf863cca2980d059cc169><736b672455ecf863cca2980d059cc169>]/Size
+<</Root 1 0 R/Info 2 0 R/ID[<6c384a59e70ac0b4d4e66a031726ce1c><6c384a59e70ac0b4d4e66a031726ce1c>]/Size
 14>>
 startxref
 3282





More information about the latex3-commits mailing list