[latex3-commits] [git/LaTeX3-latex3-pdfresources] develop: testing structure destinations (c22b724)

Ulrike Fischer fischer at troubleshooting-tex.de
Sat Sep 25 19:25:27 CEST 2021


Repository : https://github.com/latex3/pdfresources
On branch  : develop
Link       : https://github.com/latex3/pdfresources/commit/c22b724870e447ea9d509ae34af2ee5f752b9535

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

commit c22b724870e447ea9d509ae34af2ee5f752b9535
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sat Sep 25 19:25:27 2021 +0200

    testing structure destinations


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

c22b724870e447ea9d509ae34af2ee5f752b9535
 experiments/structure-destination.tex | 53 +++++++++++++++++------------------
 1 file changed, 25 insertions(+), 28 deletions(-)

diff --git a/experiments/structure-destination.tex b/experiments/structure-destination.tex
index 9859dcc..a66bdd2 100644
--- a/experiments/structure-destination.tex
+++ b/experiments/structure-destination.tex
@@ -1,3 +1,4 @@
+% !Mode:: "TeX:UTF-8:Main"
 \RequirePackage{pdfmanagement-testphase}
 \DeclareDocumentMetadata{
    uncompress,
@@ -10,13 +11,14 @@
 \usepackage{graphicx,iftex}
 \ExplSyntaxOn
 \ifxetex
-% with dvipdfmx/xdvipdfmx creating a structure destination is trivial, as one
-% only has to exchange the @thispage object:
+% with dest one could create a "named" structure destination, but
+% as the pdf according to the reference wants an array, we use obj
+% so that we can reference it:
 \cs_new_protected:Npn \__pdf_backend_destination_struct:nnn #1#2#3
   {
     \__pdf_backend:x
       {
-        dest ~ ( \exp_not:n {#1} )
+        obj ~ @pdf.dest.\exp_not:n{#1}
         [
           #3
           \str_case:nnF {#2}
@@ -36,6 +38,26 @@
   }
 \fi
 \cs_generate_variant:Nn  \__pdf_backend_destination_struct:nnn {nnx}
+
+\ExplSyntaxOff
+\begin{document}
+
+bbbbb
+\ExplSyntaxOn
+\__pdf_backend_destination:nn          {earth}{xyz}
+\__pdf_backend_destination_struct:nnx  {earth}{xyz}{\pdf_object_ref:n{__tag/struct/1}}
+
+\exp_args:Nx
+ \__pdf_backend_link_begin:n 
+    { /Subtype /Link /A << /S /GoTo /D ( earth ) /SD~ @pdf.dest.earth >> }
+ blub
+ \__pdf_backend_link_end:
+\ExplSyntaxOff
+
+\end{document}
+
+
+
 % similar adaption needed
 %\cs_new_protected:Npn \__pdf_backend_destination_struct:nnnn #1#2#3#4
 %  {
@@ -75,28 +97,3 @@
 %      }
 %    \__kernel_kern:n { -#1 }
 %  }
\ No newline at end of file
-
-\ExplSyntaxOff
-\begin{document}
-
-bbbbb
-\ExplSyntaxOn
-
-\pdf_object_ref:n{__tag/struct/1}
-
-\__pdf_backend_destination_struct:nnn  {abc}{fit}{@thispage}
-\__pdf_backend_destination_struct:nnx  {xyz}{fith}{\pdf_object_ref:n{__tag/struct/1}}
-\ExplSyntaxOff
-%
-%abc
-%\tagpdfparaOff
-%
-%\tagstructbegin{tag=Figure,alttext=Show tags of examples}\tagmcbegin{tag=Figure}
-%\includegraphics{example-image}
-%\tagmcend\tagstructend
-%
-%\tagpdfparaOn
-%
-%abc
-
-\end{document}
\ No newline at end of file





More information about the latex3-commits mailing list.