[latex3-commits] [git/LaTeX3-latex3-pdfresources] develop, main: remove hyperxmp patch (e9d93bb)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon Sep 26 17:29:31 CEST 2022


Repository : https://github.com/latex3/pdfresources
On branches: develop,main
Link       : https://github.com/latex3/pdfresources/commit/e9d93bb37b50e96bc434d0ec2c2d679e3ee04136

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

commit e9d93bb37b50e96bc434d0ec2c2d679e3ee04136
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Sep 26 17:29:31 2022 +0200

    remove hyperxmp patch


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

e9d93bb37b50e96bc434d0ec2c2d679e3ee04136
 build.lua                             |   2 -
 firstaid/hyperxmp-patches-tmp-ltx.sty | 185 ----------------------------------
 hyperref-generic.dtx                  |  12 +--
 pdfmanagement-firstaid.dtx            |  17 +---
 pdfmanagement-testphase.dtx           |  21 ++--
 5 files changed, 19 insertions(+), 218 deletions(-)

diff --git a/build.lua b/build.lua
index 10b160b..49e9923 100644
--- a/build.lua
+++ b/build.lua
@@ -15,7 +15,6 @@ if options["target"] == "ctan" then
   sourcefiles =  {"*.dtx","*.ins",
                 "l3ref-tmp.sty",
                 "firstaid/transparent-ltx.sty",
-                "firstaid/hyperxmp-patches-tmp-ltx.sty",
                 "firstaid/pdflscape-ltx.sty",
                 "firstaid/xcolor-patches-tmp-ltx.sty",
                 "firstaid/color-ltx.sty",
@@ -28,7 +27,6 @@ else
  sourcefiles =  {"*.dtx","*.ins",
                 "l3ref-tmp.sty",
                 "firstaid/transparent-ltx.sty",
-                "firstaid/hyperxmp-patches-tmp-ltx.sty",
                 "firstaid/pdflscape-ltx.sty",
                 "firstaid/xcolor-patches-tmp-ltx.sty",
                 "firstaid/color-ltx.sty",
diff --git a/firstaid/hyperxmp-patches-tmp-ltx.sty b/firstaid/hyperxmp-patches-tmp-ltx.sty
deleted file mode 100644
index 88c8d8f..0000000
--- a/firstaid/hyperxmp-patches-tmp-ltx.sty
+++ /dev/null
@@ -1,185 +0,0 @@
-%% This is file `hyperxmp-patches-tmp-ltx.sty"
-% Copyright (C) 2019-2021 The LaTeX Project
-%
-% It may be distributed and/or modified under the conditions of the
-% LaTeX Project Public License (LPPL), either version 1.3c of this
-% license or (at your option) any later version.  The latest version
-% of this license is in the file
-%
-%    https://www.latex-project.org/lppl.txt
-%
-% This file is part of the "pdfmanagement bundle" (The Work in LPPL)
-% and all files in that bundle must be distributed together.
-%
-% -----------------------------------------------------------------------
-%
-% The development version of the bundle can be found at
-%
-%    https://github.com/latex3/pdfresources
-%
-% for those people who are interested.
-\NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\ProvidesExplPackage{hyperxmp-patches-tmp-ltx}{2022-09-23}{0.95s}
-  {Store hyperref metadata in XMP format / temporay patches to test pdfresource management ... UF}
-
-\cs_if_exist:NT \pdfmanagement_add:nnn
-  {
-    \pdfmanagement_if_active:T
-     {
-       \renewcommand\hyxmp at embed@packet{\hyxmp at embed@packet at generic}
-     }
-  }
-
-%
-\newcommand*{\hyxmp at embed@packet at generic}
- {%
-   \typeout{}
-   \typeout{!!~new-hyperxmp--generic~packet~command~used!!}{}
-   \typeout{}
-   \hyxmp at construct@packet
-   %or some other command to write a object:
-   \exp_args:Nx
-    \__pdf_backend_metadata_stream:n {\hyxmp at xml}
-    %\pdf_object_unnamed_write:nn{stream}{{/Type~/Metadata~/Subtype~/XML}}%
-    % reference in the Catalog:
-    \pdfmanagement_add:nnx {Catalog} {Metadata}{\pdf_object_ref_last:}
- }
-
-% A standard should be retrieved from the document settings.
-\cs_new:Npn \__hypxmp_get_Astandard:
- {
-   \exp_args:Ne \tl_if_eq:nnT{\pdfmeta_standard_item:n{type}}{A}
-    {
-      \Hy at pdfatrue
-      \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}}
-    \int_compare:nNnT{\pdfmeta_standard_item:n{level}}>{3}
-     { \exp_args:Nnx\hyxmp at add@simple{pdfaid:rev}{\pdfmeta_standard_item:n{year}} }
-  \fi
-}
-
-\cs_new_protected:Npn \__hyxmp_get_metadata:
- {
-   \__hypxmp_get_Astandard:
-   \clist_map_inline:nn
-    {
-      % hyperxmp keys:
-      ,pdfcopyright
-      ,pdftype
-      ,pdflicenseurl
-      ,pdfauthortitle
-      ,pdfcaptionwriter
-      ,pdfmetalang
-      %,pdfapart %document
-      %,pdfaconformance %document
-      ,pdfuapart %probably document too but later ...
-      ,pdfxstandard
-      ,pdfsource
-      ,pdfdocumentid
-      ,pdfinstanceid
-      ,pdfversionid
-      ,pdfrendition
-      ,pdfpublication
-      ,pdfpubtype
-      ,pdfbytes
-      ,pdfnumpages
-      ,pdfissn
-      ,pdfeissn
-      ,pdfisbn
-      ,pdfbookedition
-      ,pdfpublisher
-      ,pdfvolumenum
-      ,pdfissuenum
-      ,pdfpagerange
-      ,pdfdoi
-      ,pdfurl
-      ,pdfidentifier
-      ,pdfsubtitle
-      ,pdfpubstatus
-      ,pdfcontactaddress
-      ,pdfcontactcity
-      ,pdfcontactregion
-      ,pdfcontactpostcode
-      ,pdfcontactcountry
-      ,pdfcontactphone
-      ,pdfcontactemail
-      ,pdfcontacturl
-      ,pdfdate
-    %hyperref, needs probably special handling
-   %   ,pdftitle   %see below
-   %   ,pdfsubject %see below
-      ,pdfkeywords
-      ,pdfproducer
-    }
-    {
-     \tl_if_exist:cF{@##1}{\tl_new:c{@##1}}
-     \tl_set:cx {@##1}{\GetDocumentProperties{hyperref/##1}}
-    }
-
-    % pdfauthor, this is only a work around for simple author
-    % TODO needs improvement
-    \exp_args:NNe
-    \pdfstringdef\@pdfauthor{\GetDocumentProperties{hyperref/pdfauthor}}
-    \cs_set_eq:NN\hyxmp at pdfauthor\@pdfauthor
-    \exp_args:NNe
-    \pdfstringdef\@pdfsubject{\GetDocumentProperties{hyperref/pdfsubject}}
-    \cs_set_eq:NN\hyxmp at pdfsubject\@pdfsubject
-    \exp_args:NNe
-    \pdfstringdef\@pdftitle{\GetDocumentProperties{hyperref/pdftitle}}
-    \cs_set_eq:NN\hyxmp at pdftitle\@pdftitle
-    \exp_args:NNe
-    \pdfstringdef\@pdfcopyright{\GetDocumentProperties{hyperref/pdfcopyright}}
-    \cs_set_eq:NN\hyxmp at pdfcopyright\@pdfcopyright
-    % pdflang,
-    \tl_if_exist:cF{@pdflang}{\tl_new:c{@pdflang}}
-    \tl_set:cx {@pdflang}{\GetDocumentProperties{document/lang}}
-  }
-
-% we need to provide a few commands so that hyperxmp stops to overwrite them
-% in \AtEndPreamble
-% we need also add it to the document properties to avoid stray commas
-% with empty author.
-\AddToHook{begindocument/before}[pdfmanagement/firstaid/hyperxmp]{%
- \def\@pdfauthor{Author}\def\@pdftitle {Title}%
- \tl_if_blank:eT{\GetDocumentProperties{hyperref/pdfauthor}}
-  {\AddToDocumentProperties[hyperref]{pdfauthor}{Author}}
- \tl_if_blank:eT{\GetDocumentProperties{hyperref/pdftitle}}
-  {\AddToDocumentProperties[hyperref]{pdfauthor}{Title}}
- }
-
-% hyperxmp recalculates pdfproduce at begin document and we should copy that definition
-\AddToHook{begindocument/end}
- {\edef\next{\noexpand\AddToDocumentProperties[hyperref]{pdfproducer}{\@pdfproducer}}\next}
-
-\DeclareHookRule{begindocument/before}{pdfmanagement/firstaid/hyperxmp}{before}{hyperxmp}
-
-% hyperxmp puts the code into enddocument, but for xetex this is too late.
-% so we move that to shipout/lastpage and add our command before.
-% the luatex code must stay in enddocument as hyperxmp tries to detect the pdf size
-% there.
-\sys_if_output_dvi:TF
-  {
-    \RemoveFromHook{enddocument}[hyperxmp]
-    \AddToHook{shipout/lastpage}[pdfmanagement-firstaid]
-      {
-        \__hyxmp_get_metadata:
-        \hyxmp at auto@assign at data
-        \hyxmp at check@standards
-        \hyxmp at warn@if at no@metadata
-        \hyxmp at embed@packet
-       }
-   }
-   {
-     \AddToHook{enddocument}[pdfmanagement-firstaid]{\__hyxmp_get_metadata:}
-     \DeclareHookRule{enddocument}{pdfmanagement-firstaid}{before}{hyperxmp}
-   }
-
-
-\endinput
diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index 1418540..449abdd 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -165,8 +165,9 @@
 %
 %  \enquote{Metadata}, informations about the document, are stored in a PDF in two
 %  places: The |/Info| dictionary and the XMP-metadata. \pkg{hyperref} only handles the
-%  |/Info| dictionary. The XMP-metadata can be added with like \pkg{pdfx} and
-%  \pkg{hyperxmp}.
+%  |/Info| dictionary. The XMP-metadata  are added by code from \pkg{l3pdfmeta}.
+%  (without the pdfmanagement the XMP-metadata can be added with packages like \pkg{pdfx} and
+%  \pkg{hyperxmp}).
 %
 %  The |/Info| dictionary can be filled with arbitrary keys, but the PDF viewer typically
 %  care only about a few, like |/Author|, |/Title| and |/Keywords|.
@@ -233,9 +234,6 @@
 %  \pkg{hyperref} has a few keys to set dates. They typically expect the date
 %  in \enquote{PDF} format: |D:YYYYMMDDhhmmss+01'00'|.
 %
-%  One should be aware that \pkg{hyperxmp} will sometimes
-%  overwrites such settings.
-%  ^^A XMP: yyyy-mm-ddThh:mm:ss+tt:tt, PDF: D:YYYYMMDDhhmmss+01'00'
 %
 %  \section{PDF page size (mediabox)}
 %  The standard \pkg{hyperref} driver contain code to set the PDF page size.
@@ -3833,7 +3831,7 @@
 %
 % \subsubsection{\enquote{info keys}}
 % \begin{hypkey}{pdfauthor,pdftitle,pdfcreator,pdfsubject,pdfproducer,pdfkeywords}
-% The keys store their value also in the metadate container, so that hyperxmp can
+% The keys store their value also in the metadata container, so that hyperxmp can
 % use them. Creator and Producer can't be removed with the pdfmanagement,
 % but we allow to set an empty value.
 % If the value begin with an optional argument, we assume a multilanguage clist and
@@ -4024,7 +4022,7 @@
 %
 % \subsection{hyperxmp keys}
 % hyperxmp defines lots of keys for \cs{hypersetup}.
-% They now longer work with this driver. So we provide them,
+% They now longer work with this driver. So we provide most of them,
 % but they are only stored as metadata:
 %    \begin{macrocode}
 \clist_map_inline:nn
diff --git a/pdfmanagement-firstaid.dtx b/pdfmanagement-firstaid.dtx
index f71fb91..7380d12 100644
--- a/pdfmanagement-firstaid.dtx
+++ b/pdfmanagement-firstaid.dtx
@@ -63,11 +63,11 @@
 % |debug={firstaidoff={name1,name2,...},...}|.
 %    \begin{macrocode}
 %<*package>
-\ProvidesExplPackage{pdfmanagement-firstaid}{2022-09-23}{0.95s}
+\ProvidesExplPackage{pdfmanagement-firstaid}{2022-09-26}{0.95s}
   {LaTeX PDF management testphase bundle / firstaid-patches}
 
 %<@@=pdfmanagement>
-\clist_map_inline:nn {pgf,transparent,hyperxmp,xmp,pdflscape,xcolor,color,beamer,output,colorspace,fontspec}
+\clist_map_inline:nn {pgf,transparent,xmp,pdflscape,xcolor,color,beamer,output,colorspace,fontspec}
   {
     \bool_new:c       { g_@@_firstaid_#1_bool }
     \bool_gset_true:c { g_@@_firstaid_#1_bool }
@@ -311,18 +311,7 @@
    \declare at file@substitution{pdflscape.sty}{pdflscape-ltx.sty}
  }
 %    \end{macrocode}
-% \subsection{hyperxmp}
-% We add some code at the end of hyperxmp.sty.
-%    \begin{macrocode}
-\bool_if:NT \g_@@_firstaid_hyperxmp_bool
- {
-    \AddToHook
-      {
-       file/hyperxmp.sty/after
-      }
-      {\RequirePackage{hyperxmp-patches-tmp-ltx}}
- }
-%    \end{macrocode}
+%
 % \subsection{xmp}
 % This handles the new xmp code.
 %    \begin{macrocode}
diff --git a/pdfmanagement-testphase.dtx b/pdfmanagement-testphase.dtx
index eb8abe2..dda66bd 100644
--- a/pdfmanagement-testphase.dtx
+++ b/pdfmanagement-testphase.dtx
@@ -325,20 +325,21 @@
 % see the documentation of \pkg{l3pdfmeta}.
 %
 % \subsection{hyperxmp}
-% \pkg{hyperxmp} uses \cs{pdfcatalog} to insert the \texttt{/MetaData} reference. This
-% makes it incompatible, but adjusting this is even possible with external
-% patches. \pkg{hyperxmp} also relies on some \pkg{hyperref} internals, so
-% changes in \pkg{hyperref} must be coordinated.
+% \pkg{hyperxmp} uses \cs{pdfcatalog} to insert the \texttt{/MetaData} reference
+% and also relies on some \pkg{hyperref} internals which are not present in the new
+% generic driver used by \pkg{hyperref} when the pdfmanagement is active.
+% This makes \pkg{hyperxmp} incompatible.
 %
-% Some patch code is provided by the bundle and loaded automatically,
-% but it is not complete currently. Failures are e.g. possible with complicated
-% author or title settings. The handling of dates isn't correct either yet.
-% The patch code can be disabled by using |debug={firstaidoff=hyperxmp}| in \cs{DocumentMetadata}
+% For some time some patch code was provided by the bundle to keep \pkg{hyperxmp}
+% working but starting with version  0.95s XMP-metadata are handled directly
+% by the \pkg{pdfmanagement-testphase} bundle (see the documentation of \pkg{l3pdfmeta})
+% and the patch code has been removed and the loading of
+% \pkg{hyperxmp} has been disabled.
 %
 % \subsection{tikz/pgf}
 % \pkg{pgf} writes to the page resources too and so is incompatible. The needed
 % changes are rather small and will be done in coordination with the maintainer.
-% Until this works, \pkg{pagemanagement} will load the patches automatically.
+% Until this works, \pkg{pdfmanagement-testphase} will load the patches automatically.
 % This can be disabled by using |debug={firstaidoff=pgf}| in \cs{DocumentMetadata}
 %
 % \subsection{transparent}
@@ -355,7 +356,7 @@
 % The package is incompatible. Some patches
 % have been added to \pkg{pdfmanagement-firstaid}.
 % Alternative code for spot colors is
-% in the \pkg{l3color} package which has now been add to \pkg{l3kernel}.
+% in the \pkg{l3color} package which has now been added to \pkg{l3kernel}.
 %
 % \subsection{embedfile, attachfile, attachfile2}
 % Tools needed to be able to write a replacement





More information about the latex3-commits mailing list.