[latex3-commits] [git/LaTeX3-latex3-pdfresources] splitting: test with hyperxmp (643c169)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Jul 8 10:50:26 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : splitting
Link       : https://github.com/latex3/pdfresources/commit/643c169ff34a09d9a8a3f22efc02e967d07e928d

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

commit 643c169ff34a09d9a8a3f22efc02e967d07e928d
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Jul 8 10:50:26 2020 +0200

    test with hyperxmp


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

643c169ff34a09d9a8a3f22efc02e967d07e928d
 .../newhyperxmp-test.tex                           | 24 ++++++++--------------
 newpackages/new-hyperxmp.sty                       | 22 ++++++++++++--------
 2 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/testfiles-noxetex/metadata.pvt b/experiments/newhyperxmp-test.tex
similarity index 50%
copy from testfiles-noxetex/metadata.pvt
copy to experiments/newhyperxmp-test.tex
index 5a067af..91d04a7 100644
--- a/testfiles-noxetex/metadata.pvt
+++ b/experiments/newhyperxmp-test.tex
@@ -1,10 +1,16 @@
-\input{regression-test}
+\RequirePackage{l3pdf}
+\ExplSyntaxOn
+\pdf_uncompress:
+\ExplSyntaxOff
+
+%\input{regression-test}
 \PassOptionsToPackage{debug}{pdfresources}
 \RequirePackage{pdfresources}
 \DeclareDocumentMetaData { }
 \documentclass{article}
 
-\usepackage{hyperxmp,lipsum}
+\usepackage{new-hyperxmp}
+\usepackage{lipsum}
 
 \usepackage[customdriver=hgeneric-experimental,
    ocgcolorlinks]
@@ -18,19 +24,7 @@
    pdfpagelayout=SinglePage
    }
 
-\makeatletter
-\makeatother
-\ExplSyntaxOn
-\pdf_object_new:nn{metadata-obj}{stream}
-\pdfcoredict_gput:nnx {Catalog} {Metadata}{\pdf_object_ref:n{metadata-obj}}
-\ExplSyntaxOff
 
  \begin{document}
- blblb \lipsum
- \ExplSyntaxOn\makeatletter
- \hyxmp at find@metadata
- \hyxmp at set@dc at lang
- \hyxmp at construct@packet
- \exp_args:Nnx\pdf_object_write:nn{metadata-obj}{{/Type~/Metadata~/Subtype~/XML}{\hyxmp at xml}}%
-\ExplSyntaxOff
+abc
 \end{document}
\ No newline at end of file
diff --git a/newpackages/new-hyperxmp.sty b/newpackages/new-hyperxmp.sty
index f6ed2d6..4f40bc7 100644
--- a/newpackages/new-hyperxmp.sty
+++ b/newpackages/new-hyperxmp.sty
@@ -25,12 +25,12 @@
     [2020/07/06 v5.4 Store hyperref metadata in XMP format / testing pdfresource management ...UF]
 \edef\hyxmp at dq@code{\the\catcode`\"}
 \catcode`\"=12
-\@ifundefined{AtEndDocument}{%
-  \RequirePackage{atenddvi}
-  \let\hyxmp at at@end=\AtEndDvi
-}{%
-  \let\hyxmp at at@end=\AtEndDocument
-}
+%\@ifundefined{AtEndDocument}{%
+%  \RequirePackage{atenddvi}
+%  \let\hyxmp at at@end=\AtEndDvi
+%}{%
+%  \let\hyxmp at at@end=\AtEndDocument
+%}
 \RequirePackage{kvoptions}
 \RequirePackage{pdfescape}
 \RequirePackage{stringenc}
@@ -377,6 +377,7 @@
     {}%
   }%
 }
+\DeclareHookRule{shipout/lastpage}{hyperxmp}{before}{pdf}
 \AtEndPreamble{%
   \@ifpackageloaded{hyperref}{%
     \@if at def@and at nonempty{@pdflang}{%
@@ -392,7 +393,9 @@
     }%
     \hyxmp at check@standards
     \hyxmp at no@info at lists
-    \hyxmp at at@end{%
+    \AddToHook{shipout/lastpage}[hyperxmp]
+    %\hyxmp at at@end
+     {%
       \hyxmp at find@metadata
       \hyxmp at embed@packet
     }%
@@ -405,7 +408,7 @@
       disabled}%
   }%
 }
-\hyxmp at at@end{%
+\AddToHook{shipout/lastpage}[hyperxmp]{%
   \hyxmp at set@dc at lang
   \ifx\@pdfmetalang\@empty
     \ifx\@pdflang\@empty
@@ -1982,9 +1985,10 @@ __</rdf:RDF>^^J%
 % uncompressed stream??
 \newcommand*{\hyxmp at embed@packet at generic}
  {%
+   \hyxmp at construct@packet
    \exp_args:Nnx
     \pdf_object_now:nn{stream}{{/Type~/Metadata~/Subtype~/XML}{\hyxmp at xml}}%
-   \pdfcoredict_gput:nnx {Catalog} {Metadata}{\pdf_object_last:}
+    \pdfcoredict_gput:nnx {Catalog} {Metadata}{\pdf_object_last:}
  }
 \ExplSyntaxOff
 





More information about the latex3-commits mailing list.