[latex3-commits] [git/LaTeX3-latex3-pdfresources] testA4: hyperxmp patch: get standard with pdfmeta command, extend A schema with year (53f45e0)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu May 5 00:23:13 CEST 2022


Repository : https://github.com/latex3/pdfresources
On branch  : testA4
Link       : https://github.com/latex3/pdfresources/commit/53f45e0d7099d8d9e7027cb85383a69e58794d60

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

commit 53f45e0d7099d8d9e7027cb85383a69e58794d60
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu May 5 00:23:13 2022 +0200

    hyperxmp patch: get standard with pdfmeta command, extend A schema with year


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

53f45e0d7099d8d9e7027cb85383a69e58794d60
 firstaid/hyperxmp-patches-tmp-ltx.sty | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/firstaid/hyperxmp-patches-tmp-ltx.sty b/firstaid/hyperxmp-patches-tmp-ltx.sty
index 2572502..7175368 100644
--- a/firstaid/hyperxmp-patches-tmp-ltx.sty
+++ b/firstaid/hyperxmp-patches-tmp-ltx.sty
@@ -45,21 +45,27 @@
  }
 
 % A standard should be retrieved from the document settings.
-\cs_new:Npn \__hypxmp_get_Astandard:w #1-#2#3#4\q_stop
+\cs_new:Npn \__hypxmp_get_Astandard:
  {
-   \tl_if_eq:nnT{#1}{A}
+   \exp_args:Ne \tl_if_eq:nnT{\pdfmeta_standard_item:n{type}}{A}
     {
       \Hy at pdfatrue
-      \tl_set:Nn \@pdfapart{#2}
-      \tl_set:Nx \@pdfaconformance{#3}
-      \tl_if_eq:NnT \@pdfaconformance{Z}
-       { \tl_clear:N \@pdfaconformance }
+      \tl_set:Nx \@pdfapart{\pdfmeta_standard_item:n{level}}
+      \tl_set:Nx \@pdfaconformance{\pdfmeta_standard_item:n{conformance}}
     }
  }
+% A-4 will need also the year, so we have to extend the schema
+\renewcommand*{\hyxmp at pdfa@id at schema}{%
+  \ifHy at pdfa
+    \exp_args:Nnx\hyxmp at add@simple{pdfaid:part}{\pdfmeta_standard_item:n{level}}
+    \exp_args:Nnx\hyxmp at add@simple{pdfaid:conformance}{\pdfmeta_standard_item:n{conformance}}
+    \exp_args:Nnx\hyxmp at add@simple{pdfaid:rev}{\pdfmeta_standard_item:n{year}}
+  \fi
+}
+
 \cs_new_protected:Npn \__hyxmp_get_metadata:
  {
-  \exp_last_unbraced:Ne \__hypxmp_get_Astandard:w
-    {\GetDocumentProperties{document/pdfstandard}}Z-ZZZ\q_stop
+   \__hypxmp_get_Astandard:
    \clist_map_inline:nn
     {
       % hyperxmp keys:





More information about the latex3-commits mailing list.