[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: storing (49e68b4)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon Apr 29 19:46:20 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : testlinkstuff
Link       : https://github.com/latex3/pdfresources/commit/49e68b41f2581657a0a293990bea5ab29266c8a3

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

commit 49e68b41f2581657a0a293990bea5ab29266c8a3
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Apr 29 19:46:20 2019 +0200

    storing


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

49e68b41f2581657a0a293990bea5ab29266c8a3
 hluatex-experimental.def |   55 +++++++++++++++++++++++++++-------------------
 pdfresources.dtx         |   11 ++++++++--
 test-pdfresources.tex    |   18 +++++----------
 3 files changed, 47 insertions(+), 37 deletions(-)

diff --git a/hluatex-experimental.def b/hluatex-experimental.def
index 64a5e18..1e39876 100644
--- a/hluatex-experimental.def
+++ b/hluatex-experimental.def
@@ -354,9 +354,9 @@
       ]
     }
     \edef\OBJ at OCGs{\the\pdflastobj\c_space_tl 0\c_space_tl R}
-    \driver_pdf_catalog:n
-     {
-      /OCProperties<<
+    \pdf_catalog_gput:nn
+     {OCProperties}
+     {<<
         /OCGs\c_space_tl\OBJ at OCGs
         /D<<
           /OFF[\OBJ at OCG@print]
@@ -379,7 +379,7 @@
           ]
         >>
       >>
-    }
+     }
     \begingroup
       \edef\x{\endgroup
         \pdfpageresources{
@@ -721,17 +721,19 @@
       /NumCopies\c_space_tl \@pdfnumcopies
     \fi
   }%
-  \driver_pdf_catalog:n{%
     \ifx\Hy at temp\@empty
     \else
-      /ViewerPreferences<<\Hy at temp>>%
+    \pdf_catalog_gput:nn
+     {ViewerPreferences}{<<\Hy at temp>>}%
     \fi
-    \Hy at UseNameKey{PageLayout}\@pdfpagelayout
+    %% \Hy at UseNameKey{PageLayout}\@pdfpagelayout <------?????
     \ifx\@pdflang\relax
     \else
-      /Lang(\@pdflang)%
+      \pdf_catalog_gput:nn
+       { Lang }
+       {(\@pdflang)}%
     \fi
-  }%
+
 }
 
 
@@ -739,36 +741,43 @@
   \pdf at ifdraftmode{}{%
     \Hy at UseMaketitleInfos
     \HyInfo at GenerateAddons
-    \driver_pdf_info:n
-     {
-      /Author(\@pdfauthor)
-      /Title(\@pdftitle)
-      /Subject(\@pdfsubject)
-      /Creator(\@pdfcreator)
-      \tl_if_empty:NF
+    \pdf_info_gput:nn
+      {Author}{(\@pdfauthor)}
+    \pdf_info_gput:nn
+      {Title}{(\@pdftitle)}
+    \pdf_info_gput:nn
+      {Subject}{(\@pdfsubject)}
+    \pdf_info_gput:nn
+      {Creator}{(\@pdfcreator)} %hm should hyperref set this in any case??
+    \tl_if_empty:NF
        {\@pdfcreationdate}
        {
-        /CreationDate(\@pdfcreationdate)
+        \pdf_info_gput:nn
+         {CreationDate}{(\@pdfcreationdate)}
        }
      \tl_if_empty:NF
        \@pdfmoddate
        {
-        /ModDate(\@pdfmoddate)
+        \pdf_info_gput:nn
+         {ModDate}{(\@pdfmoddate)}
        }
      \tl_if_exist:NT %special, as \relax is default
        \@pdfproducer
        {
-        /Producer(\@pdfproducer)
+        \pdf_info_gput:nn
+         {Producer}{(\@pdfproducer)}
        }
-      /Keywords(\@pdfkeywords)
+     \pdf_info_gput:nn
+       {Keywords}{(\@pdfkeywords)}
      \tl_if_empty:NF
        {\@pdftrapped}
        {
-        /Trapped/\@pdftrapped
+        \pdf_info_gput:nn
+        {Trapped}{/\@pdftrapped}
        }
-      \HyInfo at Addons
+      %\HyInfo at Addons % unclear ....needs probably change in hyperref
+      \pdf_info_out: % where should this go????
     }
-  }
   \Hy at DisableOption{pdfauthor}%
   \Hy at DisableOption{pdftitle}%
   \Hy at DisableOption{pdfsubject}%
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 2c4fcbe..9041fbf 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -163,6 +163,11 @@
   \pdfextension catalog {  } openaction~goto~page #1 {#2}
  }
 
