[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: more changes in driver ... (80e6916)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon Apr 22 12:28:21 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : testlinkstuff
Link       : https://github.com/latex3/pdfresources/commit/80e6916b6e633c2d0103608880ba3c3f50089c02

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

commit 80e6916b6e633c2d0103608880ba3c3f50089c02
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Apr 22 12:28:21 2019 +0200

    more changes in driver ...


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

80e6916b6e633c2d0103608880ba3c3f50089c02
 hluatex-experimental.def |  153 +++++++++++++++++++++++-----------------------
 pdfresources.dtx         |   19 ++++++
 test-pdfresources.tex    |   12 +++-
 3 files changed, 105 insertions(+), 79 deletions(-)

diff --git a/hluatex-experimental.def b/hluatex-experimental.def
index fa01a60..9084e3a 100644
--- a/hluatex-experimental.def
+++ b/hluatex-experimental.def
@@ -514,9 +514,10 @@
 }
 
 \ExplSyntaxOn
-\def\Hy at StartlinkName#1#2{%
-  \pdf_link_begin_goto:nnw { link } { #2 } %%% can this be done without splitting?
-}
+\def\Hy at StartlinkName#1#2
+ {
+  \pdf_link_begin_goto:nnw { link } { #2 } %%%
+ }
 
 
 \def\close at EXPpdflink#1{%
@@ -567,10 +568,14 @@
 
 % the endlink muss have the same type as the start?
 % probably always link works
-\def\hyper at linkend{\close at EXPpdflink { link }}
+\def\hyper at linkend
+ {
+  \close at EXPpdflink { link }
+ }
 
-\def\hyper at link#1#2#3{%
-  \Hy at VerboseLinkStart{#1}{#2}%
+\def\hyper at link#1#2#3
+ {
+  \Hy at VerboseLinkStart{#1}{#2}
   \tl_if_exist:cTF
    { @#1bordercolor }
    {
@@ -630,9 +635,10 @@
     \Hy at pstringdef\Hy at pstringD{#3}
     \Hy at MakeRemoteAction
     \mode_leave_vertical:
-    \pdf_link_user:nnn { file }
-      {
-        /A<<
+    \pdf_link_user:nnn
+     { file }
+     {
+       /A<<
           /F(\Hy at pstringF)
           /S/GoToR
           \Hy at SetNewWindow
@@ -643,68 +649,53 @@
           \fi
           \Hy at href@nextactionraw
         >>
-      }
-      {
+     }
+     {
        \Hy at colorlink
-       \@filecolor#1\Hy at xspace@end
+        \@filecolor#1\Hy at xspace@end
        \Hy at endcolorlink
        \Hy at VerboseLinkStop
-      }
+     }
   \group_end:
 }
 \ExplSyntaxOff
 
 \ExplSyntaxOn
 % use by run links xxxxxxxxxxx
-\def\@hyper at launch run:#1\\#2#3{% filename, anchor text linkname
-  \begingroup
+\def\@hyper at launch run:#1\\#2#3 % filename, anchor text linkname
+ {
+  \group_begin:
     \Hy at pstringdef\Hy at pstringF{#1}%
     \Hy at pstringdef\Hy at pstringP{#3}%
-    \leavevmode
-    \pdfstartlink
-      attr{%
-        \Hy at setpdfborder
-        \Hy at setpdfhighlight
-        \ifx\@runbordercolor\relax
-        \else
-          /C[\@runbordercolor]%
-        \fi
-      }%
-      user {%
-        /Subtype/Link%
-        \ifHy at pdfa /F 4\fi
-        /A<<%
-          /F(\Hy at pstringF)%
-          /S/Launch%
+    \mode_leave_vertical:
+    \pdf_link_user:nnn
+     { run }
+     {
+      /A<<
+          /F(\Hy at pstringF)
+          /S/Launch
           \Hy at SetNewWindow
-          \ifx\\#3\\%
+          \ifx\\#3\\
           \else
-            /Win<</P(\Hy at pstringP)/F(\Hy at pstringF)>>%
+            /Win<</P(\Hy at pstringP)/F(\Hy at pstringF)>>
           \fi
           \Hy at href@nextactionraw
-        >>%
-      }%
-      \relax
-    \Hy at colorlink\@runcolor#2\Hy at xspace@end
-    \close at pdflink
-  \endgroup
+        >>
+      }
+      {
+       \Hy at colorlink
+        \@runcolor#2\Hy at xspace@end
+       \Hy at endcolorlink
+       \Hy at VerboseLinkStop
+      }
+  \group_end:
 }
-\ExplSyntaxOff
-    \begingroup
-      \count@=\luatexversion
-      \divide\count@ by 100 %
-      \edef\x{\the\count@}%
-      \count@=-\x\relax
-      \multiply\count@ by 100 %
-      \advance\count@ by \luatexversion
-      \edef\x{\endgroup
-        \def\noexpand\@pdfproducer{%
-          LuaTeX-\x.\two at digits\count at .\luatexrevision
-        }%
-      }%
-    \x
 
-\ExplSyntaxOn
+\tl_set:Nx\@pdfproducer
+ {
+   \g_driver_pdf_producer_tl
+ }
+%this needs central management in the kernel
 \def\PDF at SetupDoc{
   \ifx\@pdfpagescrop\@empty
   \else
@@ -775,36 +766,41 @@
   }%
 }
 
-\ExplSyntaxOff
+
 \def\PDF at FinishDoc{%
   \pdf at ifdraftmode{}{%
     \Hy at UseMaketitleInfos
     \HyInfo at GenerateAddons
-    \pdfextension info{%
-      /Author(\@pdfauthor)%
-      /Title(\@pdftitle)%
-      /Subject(\@pdfsubject)%
-      /Creator(\@pdfcreator)%
-      \ifx\@pdfcreationdate\@empty
-      \else
-        /CreationDate(\@pdfcreationdate)%
-      \fi
-      \ifx\@pdfmoddate\@empty
-      \else
-        /ModDate(\@pdfmoddate)%
-      \fi
-      \ifx\@pdfproducer\relax
-      \else
-        /Producer(\@pdfproducer)%
-      \fi
-      /Keywords(\@pdfkeywords)%
-      \ifx\@pdftrapped\@empty
-      \else
+    \driver_pdf_info:n
+     {
+      /Author(\@pdfauthor)
+      /Title(\@pdftitle)
+      /Subject(\@pdfsubject)
+      /Creator(\@pdfcreator)
+      \tl_if_empty:NF
+       {\@pdfcreationdate}
+       {
+        /CreationDate(\@pdfcreationdate)
+       }
+     \tl_if_empty:NF
+       {\@pdfmoddate}
+       {
+        /ModDate(\@pdfmoddate)
+       }
+     \tl_if_empty:NF
+       {\@pdfproducer}
+       {
+        /Producer(\@pdfproducer)
+       }
+      /Keywords(\@pdfkeywords)
+     \tl_if_empty:NF
+       {\@pdftrapped}
+       {
         /Trapped/\@pdftrapped
-      \fi
+       }
       \HyInfo at Addons
-    }%
-  }%
+    }
+  }
   \Hy at DisableOption{pdfauthor}%
   \Hy at DisableOption{pdftitle}%
   \Hy at DisableOption{pdfsubject}%
@@ -816,6 +812,7 @@
   \Hy at DisableOption{pdftrapped}%
   \Hy at DisableOption{pdfinfo}%
 }
+ \ExplSyntaxOff
 \def\hyper at pagetransition{%
   \ifx\@pdfpagetransition\relax
   \else
diff --git a/pdfresources.dtx b/pdfresources.dtx
index c401728..f125535 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -132,6 +132,11 @@
   \pdfcatalog { #1 }
  }
 
+ \cs_new_protected:Nn \driver_pdf_info:n
+ {
+  \pdfinfo { #1 }
+ }
+
 \cs_new_protected:Nn \driver_pdf_dest_name:nn %#1 name, #2 dest type (e.g. fitbh)
  {
   \pdfdest~{#1}#2\scan_stop:
@@ -167,6 +172,11 @@
   \pdfextension catalog { #1 }
  }
 
+ \cs_new_protected:Nn \driver_pdf_info:n
+ {
+  \pdfextension info { #1 }
+ }
+
 \cs_new_protected:Nn \driver_pdf_dest_name:nn %#1 name, #2 dest type (e.g. fitbh)
  {
   \pdfextension~dest~name~{#1}#2 \scan_stop:
@@ -187,6 +197,15 @@
       { \tex_pdfliteral:D~page~{EMC}  }
   }
 
+\tl_new:N  \g_driver_pdf_producer_tl % name??
+\tl_gset:x \g_driver_pdf_producer_tl
+ {
+   LuaTeX-
+   \int_div_truncate:nn{\luatexversion}{100}.
+   \int_compare:nNnT {\int_mod:nn{\luatexversion}{100}}<{10}{0}
+   \int_mod:nn{\luatexversion}{100}.
+   \luatexrevision
+ }
 \input{l3pdfmode-pdf.def}
 }
 
diff --git a/test-pdfresources.tex b/test-pdfresources.tex
index d4e2a9a..160eacf 100644
--- a/test-pdfresources.tex
+++ b/test-pdfresources.tex
@@ -13,7 +13,7 @@
 \driver_pdf_objects_disable:
 \ExplSyntaxOff
 \usepackage{xcolor}
-
+\showthe\luatexversion
 \makeatletter
 \@namedef{Hy at pdfversion@2.0}{10}%
 \makeatother%
@@ -30,6 +30,16 @@
 
 abc%\end{document}
 \ExplSyntaxOn
+\tl_set:Nx\l_tmpa_tl
+ {
+  LuaTeX-
+   \int_div_truncate:nn{\luatexversion}{100}.
+   \int_compare:nNnT {\int_mod:nn{\luatexversion}{100}}<{10}{0}
+   \int_mod:nn{\luatexversion}{100}.
+   \luatexrevision
+ }
+\tl_show:N\l_tmpa_tl 
+
 \driver_pdf_link_begin_user:nnw{}{/A<</Type/Action/S/URI/URI(www.blub.de)>>}
 \driver_pdf_link_end:
 





More information about the latex3-commits mailing list