[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: storing, still errors ... (e2dcb95)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon Dec 7 00:29:47 CET 2020


Repository : https://github.com/latex3/pdfresources
On branch  : reworking-annot
Link       : https://github.com/latex3/pdfresources/commit/e2dcb95c9f175fe9b63f1c9ef86c652dd0f3fa74

>---------------------------------------------------------------

commit e2dcb95c9f175fe9b63f1c9ef86c652dd0f3fa74
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Dec 7 00:29:47 2020 +0100

    storing, still errors ...


>---------------------------------------------------------------

e2dcb95c9f175fe9b63f1c9ef86c652dd0f3fa74
 hgeneric-experimental.def | 44 ++++++++++++++++++++++++--------------------
 l3pdfannot.dtx            | 32 ++++++++++++++++++--------------
 testfiles/linkhook.pvt    | 16 ++++++++--------
 3 files changed, 50 insertions(+), 42 deletions(-)

diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index c448a38..89e784c 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -313,23 +313,23 @@
   {
     \bool_if:NT \l__hyp_pdfa_bool
       {
-        \pdfdict_put:nnn
-          {l_annot/Link/URI}
+        \pdfannot_dict_put:nnn
+          {link/URI}
           { F }
           { 4 }
 
-        \pdfdict_put:nnn
-          {l_annot/Link/GoTo}
+        \pdfannot_dict_put:nnn
+          {link/GoTo}
           { F }
           { 4 }
 
-        \pdfdict_put:nnn
-          {l_annot/Link/GoToR}
+        \pdfannot_dict_put:nnn
+          {link/GoToR}
           { F }
           { 4 }
 
-        \pdfdict_put:nnn
-          {l_annot/Link/Named}
+        \pdfannot_dict_put:nnn
+          {link/Named}
           { F }
           { 4 }
       }
@@ -387,21 +387,23 @@
       {
         \tl_if_empty:NTF \@pdfborder
           {
-            \pdfdict_remove:nn {l_annot/Link/##1}{Border}
+            \pdfannot_dict_remove:nn {link/##1}{Border}
           }
           {
-            \pdfdict_put:nnx
-              {l_annot/Link/##1}
+            \exp_args:Nnnx
+             \pdfannot_dict_put:nnn
+              {link/##1}
               { Border }
               { [\@pdfborder] }
           }
         \tl_if_empty:NTF \@pdfborderstyle
           {
-            \pdfdict_remove:nn {l_annot/Link/##1} { BS }
+            \pdfannot_dict_remove:nn {link/##1} { BS }
           }
           {
-           \pdfdict_put:nnx
-              {l_annot/Link/##1}
+            \exp_args:Nnnx
+             \pdfannot_dict_put:nnn
+              {link/##1}
               { BS }
               { <<\@pdfborderstyle>> }
           }
@@ -415,11 +417,12 @@
       {
         \tl_if_empty:NTF \@pdfhighlight
           {
-            \pdfdict_remove:nn {l_annot/Link/##1}{ H }
+            \pdfannot_dict_remove:nn {link/##1}{ H }
           }
           {
-             \pdfdict_put:nnx
-              {l_annot/Link/##1}
+            \exp_args:Nnnx
+             \pdfannot_dict_put:nnn
+              {link/##1}
               { H }
               { \@pdfhighlight }
          }
@@ -433,13 +436,14 @@
       {
         \tl_if_exist:cTF { @\prop_item:Nn\c__hyp_map_linktypes_prop{##1}bordercolor }
           {
-            \pdfdict_put:nnx
-              {l_annot/Link/##1}
+           \exp_args:Nnnx
+             \pdfannot_dict_put:nnn
+              {link/##1}
               { C }
               { [\tl_use:c {@\prop_item:Nn\c__hyp_map_linktypes_prop{##1}bordercolor}] }
           }
           {
-            \pdfdict_remove:nn {l_annot/Link/##1} { C }
+            \pdfannot_dict_remove:nn {link/##1} { C }
           }
      }
   }
diff --git a/l3pdfannot.dtx b/l3pdfannot.dtx
index 0fb7c05..76cfae5 100644
--- a/l3pdfannot.dtx
+++ b/l3pdfannot.dtx
@@ -50,10 +50,10 @@
 %
 % \section{\pkg{l3pdfannot} documentation}
 % This module contains a number of commands to create PDF annotations.
-% The command are \emph{not} only simple wrappers around primitive commands.
+% The commands are \emph{not} only simple wrappers around primitive commands.
 % To allow external packages to configure links and other annotations,
-% the annotations have hooks and use shared attribute dictionaries.
-% The hooks and dictionaries are selected depending on the \Arg{type}
+% some of the commands have hooks and use shared attribute dictionaries.
+% For these commands the hooks and dictionaries are selected depending on the \Arg{type}
 % of the annotation. Currently the module only supports some general commands
 % and link annotations. Commands for other annotations like widgets will be added
 % later.
@@ -78,9 +78,12 @@
 %     \cs{pdfannot_box:nnnnn} \Arg{type} \Arg{width} \Arg{height} \Arg{depth} \Arg{annot spec}
 %   \end{syntax}
 %   This creates an \texttt{/Type/Annot} object with the given dimensions.
-%   If \Arg{type} is a known type the attribute dictionary of the type is
-%   inserted additionally to the manually given \Arg{annot spec}.
-%   Hooks are not used. \Arg{type} could e.g. be |link/URI|. %
+%   \Arg{type} should be currently one of |link/URI|, |link/GoToR|,
+%  |link/Launch|, |link/GoTo| or |link/Named| or
+%  |widget|, it will then insert the attribute dictionary of this type
+%   additionally to the manually given \Arg{annot spec}.
+%   The attribute dictionaries can be filled with commands described below.
+%   Hooks are not used.
 % \end{function}
 % \begin{function}[added = 2019-09-05]
 %   { \pdfannot_box_last: }
@@ -92,11 +95,12 @@
 % \subsection{Link annotations}
 % Link annotations are special cases of annotations. In the PDF they are identified
 % by an |/Subtype/Link| entry in the dictionary.
-% Link annotations are quite important as most documents contains links,
+% Link annotations are quite important as many documents contain links,
 % both internal and external. They need a set of special commands for two reasons:
 %
-% At first links are not only needed for boxed material. Links can contain line
-% and page breaks (this is normally implemented by creating a set of annotations).
+% At first the content of links are not not only boxes. Links can contain line
+% and page breaks (this is normally implemented by the primitive command by
+% creating a set of annotations).
 %
 % At second link annotations are objects that need some
 % \enquote{management} as more than one
@@ -205,7 +209,7 @@
 % \end{function}
 % \begin{function}[added = 2020-12-04]{ \pdfannot_dict_put:nnn }
 %  \begin{syntax}
-%    \cs{\pdfannot_dict_put:nnn} \Arg{dictionary name} \Arg{key} \Arg{value}
+%    \cs{pdfannot_dict_put:nnn} \Arg{dictionary name} \Arg{key} \Arg{value}
 %  \end{syntax}
 %   This adds (locally) a key-value to the internal annot dictionaries used
 %   by the link commands above.
@@ -215,20 +219,20 @@
 % \end{function}
 % \begin{function}[added = 2020-12-04]{ \pdfannot_dict_remove:nn }
 %  \begin{syntax}
-%    \cs{\pdfannot_dict_remove:nn} \Arg{dictionary name} \Arg{key}
+%    \cs{pdfannot_dict_remove:nn} \Arg{dictionary name} \Arg{key}
 %  \end{syntax}
 %   This removes a key-value from the internal annot dictionary
 %   \Arg{dictionary name} should be currently one of \texttt{link/URI},
-%   \texttt{link/URI},\texttt{link/GoToR}, \texttt{link/Launch},
+%   \texttt{link/URI}, \texttt{link/GoToR}, \texttt{link/Launch},
 %   \texttt{link/GoTo}, \texttt{link/Named}.
 % \end{function}
 % \begin{function}[added = 2020-12-04]{ \pdfannot_dict_show:n }
 %  \begin{syntax}
-%    \cs{\pdfannot_dict_show:n} \Arg{dictionary name}
+%    \cs{pdfannot_dict_show:n} \Arg{dictionary name}
 %  \end{syntax}
 %   This shows the content of the internal annot dictionary.
 %  \Arg{dictionary name} should be currently one of \texttt{link/URI},
-%   \texttt{link/URI},\texttt{link/GoToR}, \texttt{link/Launch},
+%   \texttt{link/URI}, \texttt{link/GoToR}, \texttt{link/Launch},
 %   \texttt{link/GoTo}, \texttt{link/Named}.
 % \end{function}
 % \end{documentation}
diff --git a/testfiles/linkhook.pvt b/testfiles/linkhook.pvt
index 26ac335..22928c2 100644
--- a/testfiles/linkhook.pvt
+++ b/testfiles/linkhook.pvt
@@ -16,31 +16,31 @@
 %add hooks:
 \ExplSyntaxOn\makeatletter
 \hook_gput_code:nnn
- {pdf/annot/Link/URI/before}
+ {pdfannot/link/URI/before}
  { pdf }
  {
   begin~url
  }
 
- \pdfdict_put:nnn
-   {l_annot/Link/URI}
+\pdfannot_dict_put:nnn
+   {link/URI}
    { StructParent }
    { 123 }
 
 \hook_gput_code:nnn
- {pdf/annot/Link/URI/after}
+ {pdfannot/link/URI/after}
  { pdf }
  {
   end~url
  }
 
-\pdfdict_put:nnn
-   {l_annot/Link/URI}
+\pdfannot_dict_put:nnn
+   {link/URI}
    { Contents }
    { (url) }
 
- \pdfdict_put:nnn
-   {l_annot/Link/GoTo}
+\pdfannot_dict_put:nnn
+   {link/GoTo}
    { Contents }
    { (ref) }
 





More information about the latex3-commits mailing list.