texlive[61599] Master/texmf-dist: pdfmanagement-testphase (13jan22)

commits+karl at tug.org commits+karl at tug.org
Thu Jan 13 22:05:04 CET 2022


Revision: 61599
          http://tug.org/svn/texlive?view=revision&revision=61599
Author:   karl
Date:     2022-01-13 22:05:04 +0100 (Thu, 13 Jan 2022)
Log Message:
-----------
pdfmanagement-testphase (13jan22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/CHANGELOG.md
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/hyperref-generic.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3backend-testphase.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfannot.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfdict.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-action.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-checkbox.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-choice.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-pushbutton.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-radiobutton.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-textfield.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffile.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmanagement.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmeta.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdftools.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfxform.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/ltdocinit.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/output-patches-tmp-ltx.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-firstaid.pdf
    trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-testphase.pdf
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/output-patches-tmp-ltx.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx
    trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/output-patches-tmp-ltx.sty
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/CHANGELOG.md	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/CHANGELOG.md	2022-01-13 21:05:04 UTC (rev 61599)
@@ -5,6 +5,33 @@
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 this project uses date-based 'snapshot' version identifiers.
 
+## [Unreleased] 
+
+## [2022-01-13]
+### Changed
+ - the keys `firstaidoff` and `pdfmanagement` should now be set with the `debug` key.
+  - `testphase` will now load files from the latex-lab bundle. This requires a current 
+    latex-dev: LaTeX2e <2022-06-01> pre-release-1.  
+ -  new values for `testphase`: `phase-I` and `phase-II`. 
+    `phase-I` will loaded tagpdf and activate tagging and interword spaces, `phase-II will
+    additionally activate paratagging. The value `tagpdf` for the `testphase` 
+    key has been deprecated. It will not error for some time and has been aliased to 
+    `phase-II`, but it is recommended to use the new values `phase-I` and `phase-II` instead.     
+ - renamed `\DeclareDocumentMetadata` to `\DocumentMetadata` (the older version is still provided)
+   to follow the development in latex-dev.
+ 
+### Fixed
+
+ - adapted the file hooks to the changes in LaTeX
+ - small bugs
+
+### Removed
+
+ - the `activate` key has been removed, its function is integrated in the testphase key. 
+
+### Added 
+ - preliminary support for structure destination to prepare for binary changes in texlive 2022
+ 
 ## [2021-08-28]
 ### Changed
  - colorscheme 'original' has been renamed to 'primary-colors'

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md	2022-01-13 21:05:04 UTC (rev 61599)
@@ -1,6 +1,6 @@
 # LaTeX PDF management testphase bundle
 
-Version: 0.95i, 2021-08-28
+Version: 0.95j, 2022-01-13
 
 This package is used during a test phase to load the new PDF management code
 of LaTeX.
@@ -31,7 +31,7 @@
 
 
 ## Copyright (C)
-* 2021 The LaTeX Project
+* 2021-2022 The LaTeX Project
 
 ## License
 LaTeX Project Public License, version 1.3c or later.

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/hyperref-generic.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3backend-testphase.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfannot.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfdict.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-action.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-checkbox.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-choice.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-pushbutton.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-radiobutton.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield-textfield.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffile.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmanagement.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmeta.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdftools.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfxform.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/ltdocinit.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/output-patches-tmp-ltx.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-firstaid.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-testphase.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: hyperref-generic.dtx
 %
-% Copyright (C) 2021 The LaTeX Project
+% Copyright (C) 2021-2022 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
@@ -26,7 +26,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -86,7 +86,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -104,7 +104,7 @@
 % should start like this
 % \begin{verbatim}
 % \RequirePackage{pdfmanagement-testphase} %loads the code
-% \DeclareDocumentMetadata % activates it
+% \DocumentMetadata % activates it
 %   {
 %    %% options
 %    %% e.g. pdf version, backend:
@@ -113,6 +113,18 @@
 %   }
 %  \end{verbatim}
 %
+%  Starting with \LaTeX-2022-06-01 (or a suitable latex-dev) loading the testphase
+%  package is no longer required and this can be simplified to
+% \begin{verbatim}
+% \DocumentMetadata
+%   {
+%    %% options
+%    %% e.g. pdf version, backend:
+%    % pdfversion=1.7,
+%    % backend = dvipdfmx
+%   }
+%  \end{verbatim}
+
 %  The new driver tries to be compatible with the standard \pkg{hyperref} drivers
 %  but there are nevertheless differences. Some of them due to the still experimental
 %  status of the driver, others are design decisions: one part of the project is
@@ -201,10 +213,9 @@
 %  If the key hasn't be set, the result is empty. This gives external
 %  packages a public and reliable access to the data.
 %
-%  \item |pdflang| is deprecated. Instead \cs{DeclareDocumentMetadata}
-%  should be used:
+%  \item |pdflang| is deprecated. Instead \cs{DocumentMetadata} should be used:
 %  \begin{verbatim}
-%  \DeclareDocumentMetadata{lang=de-DE}
+%  \cs{DocumentMetadata}{lang=de-DE}
 %  \end{verbatim}
 %
 %  The value can be retrieved as |document/lang|.
@@ -626,7 +637,7 @@
 %  \section{Dropped options}
 %  A number of options are ignored by this driver
 %  \begin{description}
-%  \item[pdfversion] The pdfversion should be set in \cs{DeclareDocumentMetadata}
+%  \item[pdfversion] The pdfversion should be set in \cs{DocumentMetadata}
 %  \item[setpagesize] The key is ignored and the PDF page size is not
 %  set. Load \pkg{color} or \pkg{graphicx} or use a class which sets the PDF page size.
 %  \item[breaklinks] The option does nothing sensible anyway (apart from triggering
@@ -636,9 +647,9 @@
 %  \item[pdfa] If this option is set to true \pkg{hyperref} normally checks and sets
 %  a small number of requirements for the PDF standard PDF/A.
 %  The key is ignored with this driver. Instead the wanted standard should be declared
-%  in \cs{DeclareDocumentMetadata}:
+%  in \cs{DocumentMetadata}:
 %  \begin{verbatim}
-%  \DeclareDocumentMetadata{pdfstandard=A-2b}
+%  \DocumentMetadata{pdfstandard=A-2b}
 %  \end{verbatim}
 %  Currently |A-1b|, |A-2b|, |A-3b| can be set.
 %  The support for various requirements is still incomplete, but the parts that
@@ -882,7 +893,7 @@
 % the setting is global (and has to be done in the preamble).
 %
 % \DescribeHypkey{pdflang} The key will work, but it is recommended to the set
-% the language in \cs{DeclareDocumentMetadata} instead.
+% the language in \cs{DocumentMetadata} instead.
 %^^A %% This is an adapted version of hluatex.def
 %^^A %% meant to test the use of the commands
 %^^A %% from pdfmanagement.sty
@@ -951,7 +962,7 @@
 %<@@=hyp>
 %    \end{macrocode}
 %    \begin{macrocode}
-\ProvidesFile{hgeneric-testphase.def}[2021-08-28 v0.95i %
+\ProvidesFile{hgeneric-testphase.def}[2022-01-13 v0.95j %
   generic Hyperref driver for the LaTeX PDF management testphase bundle]
 
 \RequirePackage{etoolbox} %why?
@@ -971,18 +982,32 @@
 %    \end{macrocode}
 % At first a message for the testing of the resource management
 %    \begin{macrocode}
-\msg_new:nnnn
-  { hyp }
-  { missing-resource-management }
-  { The~PDF~resource~management~is~required~for~this~hyperref~driver! }
+\cs_if_exist:NTF \DocumentMetadata
   {
-     Activate~it~with \\
-     \tl_to_str:n{\RequirePackage{pdfmanagement-testphase}}\\
-     \tl_to_str:n{\DeclareDocumentMetadata{<options>}}\\
-     before~\tl_to_str:n{\documentclass}
+   \msg_new:nnnn
+      { hyp }
+      { missing-resource-management }
+      { The~PDF~resource~management~is~required~for~this~hyperref~driver! }
+      {
+         Activate~it~with \\
+         \tl_to_str:n{\DocumentMetadata{<options>}}\\
+         before~\tl_to_str:n{\documentclass}
+      }
   }
+  {
+    \msg_new:nnnn
+      { hyp }
+      { missing-resource-management }
+      { The~PDF~resource~management~is~required~for~this~hyperref~driver! }
+      {
+         Activate~it~with \\
+         \tl_to_str:n{\RequirePackage{pdfmanagement-testphase}}\\
+         \tl_to_str:n{\DocumentMetadata{<options>}}\\
+         before~\tl_to_str:n{\documentclass}
+      }
+   }
 %    \end{macrocode}
-% The pdfversion should be set in \cs{DeclareDocumentMetadata}
+% The pdfversion should be set in \cs{DocumentMetadata}
 %    \begin{macrocode}
 \msg_new:nnnn
   { hyp }
@@ -989,13 +1014,13 @@
   { pdfversion-disabled }
   {
     This~hyperref~driver~ignores~the~pdfversion~key!\\
-    Set~the~pdfversion~in~\token_to_str:N \DeclareDocumentMetadata
+    Set~the~pdfversion~in~\token_to_str:N \DocumentMetadata
   }
   {
     For example:\\
     \tl_to_str:n
      {
-      \DeclareDocumentMetadata { pdfversion=1.7 }
+      \DocumentMetadata { pdfversion=1.7 }
      }
   }
 %    \end{macrocode}
@@ -1148,8 +1173,10 @@
 %\cs_set_protected:Npn \PDF at SetupDoc{}
 %\\PDF at FinishDoc{}% dummy needed for hyperref ...
 %    \end{macrocode}
+% \begin{function}{\hypercalcbp}
+%  We define a better (expandable) version of \cs{hypercalcbp}
+% \end{function}
 % \begin{macro}[EXP]{\hypercalcbp}
-% We define a better (expandable) version of \cs{hypercalcbp}
 %    \begin{macrocode}
 \cs_set_eq:NN \hypercalcbp \dim_to_decimal_in_bp:n
 %    \end{macrocode}
@@ -1163,7 +1190,7 @@
 \def\Hy at numberline#1{#1\c_space_tl}   %needed by bookmark
 %    \end{macrocode}
 %
-% The pdfversion should be set in \cs{DeclareDocumentMetadata} but we must
+% The pdfversion should be set in \cs{DocumentMetadata} but we must
 % copy it to the \pkg{hyperref} command:
 %    \begin{macrocode}
 \cs_set_eq:NN \Hy at pdfminorversion \pdf_version_minor:
@@ -1493,7 +1520,7 @@
 % TODO We overwrite the color key here for now, but this should be moved to bookmark
 %
 %    \begin{macrocode}
-\AddToHook { package / after / bookmark}
+\AddToHook { package/bookmark/after}
  {
    \define at key{BKM}{color}
      {

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -45,7 +45,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 %
@@ -56,27 +56,27 @@
 %    \begin{macrocode}
 %<drivers>\ProvidesExplFile
 %<*dvipdfmx>
-  {l3backend-testphase-dvipdfmx.def}{2021-08-28}{}
+  {l3backend-testphase-dvipdfmx.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx}
 %</dvipdfmx>
 %<*dvips>
-  {l3backend-testphase-dvips.def}{2021-08-28}{}
+  {l3backend-testphase-dvips.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvips}
 %</dvips>
 %<*dvisvgm>
-  {l3backend-testphase-dvisvgm.def}{2021-08-28}{}
+  {l3backend-testphase-dvisvgm.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm}
 %</dvisvgm>
 %<*luatex>
-  {l3backend-testphase-luatex.def}{2021-08-28}{}
+  {l3backend-testphase-luatex.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)}
 %</luatex>
 %<*pdftex>
-  {l3backend-testphase-pdftex.def}{2021-08-28}{}
+  {l3backend-testphase-pdftex.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)}
 %</pdftex>
 %<*xdvipdfmx>
-  {l3backend-testphase-xetex.def}{2021-08-28}{}
+  {l3backend-testphase-xetex.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX}
 %</xdvipdfmx>
 %    \end{macrocode}
@@ -1600,6 +1600,354 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \subsection{Structure Destinations}
+% Standard destinations consist of a reference to a page in the pdf and instructions
+% how to display it---typically they will put a specific location in the left top corner
+% of the viewer and so give the impression that a link jumped to the word in this place.
+% But in reality they are not connected to the content.
+%
+% Starting with pdf~2.0 destinations can in a tagged PDF also point to a structure, to a /StructElem object.
+% GoTo links can then additionally to the \texttt{/D} key pointing to a
+% page destination also point to such a structure destination with an \texttt{/SD} key.
+% Programs that e.g. convert such a PDF to html can then create better links.
+% (According to the reference, PDF-viewer should prefer the structure destination
+% over the page destination, but as far as it is known this isn't done yet.)
+%
+% Currently structure destinations and GoTo links making use of it could natively only
+% be created with the dvipdfmx backend. With pdftex and lualatex it was only possible to create
+% a restricted type which used only the \enquote{Fit} mode. Starting with
+% \TeX{}live 2022  (earlier in miktex) both engine will knew new keywords which allow
+% to create structure destination easily.
+%
+% The following backend code prepares the use of structure destinations. The general idea is
+% that if structure destinations are used, they should be used always. So we define
+% alternative commands which can be activated by mapping them to the standard backend commands.
+%
+% \begin{macro}{\l_pdf_current_structure_destination_tl}
+%
+% This commands holds the name of the structure object to use in the next command
+% which creates a destination. The code which activates structure destinations
+% must also ensure that it has a sensible, expandable content. \pkg{tagpdf} for example
+% will define it as
+% \begin{verbatim}
+% \tl_set:Nn \l_pdf_current_structure_destination_tl { __tag/struct/\g__tag_struct_stack_current_tl }
+% \end{verbatim}
+%    \begin{macrocode}
+%<*drivers>
+\tl_new:N   \l_pdf_current_structure_destination_tl
+%</drivers>
+%    \end{macrocode}
+% \end{macro}
+%
+% We will define alternatives for three backend commands:
+% \begin{verbatim}
+% \__pdf_backend_destination:nn       -> \__pdf_backend_structure_destination:nn
+% \__pdf_backend_destination:nnnn -> \__pdf_backend_structure_destination:nnnn
+% \__pdf_backend_link_begin_goto:nnw  -> \__pdf_backend_link_begin_structure_goto:nnw
+% \end{verbatim}
+%
+% Activating means mapping them onto the original commands. Be aware that not
+% all engines and compilation routes support structure destinations, for them
+% the command will be a no-op.
+%
+% \begin{macro}{\pdf_activate_structure_destination:}
+%    \begin{macrocode}
+%<*drivers>
+\cs_new_protected:Npn \pdf_activate_structure_destination:
+ {
+   \cs_gset_eq:NN \@@_backend_destination:nn \@@_backend_structure_destination:nn
+   \cs_gset_eq:NN \@@_backend_destination:nnnn \@@_backend_structure_destination:nnnn
+   \cs_gset_eq:NN \@@_backend_link_begin_goto:nnw  \@@_backend_link_begin_structure_goto:nnw
+ }
+%</drivers>
+%    \end{macrocode}
+% \end{macro}
+% Now the driver dependant parts.
+% By default the new commands are simply copies of the original commands.
+% We adapt them then for the engines and engine version which provide support
+% for structure destinations.
+%
+%    \begin{macrocode}
+%<*drivers>
+\cs_set_eq:NN \@@_backend_structure_destination:nn       \@@_backend_destination:nn
+\cs_set_eq:NN \@@_backend_structure_destination:nnnn \@@_backend_destination:nnnn
+\cs_set_eq:NN \@@_backend_link_begin_structure_goto:nnw  \@@_backend_link_begin_goto:nnw
+%</drivers>
+%    \end{macrocode}
+% \begin{macro}{\@@_backend_structure_destination:nn}
+% This command is the backend command to create a destination.
+% It should in parallel create also a structure destination.
+% At first xetex/dvipdfmx.
+% The structure destination is an array, so we use obj for it
+% so that we can reference it:
+%    \begin{macrocode}
+%<*xdvipdfmx|dvipdfmx>
+\cs_set_protected:Npn \@@_backend_structure_destination:nn #1#2
+  {
+    \@@_backend:x
+      {
+        dest ~ ( \exp_not:n {#1} )
+        [
+          @thispage
+          \str_case:nnF {#2}
+            {
+              { xyz }   { /XYZ ~ @xpos ~ @ypos ~ null }
+              { fit }   { /Fit }
+              { fitb }  { /FitB }
+              { fitbh } { /FitBH }
+              { fitbv } { /FitBV ~ @xpos }
+              { fith }  { /FitH ~ @ypos }
+              { fitv }  { /FitV ~ @xpos }
+              { fitr }  { /Fit }
+            }
+            { /XYZ ~ @xpos ~ @ypos ~ \fp_eval:n { (#2) / 100 } }
+        ]
+      }
+%    \end{macrocode}
+% We test if the structure object exist. The object of the structure destination
+% gets the name \texttt{@pdf.Sdest.\meta{destname}}, where \meta{destname} is the
+% name of the standard destination so that we can reference it in the GoTo links.
+%    \begin{macrocode}
+    \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+      {
+        \@@_backend:x
+         {
+          obj ~ @pdf.SDest.\exp_not:n{#1}
+          [
+            \exp_args:Ne \pdf_object_ref:n { \l_pdf_current_structure_destination_tl }
+            \str_case:nnF {#2}
+              {
+                { xyz }   { /XYZ ~ @xpos ~ @ypos ~ null }
+                { fit }   { /Fit }
+                { fitb }  { /FitB }
+                { fitbh } { /FitBH }
+                { fitbv } { /FitBV ~ @xpos }
+                { fith }  { /FitH ~ @ypos }
+                { fitv }  { /FitV ~ @xpos }
+                { fitr }  { /Fit }
+              }
+              { /XYZ ~ @xpos ~ @ypos ~ \fp_eval:n { (#2) / 100 } }
+          ]
+        }
+      }
+  }
+%    \end{macrocode}
+% The second destination command is for the boxed destination. Here we need to define
+% an new auxiliary command:
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_backend_structure_destination_aux:nnnn #1#2#3#4
+  {
+    \vbox_to_zero:n
+      {
+        \__kernel_kern:n {#4}
+        \hbox:n
+          {
+            \@@_backend:n { obj ~ @pdf_ #2 _llx ~ @xpos }
+            \@@_backend:n { obj ~ @pdf_ #2 _lly ~ @ypos }
+          }
+        \tex_vss:D
+      }
+    \__kernel_kern:n {#1}
+    \vbox_to_zero:n
+      {
+        \__kernel_kern:n { -#3 }
+        \hbox:n
+          {
+            \@@_backend:n
+              {
+                dest ~ (#2)
+                [
+                  @thispage
+                  /FitR ~
+                    @pdf_ #2 _llx ~ @pdf_ #2 _lly ~
+                    @xpos ~ @ypos
+                ]
+              }
+%    \end{macrocode}
+% Here we add the structure destination to the same box
+%    \begin{macrocode}
+            \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+              {
+                \@@_backend:x
+                  {
+                    obj ~ @pdf.SDest.\exp_not:n{#2}
+                    [
+                      \exp_args:Ne \pdf_object_ref:n { \l_pdf_current_structure_destination_tl }
+                      /FitR ~
+                        @pdf_ #2 _llx ~ @pdf_ #2 _lly ~
+                        @xpos ~ @ypos
+                    ]
+                  }
+              }
+          }
+        \tex_vss:D
+      }
+    \__kernel_kern:n { -#1 }
+  }
+%    \end{macrocode}
+% And now we redefine the destination command:
+%    \begin{macrocode}
+\cs_set_protected:Npn \@@_backend_structure_destination:nnnn #1#2#3#4
+  {
+    \exp_args:Ne \@@_backend_structure_destination_aux:nnnn
+      { \dim_eval:n {#2} } {#1} {#3} {#4}
+  }
+%    \end{macrocode}
+% At last the goto link.
+%    \begin{macrocode}
+\cs_set_protected:Npn \@@_backend_link_begin_structure_goto:nnw #1#2
+  {
+    \@@_backend_link_begin:n { #1 /Subtype /Link /A << /S /GoTo /D ( #2 ) /SD~@pdf.SDest.#2  >> }
+  }
+%</xdvipdfmx|dvipdfmx>
+%    \end{macrocode}
+% \end{macro}
+% Now pdftex. We only redefine for version 1.40 revision 24 or later.
+%    \begin{macrocode}
+%<*pdftex>
+\bool_lazy_and:nnT
+  { \int_compare_p:nNn {\tex_pdftexversion:D } > {139} }
+  { \int_compare_p:nNn {\tex_pdftexrevision:D } > {23} }
+  {
+    \cs_set_protected:Npn \@@_backend_structure_destination:nn #1#2
+      {
+        \tex_pdfdest:D
+           name {#1}
+           \str_case:nnF {#2}
+             {
+               { xyz }   { xyz }
+               { fit }   { fit }
+               { fitb }  { fitb }
+               { fitbh } { fitbh }
+               { fitbv } { fitbv }
+               { fith }  { fith }
+               { fitv }  { fitv }
+               { fitr }  { fitr }
+             }
+             { xyz ~ zoom \fp_eval:n { #2 * 10 } }
+           \scan_stop:
+        \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+          {
+            \tex_pdfdest:D
+               struct~
+               \int_use:c
+                 { c_@@_backend_object_ \exp_args:Ne \tl_to_str:n {\l_pdf_current_structure_destination_tl} _int }~
+               name {#1}
+               \str_case:nnF {#2}
+                 {
+                   { xyz }   { xyz }
+                   { fit }   { fit }
+                   { fitb }  { fitb }
+                   { fitbh } { fitbh }
+                   { fitbv } { fitbv }
+                   { fith }  { fith }
+                   { fitv }  { fitv }
+                   { fitr }  { fitr }
+                 }
+                 { xyz ~ zoom \fp_eval:n { #2 * 10 } }
+               \scan_stop:
+          }
+      }
+    \cs_set_protected:Npn \@@_backend_destination:nnnn #1#2#3#4
+      {
+       \tex_pdfdest:D
+        name {#1}
+        fitr ~
+        width  \dim_eval:n {#2} ~
+        height \dim_eval:n {#3} ~
+        depth  \dim_eval:n {#4} \scan_stop:
+       \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+         {
+           \tex_pdfdest:D
+             struct~
+             \int_use:c
+               { c_@@_backend_object_ \exp_args:Ne \tl_to_str:n {\l_pdf_current_structure_destination_tl} _int }~
+             name {#1}
+             fitr ~
+             width  \dim_eval:n {#2} ~
+             height \dim_eval:n {#3} ~
+             depth  \dim_eval:n {#4} \scan_stop:
+         }
+     }
+    \cs_set_protected:Npn \@@_backend_link_begin_structure_goto:nnw #1#2
+      {
+        \@@_backend_link_begin:nnnw {#1} { goto~struct~name~{#2}~name } {#2}
+      }
+  }
+%</pdftex>
+%    \end{macrocode}
+% luatex is quite similar to pdftex. Mostly the test for the version is different
+%    \begin{macrocode}
+%<*luatex>
+ \int_compare:nNnT {\directlua{tex.print(status.list()["development_id"])} } > {7468}
+  {
+    \cs_set_protected:Npn \@@_backend_structure_destination:nn #1#2
+      {
+        \tex_pdfextension:D dest
+           name {#1}
+           \str_case:nnF {#2}
+             {
+               { xyz }   { xyz }
+               { fit }   { fit }
+               { fitb }  { fitb }
+               { fitbh } { fitbh }
+               { fitbv } { fitbv }
+               { fith }  { fith }
+               { fitv }  { fitv }
+               { fitr }  { fitr }
+             }
+             { xyz ~ zoom \fp_eval:n { #2 * 10 } }
+           \scan_stop:
+        \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+          {
+            \tex_pdfextension:D dest
+               struct~
+               \int_use:c
+                 { c_@@_backend_object_ \exp_args:Ne \tl_to_str:n {\l_pdf_current_structure_destination_tl} _int }~
+               name {#1}
+               \str_case:nnF {#2}
+                 {
+                   { xyz }   { xyz }
+                   { fit }   { fit }
+                   { fitb }  { fitb }
+                   { fitbh } { fitbh }
+                   { fitbv } { fitbv }
+                   { fith }  { fith }
+                   { fitv }  { fitv }
+                   { fitr }  { fitr }
+                 }
+                 { xyz ~ zoom \fp_eval:n { #2 * 10 } }
+               \scan_stop:
+          }
+      }
+    \cs_set_protected:Npn \@@_backend_destination:nnnn #1#2#3#4
+      {
+       \tex_pdfextension:D dest
+        name {#1}
+        fitr ~
+        width  \dim_eval:n {#2} ~
+        height \dim_eval:n {#3} ~
+        depth  \dim_eval:n {#4} \scan_stop:
+       \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+         {
+           \tex_pdfextension:D dest
+             struct~
+             \int_use:c
+               { c_@@_backend_object_ \exp_args:Ne \tl_to_str:n {\l_pdf_current_structure_destination_tl} _int }~
+             name {#1}
+             fitr ~
+             width  \dim_eval:n {#2} ~
+             height \dim_eval:n {#3} ~
+             depth  \dim_eval:n {#4} \scan_stop:
+         }
+     }
+    \cs_set_protected:Npn \@@_backend_link_begin_structure_goto:nnw #1#2
+      {
+        \@@_backend_link_begin:nnnw {#1} { goto~struct~name~{#2}~name } {#2}
+      }
+  }
+%</luatex>
+%    \end{macrocode}
 % \subsection{lua code for lualatex}
 %    \begin{macrocode}
 %<*lua>

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfannot.dtx
 %
-% Copyright (C) 2021 The LaTeX Project
+% Copyright (C) 2021-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -52,7 +52,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -436,7 +436,7 @@
 %    \begin{macrocode}
 %<@@=pdfannot>
 %<*header>
-\ProvidesExplPackage{l3pdfannot}{2021-08-28}{0.95i}
+\ProvidesExplPackage{l3pdfannot}{2022-01-13}{0.95j}
   {PDF-annotations}
 \RequirePackage{l3pdfdict}
 %</header>

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfdict.dtx
 %
-% Copyright (C) 2018-2021 The LaTeX Project
+% Copyright (C) 2018-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -212,7 +212,7 @@
 %    \begin{macrocode}
 %<@@=pdfdict>
 %<*header>
-\ProvidesExplPackage{l3pdfdict}{2021-08-28}{0.95i}
+\ProvidesExplPackage{l3pdfdict}{2022-01-13}{0.95j}
   {Tools for PDF dictionaries (LaTeX PDF management testphase bundle)}
 %</header>
 %    \end{macrocode}
@@ -362,7 +362,7 @@
 % \end{macro}
 %
 %
-% \begin{macro}
+% \begin{macro}[pTF]
 %   {
 %     \@@_if_exist:n,  \pdfdict_if_exist:n,
 %   }
@@ -383,7 +383,7 @@
 % \end{macro}
 %
 %
-% \begin{macro}
+% \begin{macro}[pTF]
 %   {
 %     \@@_if_empty:n,  \pdfdict_if_empty:n,
 %   }

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfpdffield-action.dtx
 %
-% Copyright (C) 2021 The LaTeX Project
+% Copyright (C) 2021-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{}
+\DocumentMetadata{}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfpdffield-checkbox.dtx
 %
-% Copyright (C) 2021 The LaTeX Project
+% Copyright (C) 2021-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{}
+\DocumentMetadata{}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -68,7 +68,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfpdffield-choice.dtx
 %
-% Copyright (C) 2021 The LaTeX Project
+% Copyright (C) 2021-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{}
+\DocumentMetadata{}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfpdffield-pushbutton.dtx
 %
-% Copyright (C) 2021 The LaTeX Project
+% Copyright (C) 2021-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{}
+\DocumentMetadata{}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -59,7 +59,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfpdffield-radiobutton.dtx
 %
-% Copyright (C) 2021 The LaTeX Project
+% Copyright (C) 2021-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{}
+\DocumentMetadata{}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -87,7 +87,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfpdffield-textfield.dtx
 %
-% Copyright (C) 2021 The LaTeX Project
+% Copyright (C) 2021-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{}
+\DocumentMetadata{}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdffield.dtx
 %
-% Copyright (C) 2021 The LaTeX Project
+% Copyright (C) 2021-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{}
+\DocumentMetadata{}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -73,7 +73,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -139,7 +139,7 @@
 %
 % \begin{verbatim}
 % \RequirePackage{pdfmanagement-testphase}
-% \DeclareDocumentMetadata{uncompress}
+% \DocumentMetadata{uncompress}
 % \documentclass{article}
 % \usepackage{hyperref}
 % \usepackage{l3pdffield-testphase}
@@ -343,7 +343,7 @@
 % \Arg{key-val} can be an arbitrary collection of the keys of the module.
 % \end{function}
 %
-% \begin{function}{create-style}
+% \begin{function}{style}
 % \begin{syntax}
 %  |style| = \Arg{style}
 % \end{syntax}
@@ -463,7 +463,7 @@
 % The value is passed through \cs{pdf_string_from_unicode:nnN}
 % \end{function}
 %
-% \begin{function}{mappingname,TM}
+% \begin{function}{FT}
 %  \begin{syntax}
 %   |FT| = |Btn|\verb"|"|Tx|\verb"|"|Ch|\verb"|"|Sig|
 %  \end{syntax}
@@ -710,6 +710,13 @@
 % all values are zero.
 % \end{function}
 %
+% \begin{function}{tag}
+%  \begin{syntax}
+%   |tag| = |true|\verb+|+|false|
+%  \end{syntax}
+% This key is related to tagging and enables/disables the tagging.
+% \end{function}
+%
 % \begin{function}{parent}
 %  \begin{syntax}
 %   |parent| = \meta{field ID}\\
@@ -763,7 +770,7 @@
 %  \begin{syntax}
 %  |AA/*| = \meta{ECMAScript}
 %  \end{syntax}
-% * should be one of |F|, |Bl|, |D|, |U|, |E|, |X|, |PO|, |PC|, |PV|, |PI|.
+% * should be one of |Fo|, |Bl|, |D|, |U|, |E|, |X|, |PO|, |PC|, |PV|, |PI|.
 % Alias names for the first six keys are
 % |onfocus|, |onblur|, |onmousedown|, |onmouseup|, |onenter|,  |onexit|.
 % These keys adds then the respective key to the |/AA| dictionary
@@ -858,7 +865,7 @@
 % Currently no special syntax support
 % is implemented. They will be handled if needed when the code for
 % push buttons is developed and tested.
-% \begin{function}{MK/*}
+% \begin{function}{MK/I,MK/RI,MK/IX,MK/IF,MK/TP}
 %  \begin{syntax}
 %  |MK/*| = \meta{various}
 %  \end{syntax}
@@ -970,7 +977,7 @@
 %<*package>
 %<@@=pdffield>
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{l3pdffield-testphase}{2021-08-28}{0.95i}%
+\ProvidesExplPackage{l3pdffield-testphase}{2022-01-13}{0.95j}%
   {form fields}
 %    \end{macrocode}
 % \subsection{hyperref specific command}
@@ -1743,7 +1750,7 @@
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{tag}
-% to disable tagging locall
+% to disable tagging locally
 %    \begin{macrocode}
 \keys_define:nn { pdffield }
   {

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdffile.dtx
 %
-% Copyright (C) 2018-2021 The LaTeX Project
+% Copyright (C) 2018-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -400,7 +400,7 @@
 %
 %    \begin{macrocode}
 %<*header>
-\ProvidesExplPackage{l3pdffile}{2021-08-28}{0.95i}
+\ProvidesExplPackage{l3pdffile}{2022-01-13}{0.95j}
   {embedding and referencing files in PDF---LaTeX PDF management testphase bundle}
 \RequirePackage{l3pdftools}  %temporarly!!
 %</header>
@@ -467,8 +467,9 @@
 % \end{variable}
 %    \begin{macrocode}
 \prop_new:N \g_pdffile_mimetypes_prop
-\prop_set_from_keyval:Nn \g_pdffile_mimetypes_prop
+\prop_gset_from_keyval:Nn \g_pdffile_mimetypes_prop
   {
+    ,.css = text/css
     ,.csv = text/csv
     ,.html= text/html
     ,.dtx = text/plain %or application/x-tex, not in iana.org list

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfmanagement.dtx
 %
-% Copyright (C) 2018-2021 The LaTeX Project
+% Copyright (C) 2018-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -61,7 +61,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -622,7 +622,7 @@
 %<@@=pdfmanagement>
 %<*header>
 %
-\ProvidesExplPackage{l3pdfmanagement}{2021-08-28}{0.95i}
+\ProvidesExplPackage{l3pdfmanagement}{2022-01-13}{0.95j}
   {Management of core PDF dictionaries (LaTeX PDF management testphase bundle)}
 %</header>
 %    \end{macrocode}
@@ -674,7 +674,7 @@
 % \begin{variable}{\g_@@_active_bool}
 % This boolean will control the activation of the management code.
 % It is used in the hooks, and in some backend files.
-% % \cs{DeclareDocumentMetadata} should set it to true
+% % \cs{DocumentMetadata} should set it to true
 %    \begin{macrocode}
 \bool_new:N \g_@@_active_bool
 %    \end{macrocode}
@@ -1563,7 +1563,7 @@
  }
 %    \end{macrocode}
 % \end{macro}
-% \begin{macro}{ Handler}
+% \begin{macro}{ \@@_handler/Catalog/Names/EmbeddedFiles_gput:n }
 % EmbeddedFiles is an array and needs a special handler to add values.
 %    \begin{macrocode}
 \pdfdict_new:n { g__pdf_Core/Catalog/Names }

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfmeta.dtx
 %
-% Copyright (C) 2018-2021 The LaTeX Project
+% Copyright (C) 2018-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -192,7 +192,7 @@
 %  reference it in a /Outputintent and that all output intents reference
 %  the same colorprofile. The value stores the subtype.
 %  {\em This requirement is detected and fulfilled by \pkg{l3pdfmeta} if the
-%   provided interface in \cs{DeclareDocumentMetadata} is used, see below}.
+%   provided interface in \cs{DocumentMetadata} is used, see below}.
 %
 % \item[|annot_flags|] in annotations the |Print| flag should be true,
 %  |Hidden|, |Invisible|, |NoView| should be false.
@@ -235,7 +235,7 @@
 %  It should be checked against the current PDF version (\cs{pdf_version:}).
 %  A failure means that the version should be changed.
 %  This check is done by \pkg{l3pdfmeta} when the version is set with
-%  \cs{DeclareDocumentMetadata} so more checks are only needed if the version is changed later.
+%  \cs{DocumentMetadata} so more checks are only needed if the version is changed later.
 %
 % \item[|named_actions|]    this requirement restricts the list of
 % allowed named actions to |NextPage|, |PrevPage|, |FirstPage|, |LastPage|.
@@ -290,7 +290,7 @@
 % The interface looks like this
 %
 % \begin{verbatim}
-%  \DeclareDocumentMetadata
+%  \DocumentMetadata
 %    {
 %      %other options for example pdfstandard
 %       colorprofiles=
@@ -318,7 +318,7 @@
 % color profile, the setting is changed to the equivalent of
 %
 % \begin{verbatim}
-%  \DeclareDocumentMetadata
+%  \DocumentMetadata
 %    {
 %      %other options
 %       pdfstandard=A-2b,
@@ -345,7 +345,7 @@
 %    \begin{macrocode}
 %<@@=pdfmeta>
 %<*header>
-\ProvidesExplPackage{l3pdfmeta}{2021-08-28}{0.95i}
+\ProvidesExplPackage{l3pdfmeta}{2022-01-13}{0.95j}
   {PDF-Standards---LaTeX PDF management testphase bundle}
 %</header>
 %    \end{macrocode}
@@ -526,7 +526,7 @@
 %   }
 %     \begin{macrocode}
 \prop_new:c { g_@@_standard_pdf/A-1B_prop }
-\prop_set_from_keyval:cn { g_@@_standard_pdf/A-1B_prop }
+\prop_gset_from_keyval:cn { g_@@_standard_pdf/A-1B_prop }
   {
     ,name             = pdf/A-1B
     ,type             = A

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdftools.dtx
 %
-% Copyright (C) 2018-2021 The LaTeX Project
+% Copyright (C) 2018-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -215,7 +215,7 @@
 %
 %    \begin{macrocode}
 %<*header>
-\ProvidesExplPackage{l3pdftools}{2021-08-28}{0.95i}
+\ProvidesExplPackage{l3pdftools}{2022-01-13}{0.95j}
   {candidate commands for l3pdf---LaTeX PDF management testphase bundle}
 %</header>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: l3pdfxform.dtx
 %
-% Copyright (C) 2018-2021 The LaTeX Project
+% Copyright (C) 2018-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -52,7 +52,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -136,7 +136,7 @@
 %    \begin{macrocode}
 %<@@=pdf>
 %<*header>
-\ProvidesExplPackage{l3pdfxform}{2021-08-28}{0.95i}
+\ProvidesExplPackage{l3pdfxform}{2022-01-13}{0.95j}
   {command to create xforms (beta)---LaTeX PDF management testphase bundle}
 %</header>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: ltdocinit.dtx
 %
-% Copyright (C) 2018-2021 The LaTeX Project
+% Copyright (C) 2018-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -51,20 +51,25 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
 %
 % \section{\pkg{ltdocinit} documentation}
-% This small module defines \cs{DeclareDocumentMetadata} and the related keys.
+% This small module defines \cs{DocumentMetadata} and the older alias
+% \cs{DeclareDocumentMetadata} and the related keys.
 % It also defines commands to store document properties in a global container.
 %
-% \subsection{\cs{DeclareDocumentMetadata}}
+% When the kernel will provide \cs{DocumentMetadata} directly
+% this module will slowly disappear.
 %
-% \begin{function}{\DeclareDocumentMetadata}
+% \subsection{\cs{DocumentMetadata}/\cs{DeclareDocumentMetadata}}
+%
+% \begin{function}{\DocumentMetadata,\DeclareDocumentMetadata}
 % \begin{syntax}
-%  \cs{DeclareDocumentMetadata}\Arg{key-value list}
+%  \cs{DocumentMetadata}\Arg{key-value list}\\
+%  \cs{DeclareDocumentMetadata}\Arg{key-value list} (deprecated)
 % \end{syntax}
 % \end{function}
 %
@@ -75,65 +80,89 @@
 % for example the pdf version can no longer be changed if a
 % package has used code which already opened the PDF.
 %
-% \cs{DeclareDocumentMetadata} as a new command
+% \cs{DocumentMetadata} as a new command
 % should unify such settings in one place.
-% It should be used before \cs{documentclass}, directly after
-% loading \pkg{pdfmanagement-testphase}. \cs{DeclareDocumentMetadata}
-% can be used more than once.
+% It should be used before \cs{documentclass}.
+% \cs{DocumentMetadata} can be used more than once.
 %
-% The keys defined for \cs{DeclareDocumentMetadata}
+% With a \LaTeX{} 2022-06-01 or newer (currently provided as |latex-dev|) the command
+% is provided by the kernel and will load the pdfmanagement,
+% with older \LaTeX{} the pdfmanagement must be loaded
+% first manually with |\RequirePackage{pdfmanagement-testphase}|.
+%
+% The keys defined for \cs{DocumentMetadata}
 % currently allows to set the PDF version, to set the PDF \texttt{/Lang},
 % to uncompress a pdf, to set the language and to declare a few PDF standards
-% and some colorprofiles.
+% and to load some colorprofiles.
 %
-% \cs{DeclareDocumentMetadata} is also used to
+% \cs{DocumentMetadata} is also used to
 % activate the new PDF management code and it loads
 % a number of required files for the PDF management code.
 % As this forces the loading of the backend files, a backend
 % which can't be detected automatically like |dvipdfmx|,
-% must be set in the first \cs{DeclareDocumentMetadata}.
+% must be set in the first \cs{DocumentMetadata}.
 %
 % Currently the following keys are implemented
 %
 % \begin{description}
-%    \item[\texttt{backend}] passes the backend name to expl3.
-%    This will probably be extended to  pass the value also to packages.
-%    \item[\texttt{pdfversion}] e.g. \texttt{pdfversion=1.7}
-%    \item[\texttt{uncompress}] no value. Forces an uncompressed pdf.
-%    \item[\texttt{lang}] to set the Lang entry in the Catalog.
-%    E.g. \texttt{lang=de-DE}. The initial value is |en-US|
+%    \item[\texttt{backend}] Passes the backend name to expl3. This is
+%      needed only if the needed backend can't be automatically
+%      determined or if the workflow used requires a special backend.
+%
+%^^A    This will probably be extended to  pass the value also to
+%^^A      packages.
+%
+%    \item[\texttt{pdfversion}] Sets the PDF version explicitly, e.g., \texttt{pdfversion=1.7}
+%    \item[\texttt{uncompress}] (no value) Forces an uncompressed pdf
+%      --- mainly for debugging purposes.
+%
+%    \item[\texttt{lang}] Explicitly sets the Lang entry in the Catalog,
+%     e.g., \texttt{lang=de-DE}. If not given the default value used is |en-US|.
+%
 %    \item[\texttt{pdfstandard}] Choice key to set the pdf standard.
 %      Currently |A-1b|, |A-2a|, |A-2b|, |A-2u|, |A-3a|, |A-3b| and |A-3u| are accepted as
 %      values. The casing is irrelevant, |a-1b| works too.
 %      The underlying code to ensure the requirements (as far as they
-%      can be ensured) is incomplete, but a color profile is included and the
-%      /OutputIntent is set. The |u| variants for example do not force unicode,
+%      can be ensured) is still incomplete, but a color profile is included and the
+%      \texttt{/OutputIntent} is set. The |u| variants for example do not force unicode,
 %      but they will pass the information to hyperref and hyperxmp. The |a| variants
 %      do \emph{not} enforce (or even test) a tagged pdf yet.
 %      More information can be found in the documentation
 %      of \pkg{l3pdfmeta}.
+%
 %    \item[\texttt{colorprofiles}] This allows to load icc-colorprofiles. Details
-%    are described in the documentation of \pkg{l3pdfmeta}.
-%    \item[\texttt{pdfmanagement}] Boolean. This activates/deactivates
-%      the core management code. By default the value is true.
-%    \item[\texttt{firstaidoff}] This accepts a comma lists of keysword and disable the patches
-%    related to them. More information can be found in the documentation of
-%    \pkg{pdfmanagement-firstaid}.
+%       are described in the documentation of \pkg{l3pdfmeta}.
+%
 %    \item[\texttt{testphase}] This key is used to load testphase code. The values it accepts
 %    and their effect will change over time, when testphase packages are added or
-%    removed when the code is moved into the kernel. Currently the accepted values are
-%    \texttt{tagpdf}, this load the tagpdf package, \texttt{headings}, this loads
-%    code which reimplements heading commands, and \texttt{ptagging} this loads code
-%    to allow paragraph tagging to work with engine other than luatex.
-%    \item[\texttt{activate}] This key is used to enable some document wide functions. It is
-%    currently in an experimental state. The values and their behaviour are subject to change.
-%    Currently the only value is |tagging|,
-%    which will do |\tagpdfsetup{activate,paratagging,interwordspace}|. It requires that
-%    \pkg{tagpdf} has been loaded first with the |testphase| key.
-%    \item[\texttt{debug}] This key activates some debug options. Currently only the
-%    keys |para| (with the default and only value |show|),
-%    and |log| (with the values of \pkg{tagpdf}) and |uncompress| (which does the same
-%    as |uncompress| as main key)  are known.
+%    removed or when the code is moved into the kernel.
+%     \begin{description}
+%    \item[\texttt{phase-I}]
+%       This value loads code implementing the first phase of the project~\cite{blueprint}, i.e., it
+%       will load the tagpdf package. It will also activate tagging by issuing
+%       |\tagpdfsetup{activate,interwordspace}|. This phase
+%       is frozen.
+%    \item[\texttt{phase-II}]
+%       This is the current development phase.
+%       Currently it differs from \texttt{phase-I} only in one point: It will
+%       additionally activate tagging of paragraphs with
+%       |\tagpdfsetup{paratagging}|. In the upcoming months it will
+%       also enable automatic tagging of other basic document elements.
+%    \end{description}
+%    The |testphase| key can only be used in the first \cs{DocumentMetadata}.
+%
+%    \item[\texttt{debug}] This key activates some debug options. It takes a list of key-values
+%    as value. Currently the following keys are known:
+%     \begin{description}
+%     \item[\texttt{para}] with the default and only value |show|. It will activate the |paratagging-show|
+%       option of \pkg{tagpdf},
+%     \item[\texttt{log}]  with the values as described in the documentation \pkg{tagpdf},
+%     \item[\texttt{uncompress}] which does the same as |uncompress| as main key
+%     \item[\texttt{pdfmanagement}] a boolean which allows to deactivate the pdfmanagement.
+%     \item[\texttt{firstaidoff}] This accepts a comma lists of keywords and disables the patches
+%       related to them. More information can be found in the documentation of
+%       \pkg{pdfmanagement-firstaid}.
+%    \end{description}
 % \end{description}
 %
 % \subsection{Container for document properties}
@@ -151,7 +180,7 @@
 % \end{syntax}
 % This stores \meta{value} under the key \meta{label}/\meta{property}.
 % By default \meta{label} is the current package name |\@currname|. If another
-% label is choosen, it should be one which avoids clashes with other packages
+% label is chosen, it should be one which avoids clashes with other packages
 % using the container. The label |document| is reserved.
 % \end{function}
 %
@@ -174,91 +203,290 @@
 % This show the current content of the container.
 % \end{function}
 %
+% \begin{thebibliography}{9}
+%
+% \bibitem{blueprint} Frank Mittelbach and Chris Rowley:
+%   \emph{\LaTeX{} Tagged PDF\,---\,A blueprint for a large project}.
+%   \url{https://latex-project.org/publications/indexbyyear/2020/}
+%
+% \end{thebibliography}
+%
 % \end{documentation}
 %
 % \begin{implementation}
 %
 % \section{\pkg{ltdocinit} implementation}
-% \subsection{\cs{DeclareDocumentMetadata}}
 %    \begin{macrocode}
 %<@@=pdfmanagement>
 %<*header>
-\ProvidesExplPackage{ltdocinit}{2021-08-28}{0.95i}
+\ProvidesExplPackage{ltdocinit}{2022-01-13}{0.95j}
   {Initialize document metadata}
 %</header>
 %    \end{macrocode}
-% \cs{DeclareDocumentMetadata} should for now not be used after
-% \cs{documentclass} so we error in this case. It can be used more than once
-% but follow-up calls should not do the initialization code.
+% \cs{DocumentMetadata} will be defined by the kernel in short time.
+% So we define it and the keys here only if it is not already defined.
+%  \subsection{The keys for \cs{DocumentMetadata}}
+%  We define the keys first so that we can test if \cs{DocumentMetadata}
+%  exist (testing for the format date would be nice but would fail for the current
+%  latex-dev).
+%  \begin{variable}{\g_@@_firstaidoff_clist}
+%  A list to store the firstaid code which should be disabled
 %    \begin{macrocode}
 %<*package>
-\msg_new:nnn  { document } { setup-after-documentclass }
+\clist_new:N \g_@@_firstaidoff_clist
+%    \end{macrocode}
+% \end{variable}
+%  \begin{variable}{\g_@@_testphase_tl}
+%  a tl to store the testphase loading code so that we can load them at
+%  the end of the command.
+%    \begin{macrocode}
+\tl_new:N \g_@@_testphase_tl
+%    \end{macrocode}
+% \end{variable}
+%    \begin{macrocode}
+\cs_if_free:NT \DocumentMetadata
+  {
+    \keys_define:nn { document / metadata }
+      {
+        backend .choices:nn =
+          { dvipdfmx , dvips , dvisvgm , luatex , pdftex , pdfmode , xdvipdfmx , xetex }
+          {
+            \sys_load_backend:n {#1}
+          },
+        backend .groups:n = { init } ,
+      }
+
+    \keys_define:nn { document / metadata }
+      {
+        ,pdfversion .code:n =
+          {
+            \pdf_version_gset:n { #1 }
+            \AddToDocumentProperties[document]{pdfversion}{#1}
+          }
+        ,uncompress .code:n =
+          {
+            \pdf_uncompress:
+          }
+        ,uncompress .value_forbidden:n = true
+        ,lang .code:n =
+          {
+            \pdfmanagement_add:nnn {Catalog} {Lang}{(#1)}
+            \AddToDocumentProperties[document]{lang}{#1}
+          }
+        %,xmpmeta .bool_gset:N = \g_pdfmeta_xmp_bool %see pdfmeta unused and undefined for now!
+        % this uses internal command from pdfmeta, it should probably move there ...
+        ,pdfstandard .code:n =
+          {
+            \exp_args:Nnx
+            \keys_set:nn {document / metadata} {_pdfstandard=\str_uppercase:n{#1}}
+          }
+        ,_pdfstandard .choices:nn =
+          {A-1B,A-2A,A-2B,A-2U,A-3A,A-3B,A-3U}
+          {
+            \prop_if_exist:cT { g__pdfmeta_standard_pdf/#1_prop }
               {
-                \token_to_str:N \DeclareDocumentMetadata \c_space_tl
-                should~be~used~only~before~\token_to_str:N\documentclass
+                \prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/#1 _prop }
               }
+            \AddToDocumentProperties [document]{pdfstandard}{#1}
+          }
+        ,_pdfstandard / unknown .code:n =
+          {
+            \msg_warning:nnn{pdf}{unknown-standard}{#1}
+          }
+        ,testphase .multichoice:
+        ,testphase / tagpdf .code:n =
+          {
+            \tl_gput_right:Nn\g_@@_testphase_tl
+              {
+                \file_if_exist_input:nF {tagpdf-latex-lab-testphase.ltx}
+                  {
+                    \RequirePackage{tagpdf}
+                    \AddToDocumentProperties [document]{testphase/tagpdf}{loaded}
+                    \tagpdfsetup{activate,paratagging,interwordspace}
+                    \AddToDocumentProperties [document]{tagging}{active}
+                    \AddToDocumentProperties [document]{tagging/para}{active}
+                    \AddToDocumentProperties [document]{tagging/interwordspace}{active}
+                  }
+              }
+          }
+        ,testphase / unknown .code:n =
+          {
+            \tl_gput_right:Nn\g_@@_testphase_tl
+               {
+                 \file_if_exist_input:nF {#1-latex-lab-testphase.ltx}
+                  {
+                     \msg_warning:nnn{document}{latex-lab-pkg-missing}{#1}
+                  }
+               }
+          }
+        ,activate .multichoice:
+        ,activate / tagging .code:n =
+          {
+            \PackageWarning{pdfmanagement-testphase}
+             {The~activate~key~is~deprecated.\MessageBreak
+              Tagging~is~activated~with~'testphase=tagpdf'~directly}{}
+          }
+        ,debug .code:n =
+          {
+            \keys_set:nn { document / metadata / debug } {#1}
+          }
+        ,debug / para .code:n =
+          {
+            \AddToHook
+              {
+                package/tagpdf/after
+              }
+              {
+                 \tagpdfsetup{paratagging-show}
+              }
+          }
+        ,debug / log .code:n =
+          {
+            \AddToHook
+              {
+               package/tagpdf/after
+              }
+              {
+                 \tagpdfsetup{log=#1}
+              }
+          }
+        ,debug / uncompress .code:n =
+          {
+            \pdf_uncompress:
+          }
+        ,debug / pdfmanagement .bool_gset:N = \g_@@_active_bool
+        ,debug / firstaidoff .clist_gset:N = \g_@@_firstaidoff_clist
+      }
+   }
 %    \end{macrocode}
-% \begin{macro}{\DeclareDocumentMetadata}
+%
+% \subsection{\cs{DocumentMetadata}/\cs{DeclareDocumentMetadata}}
+% At first we have to define the older alias \cs{DeclareDocumentMetadata} if
+% \cs{DocumentMetadata} is already defined in a newer LaTeX version. Here
+% we load the latex-lab support (if it hasn't been loaded
+% before) and redefine then \cs{DeclareDocumentMetadata}
+% to \cs{DocumentMetadata}
+%
 %    \begin{macrocode}
-\NewDocumentCommand\DeclareDocumentMetadata { m }
+\cs_if_exist:NT \DocumentMetadata
+   {
+     \cs_new_protected:Npn \DeclareDocumentMetadata
+        {
+          \cs_if_free:NT \DocumentMetadata
+            {
+              \file_if_exist_input:nF {documentmetadata-support.ltx}%
+               {
+                 \@latex at error
+                   {No~support~files~for~\noexpand\DeclareDocumentMetadata~found}
+                   {
+                     Is~the~'LaTeX-lab'~bundle~installed?
+                     \MessageBreak
+                     Without~it,~the~declaration~is~ignored.
+                   }
+                \let\DeclareDocumentMetadata\@gobble
+               }
+            }
+          \RenewDocumentCommand \DeclareDocumentMetadata {}
+           { \DocumentMetadata }
+          \DocumentMetadata
+        }
+    }
+%    \end{macrocode}
+% Now we provide a definition for \cs{DocumentMetadata} if it doesn't exist yet.
+%    \begin{macrocode}
+\cs_if_free:NT \DocumentMetadata
   {
-    \cs_if_eq:NNTF \documentclass \@twoclasseserror
-      { \msg_error:nn { document }{ setup-after-documentclass } }
+%    \end{macrocode}
+% \cs{DocumentMetadata} should for now not be used after
+% \cs{documentclass} so we error in this case. It can be used more than once
+% but follow-up calls should not do the initialization code.
+%    \begin{macrocode}
+    \prop_gput:Nnn \g_msg_module_type_prop { document } { LaTeX }
+    \prop_gput:Nnn \g_msg_module_name_prop { document } { DocumentMetadata }
+    \msg_new:nnn
+      { document } { setup-after-documentclass }
       {
+        \token_to_str:N \DocumentMetadata \c_space_tl
+        should~be~used~only~before~\token_to_str:N\documentclass
+      }
+    \msg_new:nnn
+      { document } { latex-lab-pkg-missing }
+      {
+        LaTeX-lab~package~'#1'~not~found.
+      }
 %    \end{macrocode}
+% \begin{macro}{\DocumentMetadata}
+%    \begin{macrocode}
+    \NewDocumentCommand\DocumentMetadata { m }
+      {
+        \cs_if_eq:NNTF \documentclass \@twoclasseserror
+          { \msg_error:nn { document }{ setup-after-documentclass } }
+          {
+%    \end{macrocode}
 % The wanted backend must be detected first, we read the init key and then
-% force the loading by either loading l3pdf (+ expl3) or only expl3.
-% The backend contains now management command, so the boolean should true first.
+% force the loading by loading expl3.
+% The backend can contains management commands, so the boolean should be set to true first.
 %    \begin{macrocode}
-        \keys_set_groups:nnn { document / metadata} {init}{ #1 }
-        %should be loaded after the backend is set, and only if not in the kernel
-        \bool_gset_true:N \g_@@_active_bool
-        \cs_if_free:NTF \pdf_uncompress:
-         {\RequirePackage{l3pdf}}{\RequirePackage{expl3}}
+            \bool_gset_true:N \g_@@_active_bool
+            \keys_set_groups:nnn { document / metadata} {init}{ #1 }
+        %if no backend has been loaded force it now:
+            \str_if_exist:NF \c_sys_backend_str
+              {
+                \sys_load_backend:n {}
+              }
 %    \end{macrocode}
 % Now we load the extra backend code
 %    \begin{macrocode}
         \ExplSyntaxOn\makeatletter
-          \file_input:n {l3backend-testphase-\c_sys_backend_str.def}
+              \file_input:n {l3backend-testphase-\c_sys_backend_str.def}
         \ExplSyntaxOff\makeatother
 %    \end{macrocode}
 % set the default language, process the rest of the keys,
 % and setup the generic driver
 %    \begin{macrocode}
-        \keys_set_filter:nnn  { document / metadata } { init } { lang=en-US, #1 }
-        \bool_if:NT \g_@@_active_bool
-          {
-            \PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
-          }
+            \keys_set_filter:nnn  { document / metadata } { init } { lang=en-US, #1 }
+            \bool_if:NT \g_@@_active_bool
+              {
+                \PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
+              }
 %    \end{macrocode}
 % \cs{pdfmanagement_add:nnn} has collected values in this hook.
 %    \begin{macrocode}
-        \hook_use_once:n {pdfmanagement/add}
+           \hook_use_once:n {pdfmanagement/add}
 %    \end{macrocode}
-% Redefine \cs{DeclareDocumentMetadata} so that it only process the keys.
+% Redefine \cs{DocumentMetadata} so that it only process the keys.
 % We need to update the hyperref option if the active status changes.
 %    \begin{macrocode}
-        \RenewDocumentCommand\DeclareDocumentMetadata { m }
-          {
-            \keys_set_filter:nnn  { document / metadata } { init } { ##1 }
-            \bool_if:NTF \g_@@_active_bool
-             {
-               \str_remove_all:cn {opt at hyperref.sty}{customdriver=hgeneric-testphase}
-               \PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
-             }
-             {
-               \str_remove_all:cn {opt at hyperref.sty}{customdriver=hgeneric-testphase}
-             }
-          }
+           \RenewDocumentCommand\DocumentMetadata { m }
+              {
+                \keys_set_filter:nnn  { document / metadata } { init } { ##1 }
+                \bool_if:NTF \g_@@_active_bool
+                  {
+                    \str_remove_all:cn
+                      {opt at hyperref.sty}{customdriver=hgeneric-testphase}
+                    \PassOptionsToPackage
+                      {customdriver=hgeneric-testphase}{hyperref}
+                 }
+                 {
+                   \str_remove_all:cn
+                     {opt at hyperref.sty}{customdriver=hgeneric-testphase}
+                 }
+              }
 %    \end{macrocode}
 % Load more modules, the testphase code and the firstaid code.
 %    \begin{macrocode}
-        \g_@@_testphase_tl
-        \RequirePackage{pdfmanagement-firstaid}        
+            \g_@@_testphase_tl
+            \RequirePackage{pdfmanagement-firstaid}
+          }
       }
+%    \end{macrocode}
+% At last we need to provide the older alias here too
+%    \begin{macrocode}
+    \NewDocumentCommand\DeclareDocumentMetadata{}{\DocumentMetadata}
   }
 %    \end{macrocode}
 % \end{macro}
+%
 % \subsection{Container for document Properties}
 % The container for the document properties is a prop
 % \begin{variable}{\g_@@_documentproperties_prop}
@@ -303,148 +531,7 @@
   }
 %    \end{macrocode}
 % \end{macro}
-%  \subsection{The keys for \cs{DeclareDocumentMetadata}}
-%  As they use \cs{AddToDocumentProperties} they have to come after
-%  it has been defined.
-%
-%  \begin{variable}{\g_@@_firstaidoff_clist}
-%  A list to store the firstaid code which should be disabled
 %    \begin{macrocode}
-\clist_new:N \g_@@_firstaidoff_clist
-%    \end{macrocode}
-% \end{variable}
-%  \begin{variable}{\g_@@_testphase_tl}
-%  a tl to store the testphase loading code so that we can load them at
-%  the end of the command.
-%    \begin{macrocode}
-\tl_new:N \g_@@_testphase_tl
-%    \end{macrocode}
-% \end{variable}
-%    \begin{macrocode}
-\keys_define:nn { document / metadata }
-  {
-    backend .code:n =
-      {
-        \PassOptionsToPackage { driver=#1 } {expl3}
-        \AddToDocumentProperties[document]{backend}{#1}
-      },
-    backend .groups:n = { init } ,
-  }
-
-\keys_define:nn { document / metadata }
-  {
-    ,pdfversion .code:n =
-      {
-        \pdf_version_gset:n { #1 }
-        \AddToDocumentProperties[document]{pdfversion}{#1}
-      }
-    ,uncompress .code:n =
-      {
-        \pdf_uncompress:
-      }
-    ,uncompress .value_forbidden:n = true
-    ,lang .code:n =
-      {
-        \pdfmanagement_add:nnn {Catalog} {Lang}{(#1)}
-        \AddToDocumentProperties[document]{lang}{#1}
-      }
-    %,xmpmeta .bool_gset:N = \g_pdfmeta_xmp_bool %see pdfmeta unused and undefined for now!
-    % this uses internal command from pdfmeta, it should probably move there ...
-    ,pdfstandard .code:n =
-      {
-        \exp_args:Nnx
-        \keys_set:nn {document / metadata} {_pdfstandard=\str_uppercase:n{#1}}
-      }
-    ,_pdfstandard .choices:nn =
-      {A-1B,A-2A,A-2B,A-2U,A-3A,A-3B,A-3U}
-      {
-        \prop_if_exist:cT { g__pdfmeta_standard_pdf/#1_prop }
-          {
-            \prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/#1 _prop }
-          }
-        \AddToDocumentProperties [document]{pdfstandard}{#1}
-      }
-    ,_pdfstandard / unknown .code:n =
-      {
-        \msg_warning:nnn{pdf}{unknown-standard}{#1}
-      }
-    ,pdfmanagement .bool_gset:N = \g_@@_active_bool
-    ,firstaidoff .clist_gset:N = \g_@@_firstaidoff_clist
-    ,testphase .multichoice:
-    ,testphase / tagpdf .code:n =
-      {
-        \tl_gput_right:Nn\g_@@_testphase_tl
-          {
-            \RequirePackage{tagpdf}
-            \AddToDocumentProperties [document]{testphase/tagpdf}{loaded}
-          }
-      }
-    ,testphase / headings .code:n =
-      {
-        \tl_gput_right:Nn\g_@@_testphase_tl
-          {
-            \RequirePackage{headings-testphase}
-            \AddToDocumentProperties [document]{testphase/headings}{loaded}
-          }
-      }
-    ,testphase / ptagging .code:n =
-      {
-        \tl_gput_right:Nn\g_@@_testphase_tl
-          {
-            \AddToHook{class/after}
-              {
-                \RequirePackage{ptagging-testphase}
-                \AddToDocumentProperties [document]{testphase/ptagging}{loaded}
-              }
-          }
-      }
-    ,testphase / unknown .code:n =
-      {
-        \tl_gput_right:Nn\g_@@_testphase_tl
-           {
-             \AddToHook{class/after}
-               {
-                 \RequirePackage{#1-testphase}
-                 \AddToDocumentProperties [document]{testphase/#1}{loaded}
-               }
-           }
-      }
-    ,activate .multichoice:
-    ,activate / tagging .code:n =
-      {
-        \AddToHook{package/after/tagpdf}
-          {
-            \tagpdfsetup{activate,paratagging,interwordspace}
-            \AddToDocumentProperties [document]{tagging}{active}
-            \AddToDocumentProperties [document]{tagging/para}{active}
-            \AddToDocumentProperties [document]{tagging/interwordspace}{active}
-          }
-      }
-    ,debug .code:n =
-      {
-        \keys_set:nn { document / metadata / debug } {#1}
-      }
-    ,debug / para .code:n =
-      {
-        \AddToHook{package/after/tagpdf}
-          {
-            \tagpdfsetup{paratagging-show}
-          }
-      }
-    ,debug / log .code:n =
-      {
-        \AddToHook{package/after/tagpdf}
-          {
-            \tagpdfsetup{log=#1}
-          }
-      }
-    ,debug / uncompress .code:n =
-      {
-        \pdf_uncompress:
-      }
-  }
-%    \end{macrocode}
-%    \begin{macrocode}
 %</package>
 %    \end{macrocode}
 %

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/output-patches-tmp-ltx.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/output-patches-tmp-ltx.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/output-patches-tmp-ltx.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -119,7 +119,8 @@
 %    \end{itemize}
 %
 %    \begin{macrocode}
-\AddToHook{package/after/multicol}{% multicol needs later loading
+\AddToHook{package/multicol/after}
+    {% multicol needs later loading
 %    \end{macrocode}
 %
 %    \begin{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: pdfmanagement-firstaid.dtx
 %
-% Copyright (C) 2018-2021 The LaTeX Project
+% Copyright (C) 2018-2022 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
@@ -24,7 +24,7 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
 \declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
@@ -51,7 +51,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -63,11 +63,11 @@
 % This code should disappear when packages adapt to the central interfaces.
 %
 % The package contains an number of sections for various packages. Every
-% section can be disabled in (the first) \cs{DeclareDocumentMetadata} with
-% |firstaidoff={name1,name2,...}|.
+% section can be disabled in (the first) \cs{DocumentMetadata} with
+% |debug={firstaidoff={name1,name2,...},...}|.
 %    \begin{macrocode}
 %<*package>
-\ProvidesExplPackage{pdfmanagement-firstaid}{2021-08-28}{0.95i}
+\ProvidesExplPackage{pdfmanagement-firstaid}{2022-01-13}{0.95j}
   {LaTeX PDF management testphase bundle / firstaid-patches}
 
 %<@@=pdfmanagement>
@@ -137,7 +137,10 @@
 %    \begin{macrocode}
 \bool_if:NT \g_@@_firstaid_xcolor_bool
   {
-    \AddToHook{package/after/xcolor}
+    \AddToHook
+       {
+         package/xcolor/after
+       }
        {\RequirePackage{xcolor-patches-tmp-ltx}\XC@@@@names}
   }
 %    \end{macrocode}
@@ -170,8 +173,11 @@
 \bool_if:NT \g_@@_firstaid_pgf_bool
   {
     \msg_info:nnn{pdfmanagement }{firstaid}{pgf}
-    \AddToHook{file/after/pgfrcs.sty}
+    \AddToHook
       {
+        file/pgfrcs.sty/after
+      }
+      {
         \cs_set_eq:NN
           \@@_pgfori_pgfutil at setuppdfresources
           \pgfutil at setuppdfresources
@@ -274,7 +280,9 @@
 \bool_if:NT \g_@@_firstaid_hyperxmp_bool
  {
     \AddToHook
-      {file/after/hyperxmp.sty}
+      {
+       file/hyperxmp.sty/after
+      }
       {\RequirePackage{hyperxmp-patches-tmp-ltx}}
  }
 %</package>

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -2,7 +2,7 @@
 %
 %% File: pdfmanagement-testphase.dtx
 %
-% Copyright (C) 2019-2021 The LaTeX Project
+% Copyright (C) 2019-2022 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
@@ -24,9 +24,9 @@
 %
 %<*driver>
 \RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b}
+\DocumentMetadata{pdfstandard=A-2b}
 \makeatletter
-\declare at file@substitution{doc.sty}{doc-v3beta.sty}
+%\declare at file@substitution{doc.sty}{doc-v3beta.sty}
 \makeatother
 \documentclass{l3doc}
 \usepackage{tabularx,array,booktabs,hyperxmp}
@@ -51,7 +51,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95i, released 2021-08-28}
+% \date{Version 0.95j, released 2022-01-13}
 %
 % \maketitle
 % \begin{documentation}
@@ -66,7 +66,7 @@
 % \begin{verbatim}
 % \RequirePackage{pdfmanagement-testphase}   % load the package
 %
-% \DeclareDocumentMetadata      % activate the PDF management (with options)
+% \DocumentMetadata      % activate the PDF management (with options)
 %     {
 %       % options
 %     }
@@ -76,6 +76,8 @@
 %  Note that the activation has to happen before the \cs{documentclass} declaration.
 %  Because of this, the package needs loading with \cs{RequirePackage}.
 %
+% Starting with LaTeX 2022-06-01 (or a suitable latex-dev) it is no longer necessary to
+% load pdfmanagement-testphase manually, using \cs{DocumentMetadata} is enough.
 %
 %
 % \section*{Feedback wanted!}
@@ -125,8 +127,9 @@
 % written by the kernel directly and this can not be done without proper,
 % well-defined and well-behaving interfaces and hooks.
 %
-% Some first steps for better support of PDF related commands have been already done
-% with the \pkg{l3pdf} package which has now been integrated into \pkg{l3kernel}.
+% Some first steps for better support of PDF related commands have been done
+% with the \pkg{l3pdf} package which has now been integrated as a module
+% into \pkg{l3kernel}.
 % It offers backend independent commands to create
 % PDF objects and destination, to set the compress level and the PDF version.
 %
@@ -171,7 +174,7 @@
 %
 % Loading the package will only \emph{load} the modules,
 % to \emph{activate} the core PDF management the trigger command
-% \cs{DeclareDocumentMetadata} has to be used too.
+% \cs{DocumentMetadata} has to be used too.
 % The loading and activation has to be done
 % \emph{before} the \cs{documentclass} command.
 %
@@ -201,13 +204,14 @@
 % \section{Use}\label{sec:use}
 % The package should be loaded before \cs{documentclass}. To activate
 % the resource management it should be followed by
-% \cs{DeclareDocumentMetadata}\marg{key-val}.
-% The options of \cs{DeclareDocumentMetadata} are described in the documentation of
+% \cs{DocumentMetadata}\marg{key-val}.
+% The options of \cs{DocumentMetadata} are described in the documentation of
 % \pkg{ltdocinit}.
 %
 % \begin{verbatim}
 % \RequirePackage{pdfmanagement-testphase} % load the package
-% \DeclareDocumentMetadata % activates the PDF management interface
+%                                          % not needed with LaTeX 2022-06-01
+% \DocumentMetadata % activates the PDF management interface
 %     {
 %        %options
 %     }
@@ -214,9 +218,10 @@
 % \documentclass {...}
 % \end{verbatim}
 %
-% The PDF management can be deactivated either setting the key
+% The PDF management can be deactivated either setting in the \texttt{debug} key
+% the key
 % \texttt{pdfmanagement} to \texttt{false} or by commenting out
-% the whole \cs{DeclareDocumentMetadata} declaration.
+% the whole \cs{DocumentMetadata} declaration.
 %
 % To test if the PDF management is active the predicate
 % \cs{pdfmanagement_if_active:TF} can be used, see the documentation of \pkg{l3pdfmanagement}.
@@ -250,7 +255,7 @@
 %
 % \item[l3pdfmanagement] This is the core code of the PDF management.
 %
-% \item[ltdocinit] This module provides the \cs{DeclareDocumentMetadata} command.
+% \item[ltdocinit] This module provides the \cs{DocumentMetadata} command.
 %
 % \item[hyperref-generic] This module provides a new generic hyperref driver.
 % The driver will
@@ -332,23 +337,23 @@
 % 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 |firstaidoff=hyperxmp| in \cs{DeclareDocumentMetadata}
+% The patch code can be disabled by using |debug={firstaidoff=hyperxmp}| in \cs{DocumentMetadata}
 %
 % \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.
-% This can be disabled by using |firstaidoff=pgf| in \cs{DeclareDocumentMetadata}
+% This can be disabled by using |debug={firstaidoff=pgf}| in \cs{DocumentMetadata}
 %
 % \subsection{transparent}
 % The package \pkg{transparent} is incompatible. A replacement has been written
 % (\pkg{transparent-ltx}) and is loaded automatically. It requires a very recent
 % L3 programming layer!
-% This can be disabled by using |firstaidoff=transparent| in \cs{DeclareDocumentMetadata}
+% This can be disabled by using |debug={firstaidoff=transparent}| in \cs{DocumentMetadata}
 % \subsection{pdflscape}
 % The package \pkg{pdflscape} is incompatible. A replacement has been written
 % (\pkg{pdflscape-ltx}) and is loaded automatically.
-% This can be disabled by using |firstaidoff=pdflscape| in \cs{DeclareDocumentMetadata}
+% This can be disabled by using |debug={firstaidoff=pdflscape}| in \cs{DocumentMetadata}
 %
 % \subsection{colorspace}
 % The package is incompatible. Some patches
@@ -384,7 +389,7 @@
 %    \begin{macrocode}
 %<@@=pdf>
 %<*package>
-\ProvidesExplPackage{pdfmanagement-testphase}{2021-08-28}{0.95i}
+\ProvidesExplPackage{pdfmanagement-testphase}{2022-01-13}{0.95j}
   {LaTeX PDF management testphase bundle}
 \providecommand\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
 \IfFormatAtLeastTF{2020-10-01}{}{
@@ -393,6 +398,7 @@
     \MessageBreak Loading~is~aborted.}{}
  \DeclareOption { debug }{}
  \newcommand\DeclareDocumentMetadata[1]{}
+ \newcommand\DocumentMetadata[1]{}
  \ProcessOptions\relax
  }
 \IfFormatAtLeastTF{2020-10-01}{}{\endinput}
@@ -411,13 +417,13 @@
 % to allow to set it in the document.
 %    \begin{macrocode}
 %<*header>
-\ProvidesExplFile{pdfmanagement-testphase.ltx}{2021-08-28}{0.95i}
+\ProvidesExplFile{pdfmanagement-testphase.ltx}{2022-01-13}{0.95j}
   {PDF~management~code~(testphase)}
 %</header>
 %<*package>
 %\RequirePackage{l3pdfdict}       % needed by l3pdfmanagement
 %\RequirePackage{l3pdfmanagement} % loads the core code with the boolean
-%\RequirePackage{ltdocinit}       % DeclareDocumentMetadata,
+%\RequirePackage{ltdocinit}       % DocumentMetadata,
 %% can perhaps be combined or made optional ...
 %\RequirePackage{l3pdfannot}
 %\RequirePackage{l3pdfxform-beta}

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty	2022-01-13 21:05:04 UTC (rev 61599)
@@ -22,7 +22,7 @@
 %% This file has the LPPL maintenance status "maintained".
 %%
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{color-ltx}[2021-08-28 v0.95i
+\ProvidesPackage{color-ltx}[2022-01-13 v0.95j
   Standard LaTeX Color (patched for l3color, part of pdfmanagement-testphase, original version 2021/03/07 v1.2e) (DPC)]
 \edef\Gin at codes{%
  \catcode`\noexpand\^^A\the\catcode`\^^A\relax

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def	2022-01-13 21:05:04 UTC (rev 61599)
@@ -19,7 +19,8 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: hyperref-generic.dtx
-\ProvidesFile{hgeneric-testphase.def}[2021-08-28 v0.95i %
+
+\ProvidesFile{hgeneric-testphase.def}[2022-01-13 v0.95j %
   generic Hyperref driver for the LaTeX PDF management testphase bundle]
 
 \RequirePackage{etoolbox} %why?
@@ -28,28 +29,42 @@
 \ExplSyntaxOff
 \ExplSyntaxOn
 \prop_gput:Nnn \g_msg_module_name_prop { hyp }{ hyperref }
-\msg_new:nnnn
-  { hyp }
-  { missing-resource-management }
-  { The~PDF~resource~management~is~required~for~this~hyperref~driver! }
+\cs_if_exist:NTF \DocumentMetadata
   {
-     Activate~it~with \\
-     \tl_to_str:n{\RequirePackage{pdfmanagement-testphase}}\\
-     \tl_to_str:n{\DeclareDocumentMetadata{<options>}}\\
-     before~\tl_to_str:n{\documentclass}
+   \msg_new:nnnn
+      { hyp }
+      { missing-resource-management }
+      { The~PDF~resource~management~is~required~for~this~hyperref~driver! }
+      {
+         Activate~it~with \\
+         \tl_to_str:n{\DocumentMetadata{<options>}}\\
+         before~\tl_to_str:n{\documentclass}
+      }
   }
+  {
+    \msg_new:nnnn
+      { hyp }
+      { missing-resource-management }
+      { The~PDF~resource~management~is~required~for~this~hyperref~driver! }
+      {
+         Activate~it~with \\
+         \tl_to_str:n{\RequirePackage{pdfmanagement-testphase}}\\
+         \tl_to_str:n{\DocumentMetadata{<options>}}\\
+         before~\tl_to_str:n{\documentclass}
+      }
+   }
 \msg_new:nnnn
   { hyp }
   { pdfversion-disabled }
   {
     This~hyperref~driver~ignores~the~pdfversion~key!\\
-    Set~the~pdfversion~in~\token_to_str:N \DeclareDocumentMetadata
+    Set~the~pdfversion~in~\token_to_str:N \DocumentMetadata
   }
   {
     For example:\\
     \tl_to_str:n
      {
-      \DeclareDocumentMetadata { pdfversion=1.7 }
+      \DocumentMetadata { pdfversion=1.7 }
      }
   }
 \msg_new:nnn
@@ -422,7 +437,7 @@
 \bool_lazy_and:nnF
   { \cs_if_exist_p:N \pdfmanagement_if_active_p: }{ \pdfmanagement_if_active_p: }
   { \msg_error:nn { hyp}{ missing-resource-management } }
-\AddToHook { package / after / bookmark}
+\AddToHook { package/bookmark/after}
  {
    \define at key{BKM}{color}
      {

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def	2022-01-13 21:05:04 UTC (rev 61599)
@@ -20,6 +20,7 @@
 %% 
 %% File: hyperref-generic.dtx
 
+
 \prop_const_from_keyval:cn { c__hyp_colorscheme_primary-colors_prop }
  {
    linkcolor       = [rgb]{1,0,0}, %red

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty	2022-01-13 21:05:04 UTC (rev 61599)
@@ -19,7 +19,7 @@
 %
 % for those people who are interested.
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\ProvidesExplPackage{hyperxmp-patches-tmp-ltx}{2021-08-28}{0.95i}
+\ProvidesExplPackage{hyperxmp-patches-tmp-ltx}{2022-01-13}{0.95j}
   {Store hyperref metadata in XMP format / temporay patches to test pdfresource management ... UF}
 
 \cs_if_exist:NT \pdfmanagement_add:nnn
@@ -124,6 +124,9 @@
     \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}}
@@ -131,8 +134,15 @@
 
 % 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}}
+ \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}}
+ }
 
 \DeclareHookRule{begindocument/before}{pdfmanagement/firstaid/hyperxmp}{before}{hyperxmp}
 

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def	2022-01-13 21:05:04 UTC (rev 61599)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-dvipdfmx.def}{2021-08-28}{}
+  {l3backend-testphase-dvipdfmx.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -351,6 +351,115 @@
   }
 \prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
   { TF , T , F , p }
+\tl_new:N   \l_pdf_current_structure_destination_tl
+\cs_new_protected:Npn \pdf_activate_structure_destination:
+ {
+   \cs_gset_eq:NN \__pdf_backend_destination:nn \__pdf_backend_structure_destination:nn
+   \cs_gset_eq:NN \__pdf_backend_destination:nnnn \__pdf_backend_structure_destination:nnnn
+   \cs_gset_eq:NN \__pdf_backend_link_begin_goto:nnw  \__pdf_backend_link_begin_structure_goto:nnw
+ }
+\cs_set_eq:NN \__pdf_backend_structure_destination:nn       \__pdf_backend_destination:nn
+\cs_set_eq:NN \__pdf_backend_structure_destination:nnnn \__pdf_backend_destination:nnnn
+\cs_set_eq:NN \__pdf_backend_link_begin_structure_goto:nnw  \__pdf_backend_link_begin_goto:nnw
+\cs_set_protected:Npn \__pdf_backend_structure_destination:nn #1#2
+  {
+    \__pdf_backend:x
+      {
+        dest ~ ( \exp_not:n {#1} )
+        [
+          @thispage
+          \str_case:nnF {#2}
+            {
+              { xyz }   { /XYZ ~ @xpos ~ @ypos ~ null }
+              { fit }   { /Fit }
+              { fitb }  { /FitB }
+              { fitbh } { /FitBH }
+              { fitbv } { /FitBV ~ @xpos }
+              { fith }  { /FitH ~ @ypos }
+              { fitv }  { /FitV ~ @xpos }
+              { fitr }  { /Fit }
+            }
+            { /XYZ ~ @xpos ~ @ypos ~ \fp_eval:n { (#2) / 100 } }
+        ]
+      }
+    \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+      {
+        \__pdf_backend:x
+         {
+          obj ~ @pdf.SDest.\exp_not:n{#1}
+          [
+            \exp_args:Ne \pdf_object_ref:n { \l_pdf_current_structure_destination_tl }
+            \str_case:nnF {#2}
+              {
+                { xyz }   { /XYZ ~ @xpos ~ @ypos ~ null }
+                { fit }   { /Fit }
+                { fitb }  { /FitB }
+                { fitbh } { /FitBH }
+                { fitbv } { /FitBV ~ @xpos }
+                { fith }  { /FitH ~ @ypos }
+                { fitv }  { /FitV ~ @xpos }
+                { fitr }  { /Fit }
+              }
+              { /XYZ ~ @xpos ~ @ypos ~ \fp_eval:n { (#2) / 100 } }
+          ]
+        }
+      }
+  }
+\cs_new_protected:Npn \__pdf_backend_structure_destination_aux:nnnn #1#2#3#4
+  {
+    \vbox_to_zero:n
+      {
+        \__kernel_kern:n {#4}
+        \hbox:n
+          {
+            \__pdf_backend:n { obj ~ @pdf_ #2 _llx ~ @xpos }
+            \__pdf_backend:n { obj ~ @pdf_ #2 _lly ~ @ypos }
+          }
+        \tex_vss:D
+      }
+    \__kernel_kern:n {#1}
+    \vbox_to_zero:n
+      {
+        \__kernel_kern:n { -#3 }
+        \hbox:n
+          {
+            \__pdf_backend:n
+              {
+                dest ~ (#2)
+                [
+                  @thispage
+                  /FitR ~
+                    @pdf_ #2 _llx ~ @pdf_ #2 _lly ~
+                    @xpos ~ @ypos
+                ]
+              }
+            \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+              {
+                \__pdf_backend:x
+                  {
+                    obj ~ @pdf.SDest.\exp_not:n{#2}
+                    [
+                      \exp_args:Ne \pdf_object_ref:n { \l_pdf_current_structure_destination_tl }
+                      /FitR ~
+                        @pdf_ #2 _llx ~ @pdf_ #2 _lly ~
+                        @xpos ~ @ypos
+                    ]
+                  }
+              }
+          }
+        \tex_vss:D
+      }
+    \__kernel_kern:n { -#1 }
+  }
+\cs_set_protected:Npn \__pdf_backend_structure_destination:nnnn #1#2#3#4
+  {
+    \exp_args:Ne \__pdf_backend_structure_destination_aux:nnnn
+      { \dim_eval:n {#2} } {#1} {#3} {#4}
+  }
+\cs_set_protected:Npn \__pdf_backend_link_begin_structure_goto:nnw #1#2
+  {
+    \__pdf_backend_link_begin:n { #1 /Subtype /Link /A << /S /GoTo /D ( #2 ) /SD~@pdf.SDest.#2  >> }
+  }
 %% 
 %%
 %% End of file `l3backend-testphase-dvipdfmx.def'.

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def	2022-01-13 21:05:04 UTC (rev 61599)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-dvips.def}{2021-08-28}{}
+  {l3backend-testphase-dvips.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvips}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -261,6 +261,16 @@
   }
 \prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
   { TF , T , F , p }