+\cs_new_protected:Npn \driver_pdf_catalog:n #1 %content, currently needed as hyperref has \Hy at PutCatalog
+ {
+  \pdfextension catalog {#1}
+ }
+
 \cs_new_protected:Npx \driver_pdf_bdc:nn #1 #2
   {
     \cs_if_exist:NTF \tex_pdfextension:D
@@ -214,7 +219,7 @@
 % The info dictionary is filled by e.g. \verb+\pdfinfo+. Multiple appearances of
 % \verb+\pdfinfo+ are concatenated, so one could end with multiple /Title or /Author entries.
 % It is then viewer dependant which one is showed, so it is better to avoid them. We therefore setup a
-% property which is filled and written to the info directory in one go at begin document.
+% property which is filled and written to the info directory in one go.
 %    \begin{macrocode}
 %<*package>
 \prop_new:N \g_@@_info_dict_prop
@@ -222,10 +227,12 @@
   {
    \prop_gput:Nnn\g_@@_info_dict_prop { #1 } { #2 }
   }
-\AtBeginDocument
+
+\cs_new_protected:Npn \pdf_info_out: %internal? How to ensure that it is used only once?
  {
   \prop_map_function:NN  \g_@@_info_dict_prop \driver_pdf_info_gput:nn
  }
+
 %</package>
 %    \end{macrocode}
 % \subsection{The catalog dictionary}
diff --git a/test-pdfresources.tex b/test-pdfresources.tex
index ce9bcab..f90d420 100644
--- a/test-pdfresources.tex
+++ b/test-pdfresources.tex
@@ -1,13 +1,9 @@
 % !Mode:: "TeX:DE:UTF-8:Main"
-
+%\input{regression-test}
 
 
 \documentclass{article}
-\usepackage{expl3}
 
-\makeatletter
-\@namedef{Hy at pdfversion@2.0}{10}%
-\makeatother%
 \usepackage{pdfresources}
 
 %don't compress pdf:
@@ -20,25 +16,23 @@
 \usepackage{xcolor}
 
 \usepackage[customdriver=hluatex-experimental,pdfversion=2.0,pdftitle=X]{hyperref}
-\ExplSyntaxOn
-\driver_pdf_info_gput:nn{Title}{(A)}
-\driver_pdf_info_gput:nn{Title}{(B)}
-\driver_pdf_info_gput:nn{Title}{(C)}
-\ExplSyntaxOff
+
 %%\tracingmacros=1
 \hypersetup{urlbordercolor=blue,linkbordercolor=green,pdfborder={1 1 1},pdfprintpagerange=0}
 %%%\makeatletter
 \hypupdateattribute
 \makeatletter%\tracingmacros=1
-\textwidth=5cm
+\textwidth=5cm \show\y
 \begin{document}
 \makeatletter%\show\Hy at pstringdef
 
 abc%\end{document}
 \ExplSyntaxOn
+\newpage
 
+\prop_show:N\g__pdf_info_dict_prop
 
-\driver_pdf_link_begin_user:nnw{}{/A<</Type/Action/S/URI/URI(www.blub.de)>>}
+xx\driver_pdf_link_begin_user:nnw{}{/A<</Type/Action/S/URI/URI(www.blub.de)>>}
 \driver_pdf_link_end:
 
 \driver_pdf_link_begin_goto:nnw{}{Dest} xxx\driver_pdf_link_end:





More information about the latex3-commits mailing list