Skip to content

Commit

Permalink
remade test (forgot regression test)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrike Fischer committed Jun 22, 2019
1 parent ea8f0eb commit aa2021c
Show file tree
Hide file tree
Showing 5 changed files with 481 additions and 91 deletions.
26 changes: 21 additions & 5 deletions pdfresources.dtx
Expand Up @@ -269,7 +269,7 @@
{
\cs_new_protected:Npn \@@_backend_Pages_primitive:n #1
{
\tex_directlua:D {pdf.setpagesattributes("#1")}
\tex_directlua:D {pdf.setpagesattributes(\@@_backend_luastring:n {#1})}
}
}
%dvips
Expand Down Expand Up @@ -454,24 +454,35 @@

\sys_if_engine_luatex:T
{% do we need to use some escaping for the values?????
\cs_new:Npn \@@_backend_luastring:n #1
{
"\tex_luaescapestring:D{\tex_unexpanded:D {#1}}"
}
%not used, only there for consistency
\cs_new_protected:Npn \@@_backend_Page_primitive:n #1
{
\tex_latelua:D {pdf.setpageattributes("#1")}
\tex_latelua:D {pdf.setpageattributes(\@@_backend_luastring:n {#1})}
}
% the command to store default values.
% Uses a prop with pdflatex + dvi,
% sets a lua table with lualatex
\cs_new_protected:Npn \@@_backend_Page_gput:nn #1 #2
{
\tex_directlua:D { l3kernel.__pdf._backend_Page_gput ("#1","#2") }
\tex_directlua:D
{
l3kernel.__pdf._backend_Page_gput
(
\@@_backend_luastring:n {#1},
\@@_backend_luastring:n {#2}
)
}
}
% the command to remove a default value.
% Uses a prop with pdflatex + dvi,
% changes a lua table with lualatex
\cs_new_protected:Npn \@@_backend_Page_gremove:n #1
{
\tex_directlua:D { l3kernel.__pdf._backend_Page_gremove ("#1") }
\tex_directlua:D { l3kernel.__pdf._backend_Page_gremove (\@@_backend_luastring:n {#1}) }
}
% the command used in the document.
% direct call of the primitive special with dvips/dvipdfmx
Expand All @@ -482,7 +493,12 @@
{
\tex_latelua:D
{
l3kernel.__pdf._backend_PageN_gput (tex.count["g__pdf_abspage_int"],"#1","#2")
l3kernel.__pdf._backend_PageN_gput
(
tex.count["g__pdf_abspage_int"],
\@@_backend_luastring:n {#1},
\@@_backend_luastring:n {#2}
)
l3kernel.__pdf._backend_PageN_gpush (tex.count["g__pdf_abspage_int"])
}
}
Expand Down
179 changes: 158 additions & 21 deletions testfiles/pageattr.luatex.tpf
@@ -1,44 +1,181 @@
%PDF-1.5
%���������
8 0 obj
<< /Filter /FlateDecode /Length 105 >>
[BINARY STREAM]
<< /Length 132 >>
stream
BT
/F25 9.96264 Tf
1 0 0 1 148.712 707.125 Tm [<00620051004B0032>-333<0069003200740069>]TJ
1 0 0 1 303.133 139.255 Tm [<0052>]TJ
ET
endstream
endobj
7 0 obj
<< /Type /Page /Contents 8 0 R /Resources 6 0 R /MediaBox [ 0 0 595.276 841.89 ] /CropBox [0 0 300 350]/Rotate 90/SSS (somesetting) /Parent 10 0 R >>
endobj
6 0 obj
<< /Font << /F25 9 0 R >> /ProcSet [ /PDF /Text ] >>
endobj
13 0 obj
<< /Length 158 >>
stream
BT
/F25 9.96264 Tf
1 0 0 1 148.712 707.125 Tm [<00620051004B00320069003200740069004B0051006000320069003200740069>]TJ
1 0 0 1 303.133 139.255 Tm [<006B>]TJ
ET
endstream
endobj
12 0 obj
<< /Type /Page /Contents 13 0 R /Resources 11 0 R /MediaBox [ 0 0 595.276 841.89 ] /SSS (somesetting) /Parent 10 0 R >>
endobj
11 0 obj
<< /Font << /F25 9 0 R >> /ProcSet [ /PDF /Text ] >>
endobj
16 0 obj
<< /Length 115 >>
stream
q
1 0 0 1 133.768 230.517 cm
0 0 28.346 425.197 re f
Q
BT
/F25 9.96264 Tf
1 0 0 1 303.133 139.255 Tm [<006A>]TJ
ET
endstream
endobj
15 0 obj
<< /Type /Page /Contents 16 0 R /Resources 14 0 R /MediaBox [ 0 0 595.276 841.89 ] /SSS (somesetting)/Rotate -90 /Parent 10 0 R >>
endobj
14 0 obj
<< /Filter /FlateDecode /Length 110 >>
[BINARY STREAM]
<< /Font << /F25 9 0 R >> /ProcSet [ /PDF /Text ] >>
endobj
19 0 obj
<< /Length 110 >>
stream
BT
/F25 9.96264 Tf
1 0 0 1 148.712 707.125 Tm [<001C002300230023>]TJ
1 0 0 1 303.133 139.255 Tm [<0039>]TJ
ET
endstream
endobj
18 0 obj
<< /Type /Page /Contents 19 0 R /Resources 17 0 R /MediaBox [ 0 0 595.276 841.89 ] /SSS (somesetting) /Parent 10 0 R >>
endobj
17 0 obj
<< /Filter /FlateDecode /Length 106 >>
[BINARY STREAM]
<< /Font << /F25 9 0 R >> /ProcSet [ /PDF /Text ] >>
endobj
20 0 obj
<< /Filter /FlateDecode /Length 89 >>
[ 28 [ 500 ] 35 [ 556 ] 50 [ 444 ] 57 [ 500 ] 75 [ 833 ] 81 [ 500 500 ] 96 [ 392 ] 98 [ 394 ] 105 [ 389 500 500 ] 116 [ 528 ] ]
endobj
22 0 obj
<< /Length 15 >>
[BINARY STREAM]
endobj
23 0 obj
<< /Filter /FlateDecode /Length 23 >>
<< /Subtype /CIDFontType0C /Length 2169 >>
[BINARY STREAM]
endobj
21 0 obj
<< /Type /FontDescriptor /FontName /KWTIAX+LMRoman10-Regular /Flags 4 /FontBBox [ -430 -290 1417 1127 ] /Ascent 1127 /CapHeight 683 /Descent -290 /ItalicAngle 0 /StemV 93 /XHeight 431 /FontFile3 23 0 R /CIDSet 22 0 R >>
endobj
24 0 obj
<< /Subtype /CIDFontType0C /Filter /FlateDecode /Length 1972 >>
[BINARY STREAM]
<< /Length 861 >>
stream
%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-KWTIAX-LMRoman10-Regular-0)
%%Title: (TeX-KWTIAX-LMRoman10-Regular-0 TeX KWTIAX-LMRoman10-Regular 0)
%%Version: 1.000
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (TeX)
/Ordering (KWTIAX-LMRoman10-Regular)
/Supplement 0
>> def
/CMapName /TeX-Identity-KWTIAX-LMRoman10-Regular def
/CMapType 2 def
1 begincodespacerange
<0000> <FFFF>
endcodespacerange
0 beginbfrange
endbfrange
13 beginbfchar
<001C> <0061>
<0023> <0062>
<0032> <0065>
<0039> <0034>
<004B> <006D>
<0051> <006F>
<0052> <0031>
<0060> <0072>
<0062> <0073>
<0069> <0074>
<006A> <0033>
<006B> <0032>
<0074> <0078>
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end
%%EndResource
%%EOF
endstream
endobj
9 0 obj
<< /Type /Font /Subtype /Type0 /Encoding /Identity-H /BaseFont /KWTIAX+LMRoman10-Regular /DescendantFonts [ 25 0 R ] /ToUnicode 24 0 R >>
endobj
25 0 obj
<< /Filter /FlateDecode /Length 425 >>
[BINARY STREAM]
<< /Type /Font /Subtype /CIDFontType0 /BaseFont /KWTIAX+LMRoman10-Regular /FontDescriptor 21 0 R /W 20 0 R /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> >>
endobj
28 0 obj
<< /Producer (LuaTeX-1.10.0) /Creator (TeX) /CreationDate (D:20160520110000+02'00') /ModDate (D:20160520110000+02'00') /Trapped /False /PTEX.FullBanner (This is LuaTeX, Version 1.10.0 (TeX Live 2019/W32TeX)) >>
10 0 obj
<< /Type /Pages /Count 4 /Kids [ 7 0 R 12 0 R 15 0 R 18 0 R ] >>
endobj
11 0 obj
<< /Type /ObjStm /N 14 /First 97 /Filter /FlateDecode /Length 620 >>
[BINARY STREAM]
26 0 obj
<< /Type /Catalog /Pages 10 0 R >>
endobj
29 0 obj
<< /Type /XRef /Index [ 0 30 ] /Size 30 /W [ 1 2 1 ] /Root 27 0 R /Info 28 0 R /ID [ <17069F1968950BFE6820C0C530666C8E> <17069F1968950BFE6820C0C530666C8E> ] /Filter /FlateDecode /Length 88 >>
[BINARY STREAM]
27 0 obj
<< /Producer (LuaTeX) /Creator (TeX) /Trapped /False >>
endobj
xref
0 28
0000000001 65535 f
0000000002 00000 f
0000000003 00000 f
0000000004 00000 f
0000000005 00000 f
0000000000 00000 f
0000000376 00000 n
0000000211 00000 n
0000000020 00000 n
0000005262 00000 n
0000005615 00000 n
0000000798 00000 n
0000000662 00000 n
0000000444 00000 n
0000001189 00000 n
0000001042 00000 n
0000000867 00000 n
0000001564 00000 n
0000001428 00000 n
0000001258 00000 n
0000001633 00000 n
0000004105 00000 n
0000001777 00000 n
0000001852 00000 n
0000004341 00000 n
0000005415 00000 n
0000005697 00000 n
0000005748 00000 n
trailer
<< /Size 28 /Root 26 0 R /Info 27 0 R >>
startxref
4398
5820
%%EOF
4 changes: 2 additions & 2 deletions testfiles/pageattr.pvt
@@ -1,6 +1,6 @@
\PassOptionsToPackage{enable-debug,check-declarations}{expl3}
\RequirePackage[debug]{pdfresources}
%\input{regression-test}
\input{regression-test}
\documentclass{article}
\begin{document}
\START
Expand All @@ -15,7 +15,7 @@ some text

%test command:
\newcommand\attributecontent{(somesetting)}
\pdf_pageattr_gput:nn {SSS}{\attributecontent}
\exp_args:Nno\pdf_pageattr_gput:nn {SSS}{\attributecontent}

\newpage
\pdf_pageattr_gremove:n {Rotate}
Expand Down

0 comments on commit aa2021c

Please sign in to comment.