+\tl_new:N   \l_pdf_current_structure_destination_tl
+\cs_new_protected:Npn \pdf_activate_structure_destination:
+ {
+   \cs_gset_eq:NN \__pdf_backend_destination:nn \__pdf_backend_structure_destination:nn
+   \cs_gset_eq:NN \__pdf_backend_destination:nnnn \__pdf_backend_structure_destination:nnnn
+   \cs_gset_eq:NN \__pdf_backend_link_begin_goto:nnw  \__pdf_backend_link_begin_structure_goto:nnw
+ }
+\cs_set_eq:NN \__pdf_backend_structure_destination:nn       \__pdf_backend_destination:nn
+\cs_set_eq:NN \__pdf_backend_structure_destination:nnnn \__pdf_backend_destination:nnnn
+\cs_set_eq:NN \__pdf_backend_link_begin_structure_goto:nnw  \__pdf_backend_link_begin_goto:nnw
 %% 
 %%
 %% End of file `l3backend-testphase-dvips.def'.

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def	2022-01-13 21:05:04 UTC (rev 61599)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-dvisvgm.def}{2021-08-28}{}
+  {l3backend-testphase-dvisvgm.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -130,6 +130,16 @@
   }
 \prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
   { TF , T , F , p }
+\tl_new:N   \l_pdf_current_structure_destination_tl
+\cs_new_protected:Npn \pdf_activate_structure_destination:
+ {
+   \cs_gset_eq:NN \__pdf_backend_destination:nn \__pdf_backend_structure_destination:nn
+   \cs_gset_eq:NN \__pdf_backend_destination:nnnn \__pdf_backend_structure_destination:nnnn
+   \cs_gset_eq:NN \__pdf_backend_link_begin_goto:nnw  \__pdf_backend_link_begin_structure_goto:nnw
+ }
+\cs_set_eq:NN \__pdf_backend_structure_destination:nn       \__pdf_backend_destination:nn
+\cs_set_eq:NN \__pdf_backend_structure_destination:nnnn \__pdf_backend_destination:nnnn
+\cs_set_eq:NN \__pdf_backend_link_begin_structure_goto:nnw  \__pdf_backend_link_begin_goto:nnw
 %% 
 %%
 %% End of file `l3backend-testphase-dvisvgm.def'.

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def	2022-01-13 21:05:04 UTC (rev 61599)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-luatex.def}{2021-08-28}{}
+  {l3backend-testphase-luatex.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -364,6 +364,83 @@
   }
 \prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
   { TF , T , F , p }
