summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx')
-rw-r--r--macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx56
1 files changed, 48 insertions, 8 deletions
diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx
index 256e3e6dc9..c8eddc0806 100644
--- a/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx
+++ b/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx
@@ -52,7 +52,7 @@
% }^^A
% }
%
-% \date{Version 0.95c, released 2021-03-17}
+% \date{Version 0.95d, released 2021-05-14}
%
% \maketitle
% \begin{documentation}
@@ -354,9 +354,9 @@
% /F flag in an annotation.
% It can be used for example like this:
% \begin{verbatim}
-% \pdfannot_dict_put:nnn {link/URI} {F}
-% { \bitset_to_arabic:N \l_pdfannot_F_bitset }
% \bitset_set_true:Nn \l_pdfannot_F_bitset {Print}
+% \pdfannot_dict_put:nnx {link/URI} {F}
+% { \bitset_to_arabic:N \l_pdfannot_F_bitset }
% \end{verbatim}
% The known keys for the bitset are |Invisible|, |Hidden|,
% |Print|, |NoZoom|, |NoRotate|, |NoView|, |ReadOnly|, |Locked|, |ToggleNoView|,
@@ -382,6 +382,11 @@
% is prefilled with \texttt{/Subtype/Widget}).
% The hooks \texttt{pdfannot/widget/before} and \texttt{pdfannot/widget/after}
% are executed before and after the widget.
+% The widget has four subdirectories, |widget/AA|, |widget/AP|, |widget/MK| and
+% |widget/BS|
+% which can be filled with \cs{pdfannot_dict_put:nnn} and will be used if not
+% empty.
+%
% \end{function}
% \end{documentation}
%
@@ -392,7 +397,7 @@
% \begin{macrocode}
%<@@=pdfannot>
%<*header>
-\ProvidesExplPackage{l3pdfannot}{2021-03-17}{0.95c}
+\ProvidesExplPackage{l3pdfannot}{2021-05-14}{0.95d}
{PDF-annotations}
\RequirePackage{l3pdfdict}
%</header>
@@ -463,21 +468,56 @@
% the subtype setting (the /Type is added by the backend).
% \begin{macrocode}
\pdfdict_new:n { l_@@/widget }
+ \pdfdict_new:n { l_@@/widget/AA }
+ \pdfdict_new:n { l_@@/widget/AP }
+ \pdfdict_new:n { l_@@/widget/MK }
+ \pdfdict_new:n { l_@@/widget/BS }
\pdfdict_put:nnn { l_@@/widget }{ Subtype }{ /Widget }
\hook_new_pair:nn
{pdfannot/widget/before}
{pdfannot/widget/after}
- \hook_new_pair:nn
- {pdfannot/widget/begin}
- {pdfannot/widget/end}
\cs_new_protected:Npn \pdfannot_widget_box:nnn #1 #2 #3
{
\hook_use:n { pdfannot/widget/before }
+ \group_begin:
+ \pdfmeta_standard_verify:nT
+ {annot_widget_no_AA}
+ {
+ \pdfdict_if_empty:nF { l_@@/widget/AA }
+ {
+ \pdf_object_unnamed_write:nx {dict}{\pdfdict_use:n{l_@@/widget/AA}}
+ \pdfdict_put:nnx { l_@@/widget }
+ {AA}
+ {\pdf_object_ref_last:}
+ }
+ }
+ \pdfdict_if_empty:nF { l_@@/widget/AP }
+ {
+ \pdf_object_unnamed_write:nx {dict}{\pdfdict_use:n{l_@@/widget/AP}}
+ \pdfdict_put:nnx { l_@@/widget }
+ {AP}
+ {\pdf_object_ref_last:}
+ }
+ \pdfdict_if_empty:nF { l_@@/widget/MK }
+ {
+ \pdf_object_unnamed_write:nx {dict}{\pdfdict_use:n{l_@@/widget/MK}}
+ \pdfdict_put:nnx { l_@@/widget }
+ {MK}
+ {\pdf_object_ref_last:}
+ }
+ \pdfdict_if_empty:nF { l_@@/widget/BS }
+ {
+ \pdf_object_unnamed_write:nx {dict}{\pdfdict_use:n{l_@@/widget/BS}}
+ \pdfdict_put:nnx { l_@@/widget }
+ {BS}
+ {\pdf_object_ref_last:}
+ }
\pdfannot_box:nnnx {#1}{#2}{#3}
{
\pdfdict_use:n { l_@@/widget}
}
- \hook_use:n { pdfannot/widget/after }
+ \hook_use:n { pdfannot/widget/end }
+ \group_end:
\bool_gset_false:N\g_@@_use_lastlink_bool
}
% \end{macrocode}