[latex3-commits] [git/LaTeX3-latex3-pdfresources] correctannot: add command to use the annot dictionaries (b95e2e9)
Ulrike Fischer
fischer at troubleshooting-tex.de
Wed Mar 3 15:18:15 CET 2021
Repository : https://github.com/latex3/pdfresources
On branch : correctannot
Link : https://github.com/latex3/pdfresources/commit/b95e2e9de207b6f0def06b1927492f9a95e5c488
>---------------------------------------------------------------
commit b95e2e9de207b6f0def06b1927492f9a95e5c488
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Wed Mar 3 15:18:15 2021 +0100
add command to use the annot dictionaries
>---------------------------------------------------------------
b95e2e9de207b6f0def06b1927492f9a95e5c488
l3pdfannot.dtx | 17 ++++++++++++
.../{annot.luatex.tpf => annot-dict.luatex.tpf} | 26 +++++++++----------
.../annot.pvt => testfiles/annot-dict.pvt | 11 +++++---
testfiles/{annot.tpf => annot-dict.tpf} | 22 ++++++++--------
.../{annot.xetex.tpf => annot-dict.xetex.tpf} | 30 +++++++++++-----------
5 files changed, 63 insertions(+), 43 deletions(-)
diff --git a/l3pdfannot.dtx b/l3pdfannot.dtx
index 76a6451..770e02f 100644
--- a/l3pdfannot.dtx
+++ b/l3pdfannot.dtx
@@ -266,6 +266,17 @@
% \texttt{link/GoTo}, \texttt{link/Named}.
% \end{function}
%
+% \begin{function}[EXP,added = 2021-03-03]
+% { \pdfannot_dict_use:n }
+% \begin{syntax}
+% \cs{pdfannot_dict_use:n} \Arg{dictionary name}
+% \end{syntax}
+% This outputs the property list of the dictionary as a list of
+% |/key value| pairs.
+% This can be used e.g. when writing a dictionary object with
+% \cs{pdf_object_write:nx}
+% \end{function}
+%
% \begin{variable}[added = 2020-12-28]{\l_pdfannot_F_bitset}
% This is a bitset variable, with the named index names suitable for the
% /F flag in an annotation.
@@ -531,6 +542,7 @@
% \pdfannot_dict_put:nnx,
% \pdfannot_dict_remove:nn,
% \pdfannot_dict_show:n
+% \pdfannot_dict_use:n
% }
% \begin{macrocode}
\cs_new_protected:Npn \pdfannot_dict_put:nnn #1 #2 #3
@@ -550,6 +562,11 @@
{
\pdfdict_show:n { l_@@/#1 }
}
+
+\cs_new:Npn \pdfannot_dict_use:n #1
+ {
+ \pdfdict_use:n { l_@@/#1 }
+ }
%</package>
% \end{macrocode}
% \end{macro}
diff --git a/testfiles/annot.luatex.tpf b/testfiles/annot-dict.luatex.tpf
similarity index 87%
copy from testfiles/annot.luatex.tpf
copy to testfiles/annot-dict.luatex.tpf
index 1a77a74..af61afb 100644
--- a/testfiles/annot.luatex.tpf
+++ b/testfiles/annot-dict.luatex.tpf
@@ -21,7 +21,7 @@ endobj
[ 5 0 R ]
endobj
5 0 obj
-<< /Type /Annot /Subtype/Widget/F 4/T(abc)/FT/Tx/Q 0/BS<</W 1 /S /S>>/MK<</BC[1 0 0]/BG[1 1 1]>>/DA(/Helv 10 Tf 0 0 0 rg)/DV()/V() /Rect [ 159.233 707.125 187.579 735.472 ] >>
+<< /Type /Annot /Subtype /Widget /T (abc) /FT /Tx /MK <</BC[1 0 0]/BG[1 1 1]>> /Rect [ 159.233 707.125 187.579 735.472 ] >>
endobj
6 0 obj
<< /ExtGState 1 0 R /Font << /F23 9 0 R >> /ProcSet [ /PDF /Text ] >>
@@ -103,22 +103,22 @@ xref
0000000004 00000 f
0000000000 00000 f
0000000428 00000 n
-0000000619 00000 n
+0000000568 00000 n
0000000273 00000 n
0000000067 00000 n
-0000003169 00000 n
-0000003522 00000 n
+0000003118 00000 n
+0000003471 00000 n
0000000402 00000 n
-0000000704 00000 n
-0000002125 00000 n
-0000000783 00000 n
-0000000859 00000 n
-0000002361 00000 n
-0000003322 00000 n
-0000003583 00000 n
-0000003648 00000 n
+0000000653 00000 n
+0000002074 00000 n
+0000000732 00000 n
+0000000808 00000 n
+0000002310 00000 n
+0000003271 00000 n
+0000003532 00000 n
+0000003597 00000 n
trailer
<< /Size 20 /Root 18 0 R /Info 19 0 R /ID [ <2350CAD05F8A7AF0AA4058486855344F> <2350CAD05F8A7AF0AA4058486855344F> ] >>
startxref
-3792
+3741
%%EOF
diff --git a/testfiles-dvips/annot.pvt b/testfiles/annot-dict.pvt
similarity index 51%
copy from testfiles-dvips/annot.pvt
copy to testfiles/annot-dict.pvt
index aea0999..a39c551 100644
--- a/testfiles-dvips/annot.pvt
+++ b/testfiles/annot-dict.pvt
@@ -8,14 +8,17 @@
\begin{document}
\START
% just to avoid to have to escape every space ...
-\def\testcontent{/Subtype/Widget/F 4/T(abc)/FT/Tx/Q 0/BS<</W 1 /S /S>>/MK<</BC[1 0 0]/BG[1 1 1]>>/DA(/Helv 10 Tf 0 0 0 rg)/DV()/V()}
\ExplSyntaxOn
-\cs_generate_variant:Nn \pdfannot_box:nnnn {nnno}
-xx\pdfannot_box:nnno
+\pdfannot_dict_put:nnn{widget}{Subtype}{/Widget}
+\pdfannot_dict_put:nnn{widget}{T}{(abc)}
+\pdfannot_dict_put:nnn{widget}{FT}{/Tx}
+\pdfannot_dict_put:nnn{widget}{MK}{<</BC[1~0~0]/BG[1~1~1]>>}
+\cs_generate_variant:Nn \pdfannot_box:nnnn {nnnx}
+xx\pdfannot_box:nnnx
{1cm}
{1cm}
{0pt}
- {\testcontent}
+ {\pdfannot_dict_use:n{widget}}
\ExplSyntaxOff
xxyyzzww
\end{document}
\ No newline at end of file
diff --git a/testfiles/annot.tpf b/testfiles/annot-dict.tpf
similarity index 92%
copy from testfiles/annot.tpf
copy to testfiles/annot-dict.tpf
index 1c0eaff..fa68ee9 100644
--- a/testfiles/annot.tpf
+++ b/testfiles/annot-dict.tpf
@@ -27,7 +27,7 @@ endobj
5 0 obj
<<
/Type /Annot
-/Subtype/Widget/F 4/T(abc)/FT/Tx/Q 0/BS<</W 1 /S /S>>/MK<</BC[1 0 0]/BG[1 1 1]>>/DA(/Helv 10 Tf 0 0 0 rg)/DV()/V()
+/Subtype /Widget /T (abc) /FT /Tx /MK <</BC[1 0 0]/BG[1 1 1]>>
/Rect [159.228 707.125 187.575 735.472]
>>
endobj
@@ -228,22 +228,22 @@ xref
0000000004 00000 f
0000000000 00000 f
0000000347 00000 n
-0000000536 00000 n
+0000000485 00000 n
0000000217 00000 n
0000000062 00000 n
-0000011519 00000 n
-0000011676 00000 n
-0000000622 00000 n
-0000001041 00000 n
-0000009509 00000 n
-0000009736 00000 n
-0000011734 00000 n
-0000011799 00000 n
+0000011468 00000 n
+0000011625 00000 n
+0000000571 00000 n
+0000000990 00000 n
+0000009458 00000 n
+0000009685 00000 n
+0000011683 00000 n
+0000011748 00000 n
trailer
<< /Size 17
/Root 15 0 R
/Info 16 0 R
/ID [<9BD18DF3359C1216B83ADB4AA401CC9A> <9BD18DF3359C1216B83ADB4AA401CC9A>] >>
startxref
-11943
+11892
%%EOF
diff --git a/testfiles/annot.xetex.tpf b/testfiles/annot-dict.xetex.tpf
similarity index 84%
copy from testfiles/annot.xetex.tpf
copy to testfiles/annot-dict.xetex.tpf
index 727e6ac..546093a 100644
--- a/testfiles/annot.xetex.tpf
+++ b/testfiles/annot-dict.xetex.tpf
@@ -13,8 +13,8 @@ endobj
<</opacity1<</ca 1/CA 1>>>>
endobj
7 0 obj
-<</Type/Annot/Subtype/Widget/F 4/T(abc)/FT/Tx/Q 0/BS<</W 1/S/S>>/MK<</BC[1 0 0]/BG[1
-1 1]>>/DA(/Helv 10 Tf 0 0 0 rg)/DV()/V()/Rect[159.233 707.125 187.579 735.472]>>
+<</Type/Annot/Subtype/Widget/T(abc)/FT/Tx/MK<</BC[1 0 0]/BG[1 1 1]>>/Rect[159.233
+707.125 187.579 735.472]>>
endobj
11 0 obj
[7 0 R]
@@ -87,25 +87,25 @@ endobj
xref
0 17
0000000000 65535 f
-0000000906 00000 n
-0000000786 00000 n
-0000000616 00000 n
+0000000849 00000 n
+0000000729 00000 n
+0000000559 00000 n
0000000368 00000 n
-0000003233 00000 n
-0000002783 00000 n
+0000003176 00000 n
+0000002726 00000 n
0000000411 00000 n
0000000015 00000 n
0000000274 00000 n
-0000000706 00000 n
-0000000592 00000 n
-0000000964 00000 n
-0000002972 00000 n
-0000001426 00000 n
-0000002660 00000 n
-0000002718 00000 n
+0000000649 00000 n
+0000000535 00000 n
+0000000907 00000 n
+0000002915 00000 n
+0000001369 00000 n
+0000002603 00000 n
+0000002661 00000 n
trailer
<</ID[<ID-STRING><ID-STRING>]/Root
1 0 R/Info 2 0 R/Size 17>>
startxref
-3382
+3325
%%EOF
More information about the latex3-commits
mailing list.