+\tl_new:N   \l_pdf_current_structure_destination_tl
+\cs_new_protected:Npn \pdf_activate_structure_destination:
+ {
+   \cs_gset_eq:NN \__pdf_backend_destination:nn \__pdf_backend_structure_destination:nn
+   \cs_gset_eq:NN \__pdf_backend_destination:nnnn \__pdf_backend_structure_destination:nnnn
+   \cs_gset_eq:NN \__pdf_backend_link_begin_goto:nnw  \__pdf_backend_link_begin_structure_goto:nnw
+ }
+\cs_set_eq:NN \__pdf_backend_structure_destination:nn       \__pdf_backend_destination:nn
+\cs_set_eq:NN \__pdf_backend_structure_destination:nnnn \__pdf_backend_destination:nnnn
+\cs_set_eq:NN \__pdf_backend_link_begin_structure_goto:nnw  \__pdf_backend_link_begin_goto:nnw
+ \int_compare:nNnT {\directlua{tex.print(status.list()["development_id"])} } > {7468}
+  {
+    \cs_set_protected:Npn \__pdf_backend_structure_destination:nn #1#2
+      {
+        \tex_pdfextension:D dest
+           name {#1}
+           \str_case:nnF {#2}
+             {
+               { xyz }   { xyz }
+               { fit }   { fit }
+               { fitb }  { fitb }
+               { fitbh } { fitbh }
+               { fitbv } { fitbv }
+               { fith }  { fith }
+               { fitv }  { fitv }
+               { fitr }  { fitr }
+             }
+             { xyz ~ zoom \fp_eval:n { #2 * 10 } }
+           \scan_stop:
+        \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+          {
+            \tex_pdfextension:D dest
+               struct~
+               \int_use:c
+                 { c__pdf_backend_object_ \exp_args:Ne \tl_to_str:n {\l_pdf_current_structure_destination_tl} _int }~
+               name {#1}
+               \str_case:nnF {#2}
+                 {
+                   { xyz }   { xyz }
+                   { fit }   { fit }
+                   { fitb }  { fitb }
+                   { fitbh } { fitbh }
+                   { fitbv } { fitbv }
+                   { fith }  { fith }
+                   { fitv }  { fitv }
+                   { fitr }  { fitr }
+                 }
+                 { xyz ~ zoom \fp_eval:n { #2 * 10 } }
+               \scan_stop:
+          }
+      }
+    \cs_set_protected:Npn \__pdf_backend_destination:nnnn #1#2#3#4
+      {
+       \tex_pdfextension:D dest
+        name {#1}
+        fitr ~
+        width  \dim_eval:n {#2} ~
+        height \dim_eval:n {#3} ~
+        depth  \dim_eval:n {#4} \scan_stop:
+       \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+         {
+           \tex_pdfextension:D dest
+             struct~
+             \int_use:c
+               { c__pdf_backend_object_ \exp_args:Ne \tl_to_str:n {\l_pdf_current_structure_destination_tl} _int }~
+             name {#1}
+             fitr ~
+             width  \dim_eval:n {#2} ~
+             height \dim_eval:n {#3} ~
+             depth  \dim_eval:n {#4} \scan_stop:
+         }
+     }
+    \cs_set_protected:Npn \__pdf_backend_link_begin_structure_goto:nnw #1#2
+      {
+        \__pdf_backend_link_begin:nnnw {#1} { goto~struct~name~{#2}~name } {#2}
+      }
+  }
 %% 
 %%
 %% End of file `l3backend-testphase-luatex.def'.

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def	2022-01-13 21:05:04 UTC (rev 61599)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-pdftex.def}{2021-08-28}{}
+  {l3backend-testphase-pdftex.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -383,6 +383,85 @@
   }
 \prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
   { TF , T , F , p }
+\tl_new:N   \l_pdf_current_structure_destination_tl
+\cs_new_protected:Npn \pdf_activate_structure_destination:
+ {
+   \cs_gset_eq:NN \__pdf_backend_destination:nn \__pdf_backend_structure_destination:nn
+   \cs_gset_eq:NN \__pdf_backend_destination:nnnn \__pdf_backend_structure_destination:nnnn
+   \cs_gset_eq:NN \__pdf_backend_link_begin_goto:nnw  \__pdf_backend_link_begin_structure_goto:nnw
+ }
+\cs_set_eq:NN \__pdf_backend_structure_destination:nn       \__pdf_backend_destination:nn
+\cs_set_eq:NN \__pdf_backend_structure_destination:nnnn \__pdf_backend_destination:nnnn
+\cs_set_eq:NN \__pdf_backend_link_begin_structure_goto:nnw  \__pdf_backend_link_begin_goto:nnw
+\bool_lazy_and:nnT
+  { \int_compare_p:nNn {\tex_pdftexversion:D } > {139} }
+  { \int_compare_p:nNn {\tex_pdftexrevision:D } > {23} }
+  {
+    \cs_set_protected:Npn \__pdf_backend_structure_destination:nn #1#2
+      {
+        \tex_pdfdest:D
+           name {#1}
+           \str_case:nnF {#2}
+             {
+               { xyz }   { xyz }
+               { fit }   { fit }
+               { fitb }  { fitb }
+               { fitbh } { fitbh }
+               { fitbv } { fitbv }
+               { fith }  { fith }
+               { fitv }  { fitv }
+               { fitr }  { fitr }
+             }
+             { xyz ~ zoom \fp_eval:n { #2 * 10 } }
+           \scan_stop:
+        \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+          {
+            \tex_pdfdest:D
+               struct~
+               \int_use:c
+                 { c__pdf_backend_object_ \exp_args:Ne \tl_to_str:n {\l_pdf_current_structure_destination_tl} _int }~
+               name {#1}
+               \str_case:nnF {#2}
+                 {
+                   { xyz }   { xyz }
+                   { fit }   { fit }
+                   { fitb }  { fitb }
+                   { fitbh } { fitbh }
+                   { fitbv } { fitbv }
+                   { fith }  { fith }
+                   { fitv }  { fitv }
+                   { fitr }  { fitr }
+                 }
+                 { xyz ~ zoom \fp_eval:n { #2 * 10 } }
+               \scan_stop:
+          }
+      }
+    \cs_set_protected:Npn \__pdf_backend_destination:nnnn #1#2#3#4
+      {
+       \tex_pdfdest:D
+        name {#1}
+        fitr ~
+        width  \dim_eval:n {#2} ~
+        height \dim_eval:n {#3} ~
+        depth  \dim_eval:n {#4} \scan_stop:
+       \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+         {
+           \tex_pdfdest:D
+             struct~
+             \int_use:c
+               { c__pdf_backend_object_ \exp_args:Ne \tl_to_str:n {\l_pdf_current_structure_destination_tl} _int }~
+             name {#1}
+             fitr ~
+             width  \dim_eval:n {#2} ~
+             height \dim_eval:n {#3} ~
+             depth  \dim_eval:n {#4} \scan_stop:
+         }
+     }
+    \cs_set_protected:Npn \__pdf_backend_link_begin_structure_goto:nnw #1#2
+      {
+        \__pdf_backend_link_begin:nnnw {#1} { goto~struct~name~{#2}~name } {#2}
+      }
+  }
 %% 
 %%
 %% End of file `l3backend-testphase-pdftex.def'.

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def	2022-01-13 21:05:04 UTC (rev 61599)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-xetex.def}{2021-08-28}{}
+  {l3backend-testphase-xetex.def}{2022-01-13}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -351,6 +351,115 @@
   }
 \prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
   { TF , T , F , p }
+\tl_new:N   \l_pdf_current_structure_destination_tl
+\cs_new_protected:Npn \pdf_activate_structure_destination:
+ {
+   \cs_gset_eq:NN \__pdf_backend_destination:nn \__pdf_backend_structure_destination:nn
+   \cs_gset_eq:NN \__pdf_backend_destination:nnnn \__pdf_backend_structure_destination:nnnn
+   \cs_gset_eq:NN \__pdf_backend_link_begin_goto:nnw  \__pdf_backend_link_begin_structure_goto:nnw
+ }
+\cs_set_eq:NN \__pdf_backend_structure_destination:nn       \__pdf_backend_destination:nn
+\cs_set_eq:NN \__pdf_backend_structure_destination:nnnn \__pdf_backend_destination:nnnn
+\cs_set_eq:NN \__pdf_backend_link_begin_structure_goto:nnw  \__pdf_backend_link_begin_goto:nnw
+\cs_set_protected:Npn \__pdf_backend_structure_destination:nn #1#2
+  {
+    \__pdf_backend:x
+      {
+        dest ~ ( \exp_not:n {#1} )
+        [
+          @thispage
+          \str_case:nnF {#2}
+            {
+              { xyz }   { /XYZ ~ @xpos ~ @ypos ~ null }
+              { fit }   { /Fit }
+              { fitb }  { /FitB }
+              { fitbh } { /FitBH }
+              { fitbv } { /FitBV ~ @xpos }
+              { fith }  { /FitH ~ @ypos }
+              { fitv }  { /FitV ~ @xpos }
+              { fitr }  { /Fit }
+            }
+            { /XYZ ~ @xpos ~ @ypos ~ \fp_eval:n { (#2) / 100 } }
+        ]
+      }
+    \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+      {
+        \__pdf_backend:x
+         {
+          obj ~ @pdf.SDest.\exp_not:n{#1}
+          [
+            \exp_args:Ne \pdf_object_ref:n { \l_pdf_current_structure_destination_tl }
+            \str_case:nnF {#2}
+              {
+                { xyz }   { /XYZ ~ @xpos ~ @ypos ~ null }
+                { fit }   { /Fit }
+                { fitb }  { /FitB }
+                { fitbh } { /FitBH }
+                { fitbv } { /FitBV ~ @xpos }
+                { fith }  { /FitH ~ @ypos }
+                { fitv }  { /FitV ~ @xpos }
+                { fitr }  { /Fit }
+              }
+              { /XYZ ~ @xpos ~ @ypos ~ \fp_eval:n { (#2) / 100 } }
+          ]
+        }
+      }
+  }
+\cs_new_protected:Npn \__pdf_backend_structure_destination_aux:nnnn #1#2#3#4
+  {
+    \vbox_to_zero:n
+      {
+        \__kernel_kern:n {#4}
+        \hbox:n
+          {
+            \__pdf_backend:n { obj ~ @pdf_ #2 _llx ~ @xpos }
+            \__pdf_backend:n { obj ~ @pdf_ #2 _lly ~ @ypos }
+          }
+        \tex_vss:D
+      }
+    \__kernel_kern:n {#1}
+    \vbox_to_zero:n
+      {
+        \__kernel_kern:n { -#3 }
+        \hbox:n
+          {
+            \__pdf_backend:n
+              {
+                dest ~ (#2)
+                [
+                  @thispage
+                  /FitR ~
+                    @pdf_ #2 _llx ~ @pdf_ #2 _lly ~
+                    @xpos ~ @ypos
+                ]
+              }
+            \exp_args:Ne \pdf_object_if_exist:nT { \l_pdf_current_structure_destination_tl }
+              {
+                \__pdf_backend:x
+                  {
+                    obj ~ @pdf.SDest.\exp_not:n{#2}
+                    [
+                      \exp_args:Ne \pdf_object_ref:n { \l_pdf_current_structure_destination_tl }
+                      /FitR ~
+                        @pdf_ #2 _llx ~ @pdf_ #2 _lly ~
+                        @xpos ~ @ypos
+                    ]
+                  }
+              }
+          }
+        \tex_vss:D
+      }
+    \__kernel_kern:n { -#1 }
+  }
+\cs_set_protected:Npn \__pdf_backend_structure_destination:nnnn #1#2#3#4
+  {
+    \exp_args:Ne \__pdf_backend_structure_destination_aux:nnnn
+      { \dim_eval:n {#2} } {#1} {#3} {#4}
+  }
+\cs_set_protected:Npn \__pdf_backend_link_begin_structure_goto:nnw #1#2
+  {
+    \__pdf_backend_link_begin:n { #1 /Subtype /Link /A << /S /GoTo /D ( #2 ) /SD~@pdf.SDest.#2  >> }
+  }
 %% 
 %%
 %% End of file `l3backend-testphase-xetex.def'.

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty	2022-01-13 21:05:04 UTC (rev 61599)
@@ -27,7 +27,7 @@
 %% File: l3pdffield.dtx
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{l3pdffield-testphase}{2021-08-28}{0.95i}%
+\ProvidesExplPackage{l3pdffield-testphase}{2022-01-13}{0.95j}%
   {form fields}
 \csname HyField at NeedAppearancesfalse\endcsname % suppress NeedAppearances
 \str_new:N \l__pdffield_tmpa_str

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/output-patches-tmp-ltx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/output-patches-tmp-ltx.sty	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/output-patches-tmp-ltx.sty	2022-01-13 21:05:04 UTC (rev 61599)
@@ -48,7 +48,8 @@
 
 \pretocmd\@makecol{\@kernel at before@cclv}
   {\typeout{Patching \string\@makecol\space for tagging}}{\PATCHerror }
-\AddToHook{package/after/multicol}{% multicol needs later loading
+\AddToHook{package/multicol/after}
+    {% multicol needs later loading
   \patchcmd\page at sofar
       {\setbox\z@\hbox{p}\global\dimen\tw@\dp\z@}%
       {%

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty	2022-01-13 21:05:04 UTC (rev 61599)
@@ -22,7 +22,7 @@
 %% This work consists of the main source file pdflscape-ltx.sty
 %%
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{pdflscape-ltx}{2021-08-28}{0.95i}
+\ProvidesExplPackage{pdflscape-ltx}{2022-01-13}{0.95j}
  {Display of landscape pages in PDF - adaption of pdflscape to the PDFmanagement bundle (testphase)}
 
 \DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}}

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty	2022-01-13 21:05:04 UTC (rev 61599)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: pdfmanagement-firstaid.dtx
-\ProvidesExplPackage{pdfmanagement-firstaid}{2021-08-28}{0.95i}
+\ProvidesExplPackage{pdfmanagement-firstaid}{2022-01-13}{0.95j}
   {LaTeX PDF management testphase bundle / firstaid-patches}
 
 \clist_map_inline:nn {pgf,transparent,hyperxmp,pdflscape,xcolor,color,beamer,output}
@@ -51,7 +51,10 @@
   }
 \bool_if:NT \g__pdfmanagement_firstaid_xcolor_bool
   {
-    \AddToHook{package/after/xcolor}
+    \AddToHook
+       {
+         package/xcolor/after
+       }
        {\RequirePackage{xcolor-patches-tmp-ltx}\XC@@names}
   }
 
@@ -58,8 +61,11 @@
 \bool_if:NT \g__pdfmanagement_firstaid_pgf_bool
   {
     \msg_info:nnn{pdfmanagement }{firstaid}{pgf}
-    \AddToHook{file/after/pgfrcs.sty}
+    \AddToHook
       {
+        file/pgfrcs.sty/after
+      }
+      {
         \cs_set_eq:NN
           \__pdfmanagement_pgfori_pgfutil at setuppdfresources
           \pgfutil at setuppdfresources
@@ -141,7 +147,9 @@
 \bool_if:NT \g__pdfmanagement_firstaid_hyperxmp_bool
  {
     \AddToHook
-      {file/after/hyperxmp.sty}
+      {
+       file/hyperxmp.sty/after
+      }
       {\RequirePackage{hyperxmp-patches-tmp-ltx}}
  }
 \hook_gput_code:nnn {begindocument} {pdf}

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx	2022-01-13 21:05:04 UTC (rev 61599)
@@ -27,7 +27,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: pdfmanagement-testphase.dtx
-\ProvidesExplFile{pdfmanagement-testphase.ltx}{2021-08-28}{0.95i}
+\ProvidesExplFile{pdfmanagement-testphase.ltx}{2022-01-13}{0.95j}
   {PDF~management~code~(testphase)}
 %% File: l3pdfdict.dtx
 \cs_new:Npn \__pdfdict_get_type:n #1
@@ -1003,45 +1003,201 @@
   }
 \pdfdict_new:n { g__pdf_Core/Xform/Resources/Properties}
 %% File: ltdocinit.dtx
-\msg_new:nnn  { document } { setup-after-documentclass }
+\clist_new:N \g__pdfmanagement_firstaidoff_clist
+\tl_new:N \g__pdfmanagement_testphase_tl
+\cs_if_free:NT \DocumentMetadata
+  {
+    \keys_define:nn { document / metadata }
+      {
+        backend .choices:nn =
+          { dvipdfmx , dvips , dvisvgm , luatex , pdftex , pdfmode , xdvipdfmx , xetex }
+          {
+            \sys_load_backend:n {#1}
+          },
+        backend .groups:n = { init } ,
+      }
+
+    \keys_define:nn { document / metadata }
+      {
+        ,pdfversion .code:n =
+          {
+            \pdf_version_gset:n { #1 }
+            \AddToDocumentProperties[document]{pdfversion}{#1}
+          }
+        ,uncompress .code:n =
+          {
+            \pdf_uncompress:
+          }
+        ,uncompress .value_forbidden:n = true
+        ,lang .code:n =
+          {
+            \pdfmanagement_add:nnn {Catalog} {Lang}{(#1)}
+            \AddToDocumentProperties[document]{lang}{#1}
+          }
+        %,xmpmeta .bool_gset:N = \g_pdfmeta_xmp_bool %see pdfmeta unused and undefined for now!
+        % this uses internal command from pdfmeta, it should probably move there ...
+        ,pdfstandard .code:n =
+          {
+            \exp_args:Nnx
+            \keys_set:nn {document / metadata} {_pdfstandard=\str_uppercase:n{#1}}
+          }
+        ,_pdfstandard .choices:nn =
+          {A-1B,A-2A,A-2B,A-2U,A-3A,A-3B,A-3U}
+          {
+            \prop_if_exist:cT { g__pdfmeta_standard_pdf/#1_prop }
               {
-                \token_to_str:N \DeclareDocumentMetadata \c_space_tl
-                should~be~used~only~before~\token_to_str:N\documentclass
+                \prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/#1 _prop }
               }
-\NewDocumentCommand\DeclareDocumentMetadata { m }
+            \AddToDocumentProperties [document]{pdfstandard}{#1}
+          }
+        ,_pdfstandard / unknown .code:n =
+          {
+            \msg_warning:nnn{pdf}{unknown-standard}{#1}
+          }
+        ,testphase .multichoice:
+        ,testphase / tagpdf .code:n =
+          {
+            \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
+              {
+                \file_if_exist_input:nF {tagpdf-latex-lab-testphase.ltx}
+                  {
+                    \RequirePackage{tagpdf}
+                    \AddToDocumentProperties [document]{testphase/tagpdf}{loaded}
+                    \tagpdfsetup{activate,paratagging,interwordspace}
+                    \AddToDocumentProperties [document]{tagging}{active}
+                    \AddToDocumentProperties [document]{tagging/para}{active}
+                    \AddToDocumentProperties [document]{tagging/interwordspace}{active}
+                  }
+              }
+          }
+        ,testphase / unknown .code:n =
+          {
+            \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
+               {
+                 \file_if_exist_input:nF {#1-latex-lab-testphase.ltx}
+                  {
+                     \msg_warning:nnn{document}{latex-lab-pkg-missing}{#1}
+                  }
+               }
+          }
+        ,activate .multichoice:
+        ,activate / tagging .code:n =
+          {
+            \PackageWarning{pdfmanagement-testphase}
+             {The~activate~key~is~deprecated.\MessageBreak
+              Tagging~is~activated~with~'testphase=tagpdf'~directly}{}
+          }
+        ,debug .code:n =
+          {
+            \keys_set:nn { document / metadata / debug } {#1}
+          }
+        ,debug / para .code:n =
+          {
+            \AddToHook
+              {
+                package/tagpdf/after
+              }
+              {
+                 \tagpdfsetup{paratagging-show}
+              }
+          }
+        ,debug / log .code:n =
+          {
+            \AddToHook
+              {
+               package/tagpdf/after
+              }
+              {
+                 \tagpdfsetup{log=#1}
+              }
+          }
+        ,debug / uncompress .code:n =
+          {
+            \pdf_uncompress:
+          }
+        ,debug / pdfmanagement .bool_gset:N = \g__pdfmanagement_active_bool
+        ,debug / firstaidoff .clist_gset:N = \g__pdfmanagement_firstaidoff_clist
+      }
+   }
+\cs_if_exist:NT \DocumentMetadata
+   {
+     \cs_new_protected:Npn \DeclareDocumentMetadata
+        {
+          \cs_if_free:NT \DocumentMetadata
+            {
+              \file_if_exist_input:nF {documentmetadata-support.ltx}%
+               {
+                 \@latex at error
+                   {No~support~files~for~\noexpand\DeclareDocumentMetadata~found}
+                   {
+                     Is~the~'LaTeX-lab'~bundle~installed?
+                     \MessageBreak
+                     Without~it,~the~declaration~is~ignored.
+                   }
+                \let\DeclareDocumentMetadata\@gobble
+               }
+            }
+          \RenewDocumentCommand \DeclareDocumentMetadata {}
+           { \DocumentMetadata }
+          \DocumentMetadata
+        }
+    }
+\cs_if_free:NT \DocumentMetadata
   {
-    \cs_if_eq:NNTF \documentclass \@twoclasseserror
-      { \msg_error:nn { document }{ setup-after-documentclass } }
+    \prop_gput:Nnn \g_msg_module_type_prop { document } { LaTeX }
+    \prop_gput:Nnn \g_msg_module_name_prop { document } { DocumentMetadata }
+    \msg_new:nnn
+      { document } { setup-after-documentclass }
       {
-        \keys_set_groups:nnn { document / metadata} {init}{ #1 }
-        %should be loaded after the backend is set, and only if not in the kernel
-        \bool_gset_true:N \g__pdfmanagement_active_bool
-        \cs_if_free:NTF \pdf_uncompress:
-         {\RequirePackage{l3pdf}}{\RequirePackage{expl3}}
+        \token_to_str:N \DocumentMetadata \c_space_tl
+        should~be~used~only~before~\token_to_str:N\documentclass
+      }
+    \msg_new:nnn
+      { document } { latex-lab-pkg-missing }
+      {
+        LaTeX-lab~package~'#1'~not~found.
+      }
+    \NewDocumentCommand\DocumentMetadata { m }
+      {
+        \cs_if_eq:NNTF \documentclass \@twoclasseserror
+          { \msg_error:nn { document }{ setup-after-documentclass } }
+          {
+            \bool_gset_true:N \g__pdfmanagement_active_bool
+            \keys_set_groups:nnn { document / metadata} {init}{ #1 }
+        %if no backend has been loaded force it now:
+            \str_if_exist:NF \c_sys_backend_str
+              {
+                \sys_load_backend:n {}
+              }
         \ExplSyntaxOn\makeatletter
-          \file_input:n {l3backend-testphase-\c_sys_backend_str.def}
+              \file_input:n {l3backend-testphase-\c_sys_backend_str.def}
         \ExplSyntaxOff\makeatother
-        \keys_set_filter:nnn  { document / metadata } { init } { lang=en-US, #1 }
-        \bool_if:NT \g__pdfmanagement_active_bool
-          {
-            \PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
+            \keys_set_filter:nnn  { document / metadata } { init } { lang=en-US, #1 }
+            \bool_if:NT \g__pdfmanagement_active_bool
+              {
+                \PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
+              }
+           \hook_use_once:n {pdfmanagement/add}
+           \RenewDocumentCommand\DocumentMetadata { m }
+              {
+                \keys_set_filter:nnn  { document / metadata } { init } { ##1 }
+                \bool_if:NTF \g__pdfmanagement_active_bool
+                  {
+                    \str_remove_all:cn
+                      {opt at hyperref.sty}{customdriver=hgeneric-testphase}
+                    \PassOptionsToPackage
+                      {customdriver=hgeneric-testphase}{hyperref}
+                 }
+                 {
+                   \str_remove_all:cn
+                     {opt at hyperref.sty}{customdriver=hgeneric-testphase}
+                 }
+              }
+            \g__pdfmanagement_testphase_tl
+            \RequirePackage{pdfmanagement-firstaid}
           }
-        \hook_use_once:n {pdfmanagement/add}
-        \RenewDocumentCommand\DeclareDocumentMetadata { m }
-          {
-            \keys_set_filter:nnn  { document / metadata } { init } { ##1 }
-            \bool_if:NTF \g__pdfmanagement_active_bool
-             {
-               \str_remove_all:cn {opt at hyperref.sty}{customdriver=hgeneric-testphase}
-               \PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref}
-             }
-             {
-               \str_remove_all:cn {opt at hyperref.sty}{customdriver=hgeneric-testphase}
-             }
-          }
-        \g__pdfmanagement_testphase_tl
-        \RequirePackage{pdfmanagement-firstaid}
       }
+    \NewDocumentCommand\DeclareDocumentMetadata{}{\DocumentMetadata}
   }
 \prop_new:N \g__pdfmanagement_documentproperties_prop %
 \NewDocumentCommand\AddToDocumentProperties{O{\@currname}mm}
@@ -1069,130 +1225,6 @@
         \prop_map_function:NN \g__pdfmanagement_documentproperties_prop \msg_show_item:nn
       }
   }
-\clist_new:N \g__pdfmanagement_firstaidoff_clist
-\tl_new:N \g__pdfmanagement_testphase_tl
-\keys_define:nn { document / metadata }
-  {
-    backend .code:n =
-      {
-        \PassOptionsToPackage { driver=#1 } {expl3}
-        \AddToDocumentProperties[document]{backend}{#1}
-      },
-    backend .groups:n = { init } ,
-  }
-
-\keys_define:nn { document / metadata }
-  {
-    ,pdfversion .code:n =
-      {
-        \pdf_version_gset:n { #1 }
-        \AddToDocumentProperties[document]{pdfversion}{#1}
-      }
-    ,uncompress .code:n =
-      {
-        \pdf_uncompress:
-      }
-    ,uncompress .value_forbidden:n = true
-    ,lang .code:n =
-      {
-        \pdfmanagement_add:nnn {Catalog} {Lang}{(#1)}
-        \AddToDocumentProperties[document]{lang}{#1}
-      }
-    %,xmpmeta .bool_gset:N = \g_pdfmeta_xmp_bool %see pdfmeta unused and undefined for now!
-    % this uses internal command from pdfmeta, it should probably move there ...
-    ,pdfstandard .code:n =
-      {
-        \exp_args:Nnx
-        \keys_set:nn {document / metadata} {_pdfstandard=\str_uppercase:n{#1}}
-      }
-    ,_pdfstandard .choices:nn =
-      {A-1B,A-2A,A-2B,A-2U,A-3A,A-3B,A-3U}
-      {
-        \prop_if_exist:cT { g__pdfmeta_standard_pdf/#1_prop }
-          {
-            \prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/#1 _prop }
-          }
-        \AddToDocumentProperties [document]{pdfstandard}{#1}
-      }
-    ,_pdfstandard / unknown .code:n =
-      {
-        \msg_warning:nnn{pdf}{unknown-standard}{#1}
-      }
-    ,pdfmanagement .bool_gset:N = \g__pdfmanagement_active_bool
-    ,firstaidoff .clist_gset:N = \g__pdfmanagement_firstaidoff_clist
-    ,testphase .multichoice:
-    ,testphase / tagpdf .code:n =
-      {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
-          {
-            \RequirePackage{tagpdf}
-            \AddToDocumentProperties [document]{testphase/tagpdf}{loaded}
-          }
-      }
-    ,testphase / headings .code:n =
-      {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
-          {
-            \RequirePackage{headings-testphase}
-            \AddToDocumentProperties [document]{testphase/headings}{loaded}
-          }
-      }
-    ,testphase / ptagging .code:n =
-      {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
-          {
-            \AddToHook{class/after}
-              {
-                \RequirePackage{ptagging-testphase}
-                \AddToDocumentProperties [document]{testphase/ptagging}{loaded}
-              }
-          }
-      }
-    ,testphase / unknown .code:n =
-      {
-        \tl_gput_right:Nn\g__pdfmanagement_testphase_tl
-           {
-             \AddToHook{class/after}
-               {
-                 \RequirePackage{#1-testphase}
-                 \AddToDocumentProperties [document]{testphase/#1}{loaded}
-               }
-           }
-      }
-    ,activate .multichoice:
-    ,activate / tagging .code:n =
-      {
-        \AddToHook{package/after/tagpdf}
-          {
-            \tagpdfsetup{activate,paratagging,interwordspace}
-            \AddToDocumentProperties [document]{tagging}{active}
-            \AddToDocumentProperties [document]{tagging/para}{active}
-            \AddToDocumentProperties [document]{tagging/interwordspace}{active}
-          }
-      }
-    ,debug .code:n =
-      {
-        \keys_set:nn { document / metadata / debug } {#1}
-      }
-    ,debug / para .code:n =
-      {
-        \AddToHook{package/after/tagpdf}
-          {
-            \tagpdfsetup{paratagging-show}
-          }
-      }
-    ,debug / log .code:n =
-      {
-        \AddToHook{package/after/tagpdf}
-          {
-            \tagpdfsetup{log=#1}
-          }
-      }
-    ,debug / uncompress .code:n =
-      {
-        \pdf_uncompress:
-      }
-  }
 %% File: l3pdfannot.dtx
 \RequirePackage{l3bitset}
 \bitset_new:Nn \l_pdfannot_F_bitset
@@ -1510,7 +1542,7 @@
      { \__pdfmeta_verify_pdfa_annot_flags: }
   }
 \prop_new:c { g__pdfmeta_standard_pdf/A-1B_prop }
-\prop_set_from_keyval:cn { g__pdfmeta_standard_pdf/A-1B_prop }
+\prop_gset_from_keyval:cn { g__pdfmeta_standard_pdf/A-1B_prop }
   {
     ,name             = pdf/A-1B
     ,type             = A
@@ -1953,8 +1985,9 @@
 \tl_new:N  \l__pdffile_automimetype_tl
 \tl_new:N  \l__pdffile_embed_ref_tl
 \prop_new:N \g_pdffile_mimetypes_prop
-\prop_set_from_keyval:Nn \g_pdffile_mimetypes_prop
+\prop_gset_from_keyval:Nn \g_pdffile_mimetypes_prop
   {
+    ,.css = text/css
     ,.csv = text/csv
     ,.html= text/html
     ,.dtx = text/plain %or application/x-tex, not in iana.org list

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty	2022-01-13 21:05:04 UTC (rev 61599)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: pdfmanagement-testphase.dtx
-\ProvidesExplPackage{pdfmanagement-testphase}{2021-08-28}{0.95i}
+\ProvidesExplPackage{pdfmanagement-testphase}{2022-01-13}{0.95j}
   {LaTeX PDF management testphase bundle}
 \providecommand\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
 \IfFormatAtLeastTF{2020-10-01}{}{
@@ -28,6 +28,7 @@
     \MessageBreak Loading~is~aborted.}{}
  \DeclareOption { debug }{}
  \newcommand\DeclareDocumentMetadata[1]{}
+ \newcommand\DocumentMetadata[1]{}
  \ProcessOptions\relax
  }
 \IfFormatAtLeastTF{2020-10-01}{}{\endinput}

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty	2022-01-13 21:05:04 UTC (rev 61599)
@@ -3,7 +3,7 @@
 %% a replacement for transparent sty from Heiko Oberdiek
 %%
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\ProvidesExplPackage{transparent-ltx}{2021-08-28}{0.95i}
+\ProvidesExplPackage{transparent-ltx}{2022-01-13}{0.95j}
   {Transparency with color stacks (replacement for transparent.sty from Heiko Oberdiek)}%
 
 \RequirePackage{l3opacity}

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty	2022-01-13 21:03:32 UTC (rev 61598)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty	2022-01-13 21:05:04 UTC (rev 61599)
@@ -1,6 +1,6 @@
 %% LaTeX2e file `xcolor-patches.sty'
 %%
-\ProvidesPackage{xcolor-patches-tmp-ltx}[2021-08-28 v0.95i patch xcolor for l3color]
+\ProvidesPackage{xcolor-patches-tmp-ltx}[2022-01-13 v0.95j patch xcolor for l3color]
 \@ifundefined{color_set:nn}{\RequirePackage{l3color}}{}
 
 \ExplSyntaxOn



More information about the tex-live-commits mailing list.