[latex3-commits] [git/LaTeX3-latex3-pdfresources] textfields: storing (43fbb00)
Ulrike Fischer
fischer at troubleshooting-tex.de
Fri May 7 00:11:46 CEST 2021
Repository : https://github.com/latex3/pdfresources
On branch : textfields
Link : https://github.com/latex3/pdfresources/commit/43fbb00b2ea070e55d63c2eb38790c7f9757323a
>---------------------------------------------------------------
commit 43fbb00b2ea070e55d63c2eb38790c7f9757323a
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Fri May 7 00:11:46 2021 +0200
storing
>---------------------------------------------------------------
43fbb00b2ea070e55d63c2eb38790c7f9757323a
l3pdffield.dtx | 215 +++++++++++++++++++++++++++++----------------------------
1 file changed, 108 insertions(+), 107 deletions(-)
diff --git a/l3pdffield.dtx b/l3pdffield.dtx
index 2a20139..6ea134d 100644
--- a/l3pdffield.dtx
+++ b/l3pdffield.dtx
@@ -681,112 +681,6 @@
\cs_set_eq:NN \pdffield_annot:n \@@_annot:n
% \end{macrocode}
% \end{macro}
-% \subsection{Appearances}
-% TODO copy code
-%
-% \subsection{Annotation keys}
-% The size of the field annotation
-%
-% \begin{macrocode}
-\dim_new:N \l_@@_annot_ht_dim
-\dim_new:N \l_@@_annot_wd_dim
-\dim_new:N \l_@@_annot_dp_dim
-
-\keys_define:nn { pdffield / annot }
- {
- ,width .dim_set:N = \l_@@_annot_wd_dim
- ,height .dim_set:N = \l_@@_annot_ht_dim
- ,depth .dim_set:N = \l_@@_annot_dp_dim
- ,width .initial:n = 0pt
- ,height .initial:n = 0pt
- ,depth .initial:n = 0pt
- }
-% \end{macrocode}
-%
-% \begin{macrocode}
-\keys_define:nn { pdffield / annot }
- {
- parent .code:n =
- {
- \tl_set:Nn \l_@@_currentparent_tl {#1}
- \pdfannot_dict_put:nnx {widget}{Parent}{\pdf_object_ref:n{@@/field/#1}}
- }
- ,AS .code:n =
- {
- \pdfannot_dict_put:nnx {widget}{AS}{\pdf_name_from_unicode_e:n{#1}}
- }
- }
-\cs_set_protected:Npn \@@_tmpa:n #1
- {
- \keys_define:nn { pdffield / annot }
- {
- AP/#1 .code:n =
- { \pdfannot_dict_put:nnx {widget/AP}{#1}{##1} }
- }
- }
-\clist_map_inline:nn {N,R,D}
- { \@@_tmpa:n {#1} }
-
-\cs_set_protected:Npn \@@_tmpa:n #1
- {
- \keys_define:nn { pdffield / annot }
- {
- MK/#1 .code:n =
- { \pdfannot_dict_put:nnx {widget/MK}{#1}{##1} }
- }
- }
-
-\clist_map_inline:nn {R,BC,BG,CA,RC,AC,I,RI,IX,IF,TP}
- { \@@_tmpa:n {#1} }
-% \end{macrocode}
-% Flags.
-% \begin{macrocode}
-\keys_define:nn { pdffield / annot }
- {
- ,setF .code:n =
- {
- \clist_map_inline:nn {#1}
- {
- \bitset_set_true:Nn \l_@@_F_bitset {##1}
- }
- }
- ,unsetF .code:n =
- {
- \clist_map_inline:nn {#1}
- {
- \bitset_set_false:Nn \l_@@_F_bitset {##1}
- }
- }
- }
-% \end{macrocode}
-%
-% Keys for the AA dictionary. They all trigger a javascript option.
-% Fo = onfocus, Bl = onblur, D = onmousedown, U = onmouseup,
-% E = onenter, X = onexit, PO = pageopen, PC = pageclose,
-% PV = pagevisible, PI = pageinvisible
-% \begin{macrocode}
-\cs_set_protected:Npn \@@_tmpa:n #1 %
- {
- \keys_define:nn { pdffield / annot }
- {
- AA/#1 .code:n =
- {
- \pdf_string_from_unicode:nnN {utf8/string}{##1}\l_@@_tmpa_str
- \str_if_empty:NTF \l_@@_tmpa_str
- {
- \pdfannot_dict_remove:nn {widget/AA}{#1}
- }
- {
- \pdfannot_dict_put:nnx {widget/AA}
- {#1}
- {<</S/JavaScript/JS\l_@@_tmpa_str>>}
- }
- },
- }
- }
-
-\clist_map_inline:nn {Fo,Bl,D,U,E,X,PO,PC,PV,PI}{\@@_tmpa:n{#1}}
-% \end{macrocode}
%
% \subsection{Field keys}
% The names. The main name should not be empty, it is added to the dictionary
@@ -945,7 +839,114 @@
}
% \end{macrocode}
% \end{macro}
-% \subsection{user commands}
+%
+% \subsection{Annotation keys}
+% The size of the field annotation
+%
+% \begin{macrocode}
+\dim_new:N \l_@@_annot_ht_dim
+\dim_new:N \l_@@_annot_wd_dim
+\dim_new:N \l_@@_annot_dp_dim
+
+\keys_define:nn { pdffield / annot }
+ {
+ ,width .dim_set:N = \l_@@_annot_wd_dim
+ ,height .dim_set:N = \l_@@_annot_ht_dim
+ ,depth .dim_set:N = \l_@@_annot_dp_dim
+ ,width .initial:n = 0pt
+ ,height .initial:n = 0pt
+ ,depth .initial:n = 0pt
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\keys_define:nn { pdffield / annot }
+ {
+ parent .code:n =
+ {
+ \tl_set:Nn \l_@@_currentparent_tl {#1}
+ \pdfannot_dict_put:nnx {widget}{Parent}{\pdf_object_ref:n{@@/field/#1}}
+ }
+ ,AS .code:n =
+ {
+ \pdfannot_dict_put:nnx {widget}{AS}{\pdf_name_from_unicode_e:n{#1}}
+ }
+ }
+\cs_set_protected:Npn \@@_tmpa:n #1
+ {
+ \keys_define:nn { pdffield / annot }
+ {
+ AP/#1 .code:n =
+ { \pdfannot_dict_put:nnx {widget/AP}{#1}{##1} }
+ }
+ }
+\clist_map_inline:nn {N,R,D}
+ { \@@_tmpa:n {#1} }
+
+\cs_set_protected:Npn \@@_tmpa:n #1
+ {
+ \keys_define:nn { pdffield / annot }
+ {
+ MK/#1 .code:n =
+ { \pdfannot_dict_put:nnx {widget/MK}{#1}{##1} }
+ }
+ }
+
+\clist_map_inline:nn {R,BC,BG,CA,RC,AC,I,RI,IX,IF,TP}
+ { \@@_tmpa:n {#1} }
+% \end{macrocode}
+% Flags.
+% \begin{macrocode}
+\keys_define:nn { pdffield / annot }
+ {
+ ,setF .code:n =
+ {
+ \clist_map_inline:nn {#1}
+ {
+ \bitset_set_true:Nn \l_@@_F_bitset {##1}
+ }
+ }
+ ,unsetF .code:n =
+ {
+ \clist_map_inline:nn {#1}
+ {
+ \bitset_set_false:Nn \l_@@_F_bitset {##1}
+ }
+ }
+ }
+% \end{macrocode}
+%
+% Keys for the AA dictionary. They all trigger a javascript option.
+% Fo = onfocus, Bl = onblur, D = onmousedown, U = onmouseup,
+% E = onenter, X = onexit, PO = pageopen, PC = pageclose,
+% PV = pagevisible, PI = pageinvisible
+% \begin{macrocode}
+\cs_set_protected:Npn \@@_tmpa:n #1 %
+ {
+ \keys_define:nn { pdffield / annot }
+ {
+ AA/#1 .code:n =
+ {
+ \pdf_string_from_unicode:nnN {utf8/string}{##1}\l_@@_tmpa_str
+ \str_if_empty:NTF \l_@@_tmpa_str
+ {
+ \pdfannot_dict_remove:nn {widget/AA}{#1}
+ }
+ {
+ \pdfannot_dict_put:nnx {widget/AA}
+ {#1}
+ {<</S/JavaScript/JS\l_@@_tmpa_str>>}
+ }
+ },
+ }
+ }
+
+\clist_map_inline:nn {Fo,Bl,D,U,E,X,PO,PC,PV,PI}{\@@_tmpa:n{#1}}
+% \end{macrocode}
+%
+% \subsection{User commands}
+% Some commands to setup fields will be needed, but
+% not sure yet where.
% \begin{macro}{\pdffield_setup:nn}
% \begin{macrocode}
%
More information about the latex3-commits
mailing list.