[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: hyperxmp, not quite right ..., wrong hook (file after ...) (880bd58)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Feb 11 00:33:18 CET 2021


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

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

commit 880bd583d17fec5970e633b130057f7d1118b342
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Feb 11 00:33:18 2021 +0100

    hyperxmp, not quite right ..., wrong hook (file after ...)


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

880bd583d17fec5970e633b130057f7d1118b342
 newpackages/new-hyperxmp.sty   | 10 ++++++++--
 pdfmanagement-firstaid.dtx     | 11 ++++++++++-
 testfiles-noxetex/metadata.pvt | 22 +++++++---------------
 3 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/newpackages/new-hyperxmp.sty b/newpackages/new-hyperxmp.sty
index 04290e8..58d9c41 100644
--- a/newpackages/new-hyperxmp.sty
+++ b/newpackages/new-hyperxmp.sty
@@ -20,7 +20,7 @@
 % for those people who are interested.
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
 \ProvidesPackage{new-hyperxmp}
-    [2021/02/09 v0.3 Store hyperref metadata in XMP format / testing pdfresource management ...UF]
+    [2021/02/11 v0.4 Store hyperref metadata in XMP format / testing pdfresource management ...UF]
 
 \RequirePackage{hyperxmp}
 
@@ -95,15 +95,21 @@
       ,pdfcontacturl
       ,pdfdate
     %hyperref
-      ,pdfauthor %??
       ,pdftitle
       ,pdfsubject
       ,pdfkeywords
     }
     {\tl_set:cx {@##1}{\GetDocumentMetadata{hyp/##1}}}
+    % author, this is only a work around for simple author
+    % TODO needs improvement
+    \pdfstringdef\@pdfauthor{\GetDocumentMetadata{hyp/pdfauthor}}
+    \cs_set_eq:NN\hyxmp at pdfauthor\@pdfauthor
+    %lang
+    \tl_set:cx {@pdflang}{\GetDocumentMetadata{document/pdflang}}
   }
 \AtEndDocument{\__hyxmp_get_metadata:}
 \ExplSyntaxOff
+
 \DeclareHookRule{enddocument}{newhyperxmp}{before}{hyperxmp}
 
 
diff --git a/pdfmanagement-firstaid.dtx b/pdfmanagement-firstaid.dtx
index d4288ca..eaa5f97 100644
--- a/pdfmanagement-firstaid.dtx
+++ b/pdfmanagement-firstaid.dtx
@@ -62,7 +62,7 @@
   {experimental pdf-resource management / firstaid}
 
 %<@@=pdfmanagement>
-\clist_map_inline:nn {pgf,transparent}
+\clist_map_inline:nn {pgf,transparent,hyperxmp}
   {
     \bool_new:c       { g_@@_firstaid_#1_bool }
     \bool_gset_true:c { g_@@_firstaid_#1_bool }
@@ -188,6 +188,15 @@
  {
    \declare at file@substitution{transparent.sty}{transparent-ltx.sty}
  }
+%    \end{macrocode}
+% \subsection{hyperxmp}
+% We replace it by a new version. It doesn't cover everything
+% But allows at least some testing
+%    \begin{macrocode}
+\bool_if:NT \g_@@_firstaid_hyperxmp_bool
+ {
+   \declare at file@substitution{hyperxmp.sty}{new-hyperxmp.sty}
+ }
 %</package>
 %    \end{macrocode}
 % \subsection{\pkg{colorspace}}
diff --git a/testfiles-noxetex/metadata.pvt b/testfiles-noxetex/metadata.pvt
index 284515d..737235d 100644
--- a/testfiles-noxetex/metadata.pvt
+++ b/testfiles-noxetex/metadata.pvt
@@ -1,10 +1,11 @@
-\input{regression-test}
-\PassOptionsToPackage{debug}{pdfmanagement}
+\PassOptionsToPackage{enable-debug,check-declarations}{expl3}
 \RequirePackage{pdfmanagement}
-\DeclareDocumentMetadata { }
+\DeclareDocumentMetadata {  }
+\RequirePackage{pdfmanagement-regressiontest}
+
 \documentclass{article}
 
-\usepackage{hyperxmp,lipsum}
+\usepackage{hyperxmp,kantlipsum}
 
 \usepackage[]
    {hyperref}
@@ -18,15 +19,6 @@
    }
 
 
-\ExplSyntaxOn
-\pdf_object_new:nn{metadata-obj}{stream}
-\pdfmanagement_add:nnx {Catalog} {Metadata}{\pdf_object_ref:n{metadata-obj}}
-\ExplSyntaxOff
-
- \begin{document}
- blblb \lipsum
- \ExplSyntaxOn\makeatletter
- \hyxmp at construct@packet
- \exp_args:Nnx\pdf_object_write:nn{metadata-obj}{{/Type~/Metadata~/Subtype~/XML}{\hyxmp at xml}}%
-\ExplSyntaxOff
+\begin{document}
+ blblb \kant
 \end{document}





More information about the latex3-commits mailing list.