Skip to content

Commit

Permalink
add \pdffield_annot_ref_last: for tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrike Fischer committed Jun 11, 2021
1 parent 46c908d commit d026531
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,7 @@ this project uses date-based 'snapshot' version identifiers.
- l3pdffield-pushbutton, a module for pushbuttons
- l3pdffield-choice, a module for choice fields
- l3pdffield-action, a module for reset/submit/import actions
- l3pdffield: \pdffield_annot_ref_last:, needed for tagging in OBJR object.
### Fixed
- l3pdftools: utf8/URI didn't handle "?"
- l3pdffield: encoding of value in l3pdffield-textfield
Expand Down
21 changes: 19 additions & 2 deletions l3pdffield.dtx
Expand Up @@ -275,7 +275,7 @@
%
% \begin{function}{\pdffield_annot:n,\pdffield_annot:V}
% \begin{syntax}
% \cs{pdffield_field:nn}\Arg{key val list}
% \cs{pdffield_annot:n}\Arg{key val list}
% \end{syntax}
% This creates a new field annotation.
% It is a widget annotation box created with \cs{pdfannot_widget_box:nnn}, and
Expand All @@ -285,6 +285,15 @@
% The command also setup dictionaries to fill the |AP|, |MK| and |AA| dictionaries.
% \end{function}
%
% \begin{function}{\pdffield_annot_ref_last:}
% \begin{syntax}
% \pdffield_annot_ref_last:
% \end{syntax}
% If a tagged PDF should be created, the object
% of the annotation of a field should be referenced in the Form structure element.
% This command allows to retrieve the reference to this object.
% \end{function}

% \begin{function}{\pdffield_appearance:nn}
% \begin{syntax}
% \cs{pdffield_appearance:nn}\Arg{name}\Arg{content}
Expand Down Expand Up @@ -956,6 +965,7 @@
% ,\l_@@_down_caption_tl
% ,\g_@@_CO_sortkeys_prop
% ,\l_@@_CO_sortkey_str
% ,\g_@@_annot_ref_last_tl
% }
% Some tmp variables, and a variable for the current parent and the
% current fieldID.
Expand All @@ -972,6 +982,7 @@
\prop_new:N \g_@@_CO_sortkeys_prop
\seq_new:N \g_@@_CO_sortkeys_seq
\str_new:N \l_@@_CO_sortkey_str
\tl_new:N \g_@@_annot_ref_last_tl
% \end{macrocode}
% \end{variable}
%
Expand Down Expand Up @@ -1256,13 +1267,14 @@
{ \l_@@_annot_dp_dim }
\hfill
}
\tl_gset:Nx \g_@@_annot_ref_last_tl { \pdfannot_box_ref_last: }
\tl_if_empty:NF \l_@@_currentparent_tl
{
\seq_if_exist:cTF {g_@@_field/Kids/\l_@@_currentparent_tl _seq}
{
\seq_gput_right:cx
{g_@@_field/Kids/\l_@@_currentparent_tl _seq}
{ \pdfannot_box_ref_last:}
{ \g_@@_annot_ref_last_tl }
}
{
\msg_error:nnx { pdffield}{parent-field-missing}{\l_@@_currentparent_tl}
Expand All @@ -1279,6 +1291,11 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pdffield_annot_ref_last:}
% \begin{macrocode}
\cs_new:Npn \pdffield_annot_ref_last: { \g_@@_annot_ref_last_tl }
% \end{macrocode}
% \end{macro}
% \subsection{auxiliary command for color keys}
% \begin{macro}{\@@_color_set:nn }
% \begin{macrocode}
Expand Down

0 comments on commit d026531

Please sign in to comment.