texlive[60127] Master/texmf-dist: pdfmanagement-testphase (31jul21)

commits+karl at tug.org commits+karl at tug.org
Sat Jul 31 22:56:25 CEST 2021


Revision: 60127
          http://tug.org/svn/texlive?view=revision&revision=60127
Author:   karl
Date:     2021-07-31 22:56:25 +0200 (Sat, 31 Jul 2021)
Log Message:
-----------
pdfmanagement-testphase (31jul21)

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/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/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/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/l3backend-testphase.lua
    trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/CHANGELOG.md	2021-07-31 20:56:25 UTC (rev 60127)
@@ -4,6 +4,23 @@
 
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 this project uses date-based 'snapshot' version identifiers.
+
+
+## [2021-07-31]
+### Added 
+ - \IfPDFManagementActiveTF as copy of `\pdfmanagement_if_active:TF
+ - \PDFManagementAdd as copy of `\pdfmanagement_add:xxx`
+ - Support for name trees /AP and /JavaScript in Catalog/Names
+ - Support to add user file names to /EmbeddedFiles (beside the existing 
+   way with automatically generated names)
+ - if xcolor is loaded the colors it predefines are now predefined also for l3color  
+
+### Changed 
+ - Implementation of the /EmbeddedFiles name tree, it is now more in line
+   with the other name trees.
+ - \Form no longer creates xform objects -- this affected spacing and produced
+   empty pages. The xform objects are now only created if fields are used.  
+   
 ## [2021-07-21]
 ### Added
  - key `testphase` to \DeclareDocumentMetadata to load testphase packages like

Modified: trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md	2021-07-31 20:56:25 UTC (rev 60127)
@@ -1,6 +1,6 @@
 # LaTeX PDF management testphase bundle
 
-Version: 0.95g, 2021-07-21
+Version: 0.95h, 2021-07-31
 
 This package is used during a test phase to load the new PDF management code
 of LaTeX.

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/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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -86,7 +86,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -906,9 +906,6 @@
 %^^A %% \l_@@_para_tmpa_tl
 %^^A %% \l_@@_text_tmpa_str
 %^^A %% \g_@@_text_tmpa_str
-%^^A %% \l_@@_CheckmarkYes_tl
-%^^A %% \l_@@_CheckmarkOff_tl
-%^^A %% \l_@@_RadioYes_tl
 %^^A %% \g_@@_bordercolormodel_tl
 %
 %^^A %% \l_@@_dest_pdfview_tl
@@ -921,7 +918,7 @@
 %<@@=hyp>
 %    \end{macrocode}
 %    \begin{macrocode}
-\ProvidesFile{hgeneric-testphase.def}[2021-07-21 v0.95g %
+\ProvidesFile{hgeneric-testphase.def}[2021-07-31 v0.95h %
   generic Hyperref driver for the LaTeX PDF management testphase bundle]
 
 \RequirePackage{etoolbox} %why?
@@ -2482,7 +2479,7 @@
 % \end{hypkey}
 % \begin{hypkey}{colorurl,colorlink,colorrun,colormenu,colorfile}
 % \begin{hypkey}{urlcolor,linkcolor,runcolor,menucolor,filecolor}
-% \begin{hypkey}{allcolor}
+% \begin{hypkey}{allcolors}
 %    \begin{macrocode}
 \seq_map_inline:Nn \c_@@_annot_types_seq
   {
@@ -4215,14 +4212,9 @@
 
 \ExplSyntaxOff
 \ExplSyntaxOn
-\tl_new:N  \l_@@_CheckmarkYes_tl
-\tl_set:Nn \l_@@_CheckmarkYes_tl {  @@_xform_CheckMarkYes }
-\tl_new:N  \l_@@_CheckmarkOff_tl
-\tl_set:Nn \l_@@_CheckmarkOff_tl {  @@_xform_CheckMarkOff }
 
 \def\@Form[#1]
   {
-    \@ifundefined{textcolor}{\let\textcolor\@gobble}{}
     \kvsetkeys{Form}{#1}
     \pdf at ifdraftmode{}
       {
@@ -4240,8 +4232,7 @@
               }
             \seq_sort:Nn \l_@@_tmpa_seq
               {
-                \int_compare:nNnTF { \pdf at strcmp{##1}{##2} } > { 0 }
-                %\str_compare:nNnTF {##1} > {##2}
+                \str_compare:nNnTF {##1} > {##2}
                   { \sort_return_swapped: }
                   { \sort_return_same: }
               }
@@ -4271,64 +4262,6 @@
            \pdfmanagement_remove:nn {Catalog / AcroForm }{NeedAppearances}
          }
        }
-     \MakeFieldObject
-       {
-         \group_begin:
-         \fontfamily{pzd}
-         \fontencoding{U}
-         \fontseries{m}
-         \fontshape{n}
-         \selectfont
-         \char123
-         \group_end:
-       }
-       {@@_xform_Ding}
-    \MakeFieldObject
-       {
-         \group_begin:
-         \fontfamily{pzd}
-         \fontencoding{U}
-         \fontseries{m}
-         \fontshape{n}
-         \selectfont
-         \phantom{\char123}
-         \group_end:
-       }
-       {@@_xform_DingOff}
-     \MakeFieldObject
-       {
-         \group_begin:
-         \fontfamily{pzd}
-         \fontencoding{U}
-         \fontseries{m}
-         \fontshape{n}
-         \selectfont
-         \char51
-         \group_end:
-       }
-       {@@_xform_CheckMarkYes}
-     \MakeFieldObject
-       {
-        \group_begin:
-         \fontfamily{pzd}
-         \fontencoding{U}
-         \fontseries{m}
-         \fontshape{n}
-         \selectfont
-         \phantom{\char51} %perhaps xetex needs some small glyph ..
-         \group_end:
-       }
-       {@@_xform_CheckMarkOff}
-     \MakeFieldObject
-       {
-         \fbox{\textcolor{yellow}{\textsf{Submit}}} %color?
-       }
-       {@@_xform_Submit}
-     \MakeFieldObject
-       {
-         \fbox{\textcolor{yellow}{\textsf{SubmitP}}} %color?
-       }
-       {@@_xform_SubmitP}
   }
 \ExplSyntaxOff
 \let\@endForm\ltx at empty
@@ -4468,8 +4401,7 @@
     }%
   \endgroup
 }
-\tl_new:N  \l_@@_RadioYes_tl
-\tl_set:Nn \l_@@_RadioYes_tl { @@_xform_Ding }
+
 \def\@@Radio#1{%
   \Fld at listcount=0~%
   %\show\Fld at default
@@ -4484,7 +4416,21 @@
     \leavevmode
     \HyAnn at AbsPageLabel
     \Hy at escapeform\PDFForm at Radio
-    \pdfannot_box:nnnn
+    \pdfxform_if_exist:nF { @@_xform_Ding }
+      {
+        \pdfxform_new:nnn { @@_xform_Ding } {}
+         {
+           \group_begin:
+           \fontfamily{pzd}
+           \fontencoding{U}
+           \fontseries{m}
+           \fontshape{n}
+           \selectfont
+           \char123
+           \group_end:
+         }
+      }
+    \pdfannot_box:nnnx
       {\Fld at width}
       {\Fld at height}
       {0pt} %is this correct?
@@ -4494,7 +4440,7 @@
          <<
          /N
           <<
-          /\@currValue\c_space_tl \pdfxform_ref:o {@@_xform_Ding}
+          /\@currValue\c_space_tl \pdfxform_ref:n {@@_xform_Ding}
           %/Off \c_space_tl \pdfxform_ref:n {@@_xform_DingOff} %hm
           >>
          >>
@@ -4582,6 +4528,18 @@
     \HyAnn at AbsPageLabel
     \Hy at escapeform\PDFForm at Submit
     \hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}}
+    \pdfxform_if_exist:nF
+     { @@_xform_Submit }
+     {
+       \pdfxform_new:nnn { @@_xform_Submit }{}
+        {
+          \fbox{\color_select:n{yellow}\textsf{Submit}}
+        }
+       \pdfxform_new:nnn { @@_xform_SubmitP }{}
+        {
+          \fbox{\color_select:n{yellow}\textsf{SubmitP}}
+        }
+     }
     \pdfannot_box:nnnn
       {\box_wd:N\l_tmpa_box}
       {\box_ht:N\l_tmpa_box}
@@ -4654,6 +4612,33 @@
           \mode_leave_vertical:
           \HyAnn at AbsPageLabel
           \Hy at escapeform\PDFForm at Check
+          \pdfxform_if_exist:nF { @@_xform_CheckMarkYes }
+             {
+               \pdfxform_new:nnn
+                {@@_xform_CheckMarkYes}{}
+                {
+                  \group_begin:
+                  \fontfamily{pzd}
+                  \fontencoding{U}
+                  \fontseries{m}
+                  \fontshape{n}
+                  \selectfont
+                  \char51
+                  \group_end:
+                }
+               \pdfxform_new:nnn
+                {@@_xform_CheckMarkOff}{}
+                {
+                  \group_begin:
+                  \fontfamily{pzd}
+                  \fontencoding{U}
+                  \fontseries{m}
+                  \fontshape{n}
+                  \selectfont
+                  \phantom{\char51} %perhaps xetex needs some small glyph ..
+                  \group_end:
+                }
+             }
           \pdfannot_box:nnnn
             {\Fld at width}
             {\Fld at height}
@@ -4874,8 +4859,8 @@
      <<
       /N
         <<
-          /Yes~\pdfxform_ref:o{\l_@@_CheckmarkYes_tl}
-          /Off~\pdfxform_ref:o{\l_@@_CheckmarkOff_tl}
+          /Yes~\pdfxform_ref:n{@@_xform_CheckMarkYes}
+          /Off~\pdfxform_ref:n{@@_xform_CheckMarkOff}
         >>
     >>
   /MK<<

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -45,7 +45,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 %
@@ -56,27 +56,27 @@
 %    \begin{macrocode}
 %<drivers>\ProvidesExplFile
 %<*dvipdfmx>
-  {l3backend-testphase-dvipdfmx.def}{2021-07-21}{}
+  {l3backend-testphase-dvipdfmx.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx}
 %</dvipdfmx>
 %<*dvips>
-  {l3backend-testphase-dvips.def}{2021-07-21}{}
+  {l3backend-testphase-dvips.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvips}
 %</dvips>
 %<*dvisvgm>
-  {l3backend-testphase-dvisvgm.def}{2021-07-21}{}
+  {l3backend-testphase-dvisvgm.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm}
 %</dvisvgm>
 %<*luatex>
-  {l3backend-testphase-luatex.def}{2021-07-21}{}
+  {l3backend-testphase-luatex.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)}
 %</luatex>
 %<*pdftex>
-  {l3backend-testphase-pdftex.def}{2021-07-21}{}
+  {l3backend-testphase-pdftex.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)}
 %</pdftex>
 %<*xdvipdfmx>
-  {l3backend-testphase-xetex.def}{2021-07-21}{}
+  {l3backend-testphase-xetex.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX}
 %</xdvipdfmx>
 %    \end{macrocode}
@@ -1086,108 +1086,61 @@
 % \subsubsection { Special case: the /Names/EmbeddedFiles dictionary }
 % Entries to /Names are handled differently, in part (/Desc) it is automatic, for
 % other special commands like \cs{pdfnames} must be used. For EmbeddedFiles
-% we need some code to push the tree if files have been added. dvips wants code
-% for every file and then creates the Name tree automatically.
+% dvips wants code for every file and then creates the Name tree automatically.
+% Other name trees are ignored.
+% TODO: Currently the code for EmbeddedFiles is still a bit
+% different but this should be merged, all name trees should be handled with the
+% same code.
 %    \begin{macrocode}
 % pdflatex
 %<*pdftex>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+\cs_new_protected:Npn \@@_backend_Names_gpush:nn #1 #2 %#1 name of name tree, #2 array content
   {
-     \pdf_object_unnamed_write:nn {dict} {/Names [#1] }
-     \tex_pdfnames:D {/EmbeddedFiles~\pdf_object_ref_last:}
+     \pdf_object_unnamed_write:nn {dict} {/Names [#2] }
+     \tex_pdfnames:D {/#1~\pdf_object_ref_last:}
   }
 %</pdftex>
 %<*luatex>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+\cs_new_protected:Npn \@@_backend_Names_gpush:nn #1 #2 %#1 name of name tree, #2 array content
   {
-    \pdf_object_unnamed_write:nn {dict} {/Names [#1] }
-    \tex_pdfextension:D~names~{/EmbeddedFiles~\pdf_object_ref_last: }
+     \pdf_object_unnamed_write:nn {dict} {/Names [#2] }
+     \tex_pdfextension:D~names~ {/#1~\pdf_object_ref_last:}
   }
 %</luatex>
 %<*dvipdfmx|xdvipdfmx>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+\cs_new_protected:Npn \@@_backend_Names_gpush:nn #1 #2 %#1 name of name tree, #2 array content
   {
-    \pdf_object_unnamed_write:nn {dict} { /Names [#1] }
-    %n or x?
-    \@@_backend:x {put~@names~<</EmbeddedFiles~\pdf_object_ref_last: >>}
+     \pdf_object_unnamed_write:nn {dict} {/Names [#2] }
+     \@@_backend:x {put~@names~<</#1~\pdf_object_ref_last: >>}
   }
 %</dvipdfmx|xdvipdfmx>
 
 %dvips: noop
 %<*dvips>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 {}
+\cs_new_protected:Npn \@@_backend_Names_gpush:nn #1 #2  {}
 %</dvips>
 %dvisvgm: noop
 %<*dvisvgm>
-\cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 {}
+\cs_new_protected:Npn \@@_backend_Names_gpush:nn #1 #2 {}
 %</dvisvgm>
-
 %    \end{macrocode}
-% Names in the EmbeddedFiles name tree must sorted alphabetically,
-% so we need commands to create this names. And we need a sequence to store
-% the names and the objects. We use the prefix l3ef, and we assume that at
-% most 9999 files will be used.
-% \begin{variable}{\g_@@_backend_EmbeddedFiles_int}
-% \end{variable}
-% \begin{macro}{\@@_backend_EmbeddedFiles_name:}
+% EmbeddedFiles is a bit special.
+% For once we need backend commands for dvips.
+% But we want also an option to create the name on the fly.
+% \begin{macro}{\@@_backend_NamesEmbeddedFiles_add:nn}
+% dvips need special backend code to create the name tree.
+% With the other engines it does nothing.
 %    \begin{macrocode}
-%<*drivers>
-\int_new:N \g_@@_backend_EmbeddedFiles_int
-\cs_new:Npn \@@_backend_EmbeddedFiles_name:
- {
-   (
-    l3ef
-    \int_compare:nNnT {\g_@@_backend_EmbeddedFiles_int} < {10}
-     {0}
-    \int_compare:nNnT {\g_@@_backend_EmbeddedFiles_int} < {100}
-     {0}
-    \int_compare:nNnT {\g_@@_backend_EmbeddedFiles_int} < {1000}
-     {0}
-    \int_use:N \g_@@_backend_EmbeddedFiles_int
-   )
- }
-%</drivers>
-%    \end{macrocode}
-% \end{macro}
-% \begin{variable}{\g_@@_backend_EmbeddedFiles_seq,\g_@@_backend_EmbeddedFiles_named_prop}
-% The sequence will hold the content of the array that is pushed out at then
-% end (not with dvips), the prop holds the obj names-names relation.
-% \end{variable}
-%    \begin{macrocode}
-%<*drivers>
-\seq_new:N \g_@@_backend_EmbeddedFiles_seq
-\prop_new:N \g_@@_backend_EmbeddedFiles_named_prop
-%</drivers>
-%    \end{macrocode}
-% \begin{macro}{\@@_backend_NamesEmbeddedFiles_add:n}
-% This command saves an object reference of a filespec dictionary in the
-% EmbeddedFiles name tree. We define a prop to store the relation between
-% object name and name in the name tree.
-%    \begin{macrocode}
 %<*pdftex|luatex|dvipdfmx|xdvipdfmx>
-\cs_new_protected:Npn  \@@_backend_NamesEmbeddedFiles_add:n #1
-    %#1 object ref
-    {
-      \int_gincr:N \g_@@_backend_EmbeddedFiles_int
-      \prop_gput:Nnx \g_@@_backend_EmbeddedFiles_named_prop
-        { #1 }
-        { \@@_backend_EmbeddedFiles_name: }
-      \seq_gput_right:Nx \g_@@_backend_EmbeddedFiles_seq
-        { \@@_backend_EmbeddedFiles_name: \c_space_tl #1 }
-    }
-
+\cs_new_protected:Npn  \@@_backend_NamesEmbeddedFiles_add:nn #1 #2 {}
 %</pdftex|luatex|dvipdfmx|xdvipdfmx>
 %<*dvips>
-\cs_new_protected:Npn  \@@_backend_NamesEmbeddedFiles_add:n #1
+\cs_new_protected:Npn  \@@_backend_NamesEmbeddedFiles_add:nn #1 #2
       {
-        \int_gincr:N \g_@@_backend_EmbeddedFiles_int
-        \prop_gput:Nnx \g_@@_backend_EmbeddedFiles_named_prop
-         { #1 }
-         { \@@_backend_EmbeddedFiles_name: }
         \@@_backend_pdfmark:x
           {
-            /Name~\@@_backend_EmbeddedFiles_name:~
-            /FS~#1~
+            /Name~#1~
+            /FS~#2~
             /EMBED
           }
       }
@@ -1194,8 +1147,9 @@
 %</dvips>
 %<*dvisvgm>
 %no op. Or is there any sensible use for it?
-\cs_new_protected:Npn  \@@_backend_NamesEmbeddedFiles_add:n #1
+\cs_new_protected:Npn  \@@_backend_NamesEmbeddedFiles_add:nn #1 #2
       {}
+
 %</dvisvgm>
 %    \end{macrocode}
 % \end{macro}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -52,7 +52,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -424,7 +424,7 @@
 %    \begin{macrocode}
 %<@@=pdfannot>
 %<*header>
-\ProvidesExplPackage{l3pdfannot}{2021-07-21}{0.95g}
+\ProvidesExplPackage{l3pdfannot}{2021-07-31}{0.95h}
   {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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -212,7 +212,7 @@
 %    \begin{macrocode}
 %<@@=pdfdict>
 %<*header>
-\ProvidesExplPackage{l3pdfdict}{2021-07-21}{0.95g}
+\ProvidesExplPackage{l3pdfdict}{2021-07-31}{0.95h}
   {Tools for PDF dictionaries (LaTeX PDF management testphase bundle)}
 %</header>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -68,7 +68,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -59,7 +59,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -87,7 +87,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -73,7 +73,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -970,7 +970,7 @@
 %<*package>
 %<@@=pdffield>
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{l3pdffield-testphase}{2021-07-21}{0.95g}%
+\ProvidesExplPackage{l3pdffield-testphase}{2021-07-31}{0.95h}%
   {form fields}
 %    \end{macrocode}
 % \subsection{hyperref specific command}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -400,7 +400,7 @@
 %
 %    \begin{macrocode}
 %<*header>
-\ProvidesExplPackage{l3pdffile}{2021-07-21}{0.95g}
+\ProvidesExplPackage{l3pdffile}{2021-07-31}{0.95h}
   {embedding and referencing files in PDF---LaTeX PDF management testphase bundle}
 \RequirePackage{l3pdftools}  %temporarly!!
 %</header>

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -61,7 +61,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -137,9 +137,14 @@
 %   {\pdfmanagement_if_active:}
 %   This conditional tests if the resource management code is active.
 %  \end{function}
-%
-% \begin{function}[added = 2020-04-06]
-%   {\pdfmanagement_add:nnn,\pdfmanagement_add:nnx,\pdfmanagement_add:nxx}
+%  \begin{function}[added=2021-07-23]
+%   {\IfPDFManagementActiveTF}
+%   This is a LaTeX2e version of the conditional
+%  \end{function}
+
+% \begin{function}[added = 2020-04-06,updated=2021-07-23]
+%   {\pdfmanagement_add:nnn,\pdfmanagement_add:nnx,\pdfmanagement_add:nxx,\pdfmanagement_add:xxx,
+%    \PDFManagementAdd}
 %   \begin{syntax}
 %     \cs{pdfmanagement_add:nnn} \Arg{resource path} \Arg{name} \Arg{value}
 %   \end{syntax}
@@ -152,7 +157,8 @@
 % keys used in PDF dictionaries (see the l3pdfdict module) the name is escaped
 % with \cs{str_convert_pdfname:n} when stored.
 % \Arg{value} should be a valid PDF value for this Name in the
-% target dictionary.
+% target dictionary. |\PDFManagementAdd| is a copy of |\pdfmanagement_add:xxx|
+% and so expands all its arguments.
 %
 %
 % The code works with all major engines but not necessarily
@@ -166,6 +172,10 @@
 % backends. Some engines have to use labels and the aux-file to setup
 % the dictionaries and so need at least two compilations to put everything
 % in place.
+% \item dvips doesn't support everything. It is for example not possible
+% to add manually or through side effects
+% a name tree like /AP or /JavaScript, pdfmark doesn't provide a handler
+% here---at least I didn't find anything suitable.
 % \end{itemize}
 % \end{function}
 %
@@ -549,6 +559,61 @@
 %                                                  attach the file to the file panel.
 %   \end{tabularx}
 %
+% \paragraph{Catalog entries for name trees}
+%
+% \emph{Not supported in the dvips backend, pdfmark doesn't have an interface here}.
+%
+% In various places the PDF format allows to reference objects by name instead
+% of by object reference. The relationship between a name and the object reference
+% are store in so-called \emph{name trees}, which are stored in the
+% Catalog/Names dictionary. The |/Dests| and the |/EmbeddedFiles| name trees are
+% handled implicitly if destinations or files are added. Names to the other
+% name trees can be added with |\pdfmanagement_add:nnn|, e.g. to add an value to
+% the AP names (for appearance streams) use
+%
+% \begin{verbatim}
+% \pdfmanagement_add:nnx  { Catalog / Names / AP } {myAPname} {\pdf_object_ref_last:}
+% \end{verbatim}
+%
+% Remarks:
+% \begin{itemize}
+% \item The name |myAPname| is processed through |\pdf_string_from_unicode:nnN{utf8/string}|
+% and parentheses are added automatically. Ensure that the use of the name
+% handles it in the same way.
+% \item It is currently not possible to test if a name has already been used
+% by another package or previous code,
+% so use names where you can be confident that they are unique.
+% (It would be possible to split up the first part and test, but it would slow
+% down the compilation and I'm not sure if it is worth the trouble)
+% \item The value is not preprocessed, it is up-to-you to ensure that it does the
+% right thing.
+% \item Currently the structure of the name tree is flat, it doesn't use
+% Kids. But this can be changed if the need arise.
+% \end{itemize}
+%
+% The following name trees can be filled with this method. Currently only the
+% first three are activated. For  the first, |EmbeddedFiles| there are two methods
+% to add a value:\\
+% |\pdfmanagement_add:nnn{Catalog/Names/EmbeddedFiles}{name}{reference}|
+% and
+% |\pdfmanagement_add:nnn{Catalog/Names}{EmbeddedFiles}{reference}|.
+% This is intended, the second methods creates a name on the fly (with the prefix l3ef)
+%
+% \medskip
+% \noindent
+% \begin{tabularx}{\linewidth}{ll>{\raggedright\arraybackslash}X}
+% Catalog/Names/EmbeddedFiles & A name tree mapping name strings to file
+% specifications for embedded file streams. The value should be a reference to a filespec
+% dictionary\\
+% Catalog/Names/AP & A name tree mapping name strings to annotation appearance streams\\
+% Catalog/Names/JavaScript & A name tree mapping name strings to documentlevel ECMAScript actions\\
+% (inactive) Catalog/Names/Pages & A name tree mapping name strings to visible pages for use in interactive forms\\
+% (inactive) Catalog/Names/Templates & A name tree mapping name strings to invisible pages for use in interactive forms\\
+% (inactive) Catalog/Names/IDS & A name tree mapping digital identifiers to Web.Capture content sets\\
+% (inactive) Catalog/Names/URLS & A name tree mapping name strings to documentlevel ECMAScript actions\\
+% (inactive) Catalog/Names/Renditions & A name tree mapping name strings (which shall have Unicode encoding) to rendition objects
+%  (it is not quite clear yet, what unicode encoding means here. Perhaps this string will need special handling)\\
+% \end{tabularx}
 % \end{documentation}
 %
 % \begin{implementation}
@@ -557,7 +622,7 @@
 %<@@=pdfmanagement>
 %<*header>
 %
-\ProvidesExplPackage{l3pdfmanagement}{2021-07-21}{0.95g}
+\ProvidesExplPackage{l3pdfmanagement}{2021-07-31}{0.95h}
   {Management of core PDF dictionaries (LaTeX PDF management testphase bundle)}
 %</header>
 %    \end{macrocode}
@@ -576,6 +641,9 @@
 \msg_new:nnn  { pdfmanagement } { no-show }
               { It~is~not~possible~to~show~the~content~of~'#1'.}
 
+\msg_new:nnn  { pdfmanagement } { name-exist }
+              { The~name~'#1'~has~already~been~used~for~name~tree~'#2'.}
+
 \msg_new:nnn  { pdfmanagement } { show-dict }
   {
     The~PDF~resource~'#1'~
@@ -593,6 +661,16 @@
     command~'#1'~ignored.
   }
 %    \end{macrocode}
+%
+% \begin{variable}{\l_@@_tmpa_tl,\l_@@_tmpb_tl,\l_@@_tmpa_seq}
+% Some temp variables
+%    \begin{macrocode}
+\tl_new:N \l_@@_tmpa_tl
+\tl_new:N \l_@@_tmpb_tl
+\seq_new:N \l_@@_tmpa_seq
+%    \end{macrocode}
+% \end{variable}
+
 % \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.
@@ -612,6 +690,7 @@
 \prg_set_eq_conditional:NNn
   \pdfmanagement_if_active: \@@_if_active: { p , T , F , TF }
 
+\cs_set_eq:NN \IfPDFManagementActiveTF\pdfmanagement_if_active:TF
 %    \end{macrocode}
 % We use a hook, to collect value added before the backend is ready.
 %    \begin{macrocode}
@@ -639,7 +718,8 @@
       }
   }
 
-\cs_generate_variant:Nn \pdfmanagement_add:nnn {nnx,nxx}
+\cs_generate_variant:Nn \pdfmanagement_add:nnn {nnx,nxx,xxx}
+\cs_set_eq:NN \PDFManagementAdd \pdfmanagement_add:xxx
 %    \end{macrocode}
 % \subsection{Hooks -- shipout and end of run code}
 % Code is executed in three places: At shipout of every page,
@@ -1006,6 +1086,7 @@
 %  \end{variable}
 %  \begin{macro}{ \@@_catalog_XX_gput:n }
 % Various commands to handle subentries and special cases.
+% At first we set up a few lists of the various types.
 %    \begin{macrocode}
 \pdfdict_new:n { g__pdf_Core/Catalog}
 
@@ -1059,8 +1140,24 @@
     AcroForm/CO
   }
 
-
-
+%    \end{macrocode}
+% Names trees in Catalog/Names. We prepare the full list
+% but activate only AP and JavaScript for now.
+% /EmbeddedFiles has special code and so is not in the name list.
+%    \begin{macrocode}
+\clist_const:Nn \c_@@_Catalog_nametree_clist
+  {
+    AP,
+    JavaScript,
+%   Pages,
+%   Templates,
+%   IDS,
+%   URLS,
+%   Renditions
+  }
+%    \end{macrocode}
+% now we create the handler. The entries in the seq-list store in a seq
+%    \begin{macrocode}
 \clist_map_inline:Nn \c_@@_Catalog_seq_clist
  {
    \seq_new:c { g_@@_/Catalog/#1_seq } % new name later
@@ -1070,6 +1167,10 @@
      }
  }
 
+%    \end{macrocode}
+% OCProperties/D is special: it handles a default. This is done by adding to
+% the left of the seq
+%    \begin{macrocode}
 \cs_new_protected:cpn { @@_handler/Catalog/OCProperties/D_gput:n } #1
   {
     \seq_gput_left:cn
@@ -1077,6 +1178,58 @@
       {  #1  }
   }
 %    \end{macrocode}
+% The name tree keys store in a property and check for duplicates. This is done
+% with an auxiliary.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_nametree_add_aux:nnn #1 #2 #3
+  %#1 name tree, #2 sanitized name #3 value
+  {
+     \prop_get:coNTF
+       { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/#1 }}
+       { #2 }
+       \l_@@_tmpb_tl
+       {
+         \msg_error:nnnn{pdfmanagement}{name-exist}{#2}{#1}
+       }
+       {
+         \prop_gput:con
+           { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/#1 }}
+           { #2 }
+           { #3 }
+       }
+  }
+%    \end{macrocode}
+% This is the standard handler for most names trees:
+%    \begin{macrocode}
+\clist_map_inline:Nn \c_@@_Catalog_nametree_clist
+ {
+   \pdfdict_new:n { g__pdf_Core/Catalog/Names/#1}
+   \cs_new_protected:cpn { @@_handler/Catalog/Names/#1/?_gput:nn } ##1 ##2
+     {
+       \pdf_string_from_unicode:nnN {utf8/string}{##1}\l_@@_tmpa_tl
+       \exp_args:Nno
+         \@@_nametree_add_aux:nnn {#1}{\l_@@_tmpa_tl}{##2}
+     }
+ }
+%    \end{macrocode}
+% EmbeddedFiles is a bit special. For once there is special backend code
+% needed by dvips. Beside this we also want the option to create the file name
+% on the fly, so they are actually two access methods:
+% |\pdfmanagement_add:nnn{Catalog/Names/EmbeddedFiles}{name}{reference}|
+% and
+% |\pdfmanagement_add:nnn{Catalog/Names}{EmbeddedFiles}{reference}|
+%    \begin{macrocode}
+\pdfdict_new:n { g__pdf_Core/Catalog/Names/EmbeddedFiles}
+\cs_new_protected:cpn { @@_handler/Catalog/Names/EmbeddedFiles/?_gput:nn } #1 #2
+  {
+    \pdf_string_from_unicode:nnN {utf8/string}{#1}\l_@@_tmpa_tl
+    \exp_args:Nno
+    \@@_nametree_add_aux:nnn
+      {EmbeddedFiles}{\l_@@_tmpa_tl}{#2}
+    \exp_args:No
+    \__pdf_backend_NamesEmbeddedFiles_add:nn {\l_@@_tmpa_tl}{#2}
+  }
+%    \end{macrocode}
 % \end{macro}
 % % \paragraph {Building the catalog: Push order}
 % \begin{macro}{\@@_Catalog_gpush:}
@@ -1099,7 +1252,11 @@
       { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog} }
       \__pdf_backend_catalog_gput:nn
     % output names tree:
-    \use:c { @@_/Catalog/Names/EmbeddedFiles_gpush: }
+    \use:c{ @@_/Catalog/Names_gpush:n } {EmbeddedFiles}
+    \clist_map_inline:Nn \c_@@_Catalog_nametree_clist
+     {
+      \use:c{ @@_/Catalog/Names_gpush:n } {##1}
+     }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1283,12 +1440,12 @@
       { 0 }
       {
         \__pdf_backend_object_new:nn  { @@/Catalog/OCProperties } { dict }
-        \seq_gpop_left:cN { g_@@_/Catalog/OCProperties/Configs_seq} \l_tmpa_tl
+        \seq_gpop_left:cN { g_@@_/Catalog/OCProperties/Configs_seq} \l_@@_tmpa_tl
         \exp_args:Nnx
           \__pdf_backend_object_write:nn {@@/Catalog/OCProperties}
             {
               /OCGs~[ \seq_use:cn { g_@@_/Catalog/OCProperties/OCGs_seq } {~} ]
-              /D~\l_tmpa_tl~
+              /D~\l_@@_tmpa_tl~
               \seq_if_empty:cF { g_@@_/Catalog/OCProperties/Configs_seq }
                 {
                   /Configs~
@@ -1382,6 +1539,30 @@
 % \begin{NOTE}{UF}
 % TODO access function for the name in the name tree
 % \end{NOTE}
+% \begin{variable}{\g_@@_EmbeddedFiles_int}
+% We want to create names for files on the fly. For this we use an int.
+%    \begin{macrocode}
+\int_new:N \g_@@_EmbeddedFiles_int
+%    \end{macrocode}
+% \end{variable}
+% \begin{macro}{\@@_EmbeddedFiles_name:}
+% We use the prefix l3ef, and pad numbers below 9999.
+%    \begin{macrocode}
+\cs_new:Npn \@@_EmbeddedFiles_name:
+ {
+   (
+    l3ef
+    \int_compare:nNnT {\g_@@_EmbeddedFiles_int} < {10}
+     {0}
+    \int_compare:nNnT {\g_@@_EmbeddedFiles_int} < {100}
+     {0}
+    \int_compare:nNnT {\g_@@_EmbeddedFiles_int} < {1000}
+     {0}
+    \int_use:N \g_@@_EmbeddedFiles_int
+   )
+ }
+%    \end{macrocode}
+% \end{macro}
 % \begin{macro}{ Handler}
 % EmbeddedFiles is an array and needs a special handler to add values.
 %    \begin{macrocode}
@@ -1389,25 +1570,44 @@
 
 \cs_new_protected:cpn { @@_handler/Catalog/Names/EmbeddedFiles_gput:n } #1
   {
-    \__pdf_backend_NamesEmbeddedFiles_add:n { #1 }
+    \int_gincr:N \g_@@_EmbeddedFiles_int
+    \exp_args:Nnx
+    \prop_gput:cnn
+      { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/EmbeddedFiles }}
+      { \@@_EmbeddedFiles_name: }
+      { #1 }
+     \exp_args:Nx
+     \__pdf_backend_NamesEmbeddedFiles_add:nn {\@@_EmbeddedFiles_name:} { #1 }
   }
 %    \end{macrocode}
 % \end{macro}
-% The entry should only be added if there are actually embedded files.
-% This can be tested by checking the names_seq
-% \begin{macro}{\@@_/Catalog/Names/EmbeddedFiles_gpush:}
+% This pushes out the other names trees (but not with dvips).
+% TODO: currently it simply write in the root of the name tree.
+% That is the fastest.
+% If they get longer we perhaps need to build something with Kids and Limits.
+% \begin{macro}{\@@_/Catalog/Names/?_gpush:}
 %    \begin{macrocode}
-%
-\cs_new_protected:cpn { @@_/Catalog/Names/EmbeddedFiles_gpush: }
-  {
-    \seq_if_empty:NF \g__pdf_backend_EmbeddedFiles_seq
-      {
-        \exp_args:Nx \__pdf_backend_NamesEmbeddedFiles_gpush:n
-          {
-            \seq_use:Nn \g__pdf_backend_EmbeddedFiles_seq {~}
-          }
-      }
-  }
+\cs_new_protected:cpn  { @@_/Catalog/Names_gpush:n } #1 %#1 name of name tree
+ {
+   \pdfdict_if_empty:nF { g__pdf_Core/Catalog/Names/#1 }
+     {
+       \seq_clear:N \l_@@_tmpa_seq
+       \prop_map_inline:cn
+         {\__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/#1 }}
+         { \seq_put_right:Nn \l_@@_tmpa_seq {##1~##2}}
+       \seq_sort:Nn  \l_@@_tmpa_seq
+         {
+           \str_compare:nNnTF {##1} > {##2}
+             { \sort_return_swapped: }
+             { \sort_return_same: }
+         }
+       \exp_args:Nnx \__pdf_backend_Names_gpush:nn
+         {#1}
+         {
+           \seq_use:Nn \l_@@_tmpa_seq {~}
+         }
+     }
+ }
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{@@_handler/Catalog/?_show:}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -343,7 +343,7 @@
 %    \begin{macrocode}
 %<@@=pdfmeta>
 %<*header>
-\ProvidesExplPackage{l3pdfmeta}{2021-07-21}{0.95g}
+\ProvidesExplPackage{l3pdfmeta}{2021-07-31}{0.95h}
   {PDF-Standards---LaTeX PDF management testphase bundle}
 %</header>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -53,7 +53,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -215,7 +215,7 @@
 %
 %    \begin{macrocode}
 %<*header>
-\ProvidesExplPackage{l3pdftools}{2021-07-21}{0.95g}
+\ProvidesExplPackage{l3pdftools}{2021-07-31}{0.95h}
   {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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -52,7 +52,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -136,7 +136,7 @@
 %    \begin{macrocode}
 %<@@=pdf>
 %<*header>
-\ProvidesExplPackage{l3pdfxform}{2021-07-21}{0.95g}
+\ProvidesExplPackage{l3pdfxform}{2021-07-31}{0.95h}
   {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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -51,7 +51,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -182,7 +182,7 @@
 %    \begin{macrocode}
 %<@@=pdfmanagement>
 %<*header>
-\ProvidesExplPackage{ltdocinit}{2021-07-21}{0.95g}
+\ProvidesExplPackage{ltdocinit}{2021-07-31}{0.95h}
   {Initialize document metadata}
 %</header>
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -51,7 +51,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -67,7 +67,7 @@
 % |firstaidoff={name1,name2,...}|.
 %    \begin{macrocode}
 %<*package>
-\ProvidesExplPackage{pdfmanagement-firstaid}{2021-07-21}{0.95g}
+\ProvidesExplPackage{pdfmanagement-firstaid}{2021-07-31}{0.95h}
   {LaTeX PDF management testphase bundle / firstaid-patches}
 
 %<@@=pdfmanagement>

Modified: trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -51,7 +51,7 @@
 %    }^^A
 % }
 %
-% \date{Version 0.95g, released 2021-07-21}
+% \date{Version 0.95h, released 2021-07-31}
 %
 % \maketitle
 % \begin{documentation}
@@ -384,7 +384,7 @@
 %    \begin{macrocode}
 %<@@=pdf>
 %<*package>
-\ProvidesExplPackage{pdfmanagement-testphase}{2021-07-21}{0.95g}
+\ProvidesExplPackage{pdfmanagement-testphase}{2021-07-31}{0.95h}
   {LaTeX PDF management testphase bundle}
 \providecommand\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
 \IfFormatAtLeastTF{2020-10-01}{}{
@@ -411,7 +411,7 @@
 % to allow to set it in the document.
 %    \begin{macrocode}
 %<*header>
-\ProvidesExplFile{pdfmanagement-testphase.ltx}{2021-07-21}{0.95g}
+\ProvidesExplFile{pdfmanagement-testphase.ltx}{2021-07-31}{0.95h}
   {PDF~management~code~(testphase)}
 %</header>
 %<*package>

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty	2021-07-31 20:56:25 UTC (rev 60127)
@@ -22,7 +22,7 @@
 %% This file has the LPPL maintenance status "maintained".
 %%
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{color-ltx}[2021-07-21 v0.95g
+\ProvidesPackage{color-ltx}[2021-07-31 v0.95h
   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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def	2021-07-31 20:56:25 UTC (rev 60127)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: hyperref-generic.dtx
-\ProvidesFile{hgeneric-testphase.def}[2021-07-21 v0.95g %
+\ProvidesFile{hgeneric-testphase.def}[2021-07-31 v0.95h %
   generic Hyperref driver for the LaTeX PDF management testphase bundle]
 
 \RequirePackage{etoolbox} %why?
@@ -2464,14 +2464,9 @@
 
 \ExplSyntaxOff
 \ExplSyntaxOn
-\tl_new:N  \l__hyp_CheckmarkYes_tl
-\tl_set:Nn \l__hyp_CheckmarkYes_tl {  __hyp_xform_CheckMarkYes }
-\tl_new:N  \l__hyp_CheckmarkOff_tl
-\tl_set:Nn \l__hyp_CheckmarkOff_tl {  __hyp_xform_CheckMarkOff }
 
 \def\@Form[#1]
   {
-    \@ifundefined{textcolor}{\let\textcolor\@gobble}{}
     \kvsetkeys{Form}{#1}
     \pdf at ifdraftmode{}
       {
@@ -2489,8 +2484,7 @@
               }
             \seq_sort:Nn \l__hyp_tmpa_seq
               {
-                \int_compare:nNnTF { \pdf at strcmp{##1}{##2} } > { 0 }
-                %\str_compare:nNnTF {##1} > {##2}
+                \str_compare:nNnTF {##1} > {##2}
                   { \sort_return_swapped: }
                   { \sort_return_same: }
               }
@@ -2520,64 +2514,6 @@
            \pdfmanagement_remove:nn {Catalog / AcroForm }{NeedAppearances}
          }
        }
-     \MakeFieldObject
-       {
-         \group_begin:
-         \fontfamily{pzd}
-         \fontencoding{U}
-         \fontseries{m}
-         \fontshape{n}
-         \selectfont
-         \char123
-         \group_end:
-       }
-       {__hyp_xform_Ding}
-    \MakeFieldObject
-       {
-         \group_begin:
-         \fontfamily{pzd}
-         \fontencoding{U}
-         \fontseries{m}
-         \fontshape{n}
-         \selectfont
-         \phantom{\char123}
-         \group_end:
-       }
-       {__hyp_xform_DingOff}
-     \MakeFieldObject
-       {
-         \group_begin:
-         \fontfamily{pzd}
-         \fontencoding{U}
-         \fontseries{m}
-         \fontshape{n}
-         \selectfont
-         \char51
-         \group_end:
-       }
-       {__hyp_xform_CheckMarkYes}
-     \MakeFieldObject
-       {
-        \group_begin:
-         \fontfamily{pzd}
-         \fontencoding{U}
-         \fontseries{m}
-         \fontshape{n}
-         \selectfont
-         \phantom{\char51} %perhaps xetex needs some small glyph ..
-         \group_end:
-       }
-       {__hyp_xform_CheckMarkOff}
-     \MakeFieldObject
-       {
-         \fbox{\textcolor{yellow}{\textsf{Submit}}} %color?
-       }
-       {__hyp_xform_Submit}
-     \MakeFieldObject
-       {
-         \fbox{\textcolor{yellow}{\textsf{SubmitP}}} %color?
-       }
-       {__hyp_xform_SubmitP}
   }
 \ExplSyntaxOff
 \let\@endForm\ltx at empty
@@ -2717,8 +2653,7 @@
     }%
   \endgroup
 }
-\tl_new:N  \l__hyp_RadioYes_tl
-\tl_set:Nn \l__hyp_RadioYes_tl { __hyp_xform_Ding }
+
 \def\__hypRadio#1{%
   \Fld at listcount=0~%
   %\show\Fld at default
@@ -2733,7 +2668,21 @@
     \leavevmode
     \HyAnn at AbsPageLabel
     \Hy at escapeform\PDFForm at Radio
-    \pdfannot_box:nnnn
+    \pdfxform_if_exist:nF { __hyp_xform_Ding }
+      {
+        \pdfxform_new:nnn { __hyp_xform_Ding } {}
+         {
+           \group_begin:
+           \fontfamily{pzd}
+           \fontencoding{U}
+           \fontseries{m}
+           \fontshape{n}
+           \selectfont
+           \char123
+           \group_end:
+         }
+      }
+    \pdfannot_box:nnnx
       {\Fld at width}
       {\Fld at height}
       {0pt} %is this correct?
@@ -2743,7 +2692,7 @@
          <<
          /N
           <<
-          /\@currValue\c_space_tl \pdfxform_ref:o {__hyp_xform_Ding}
+          /\@currValue\c_space_tl \pdfxform_ref:n {__hyp_xform_Ding}
           %/Off \c_space_tl \pdfxform_ref:n {__hyp_xform_DingOff} %hm
           >>
          >>
@@ -2830,6 +2779,18 @@
     \HyAnn at AbsPageLabel
     \Hy at escapeform\PDFForm at Submit
     \hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}}
+    \pdfxform_if_exist:nF
+     { __hyp_xform_Submit }
+     {
+       \pdfxform_new:nnn { __hyp_xform_Submit }{}
+        {
+          \fbox{\color_select:n{yellow}\textsf{Submit}}
+        }
+       \pdfxform_new:nnn { __hyp_xform_SubmitP }{}
+        {
+          \fbox{\color_select:n{yellow}\textsf{SubmitP}}
+        }
+     }
     \pdfannot_box:nnnn
       {\box_wd:N\l_tmpa_box}
       {\box_ht:N\l_tmpa_box}
@@ -2902,6 +2863,33 @@
           \mode_leave_vertical:
           \HyAnn at AbsPageLabel
           \Hy at escapeform\PDFForm at Check
+          \pdfxform_if_exist:nF { __hyp_xform_CheckMarkYes }
+             {
+               \pdfxform_new:nnn
+                {__hyp_xform_CheckMarkYes}{}
+                {
+                  \group_begin:
+                  \fontfamily{pzd}
+                  \fontencoding{U}
+                  \fontseries{m}
+                  \fontshape{n}
+                  \selectfont
+                  \char51
+                  \group_end:
+                }
+               \pdfxform_new:nnn
+                {__hyp_xform_CheckMarkOff}{}
+                {
+                  \group_begin:
+                  \fontfamily{pzd}
+                  \fontencoding{U}
+                  \fontseries{m}
+                  \fontshape{n}
+                  \selectfont
+                  \phantom{\char51} %perhaps xetex needs some small glyph ..
+                  \group_end:
+                }
+             }
           \pdfannot_box:nnnn
             {\Fld at width}
             {\Fld at height}
@@ -3121,8 +3109,8 @@
      <<
       /N
         <<
-          /Yes~\pdfxform_ref:o{\l__hyp_CheckmarkYes_tl}
-          /Off~\pdfxform_ref:o{\l__hyp_CheckmarkOff_tl}
+          /Yes~\pdfxform_ref:n{__hyp_xform_CheckMarkYes}
+          /Off~\pdfxform_ref:n{__hyp_xform_CheckMarkOff}
         >>
     >>
   /MK<<

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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty	2021-07-31 20:56:25 UTC (rev 60127)
@@ -19,7 +19,7 @@
 %
 % for those people who are interested.
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\ProvidesExplPackage{hyperxmp-patches-tmp-ltx}{2021-07-21}{0.95g}
+\ProvidesExplPackage{hyperxmp-patches-tmp-ltx}{2021-07-31}{0.95h}
   {Store hyperref metadata in XMP format / temporay patches to test pdfresource management ... UF}
 
 \cs_if_exist:NT \pdfmanagement_add:nnn

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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def	2021-07-31 20:56:25 UTC (rev 60127)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-dvipdfmx.def}{2021-07-21}{}
+  {l3backend-testphase-dvipdfmx.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -224,41 +224,13 @@
           }
       }
   }
-\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+\cs_new_protected:Npn \__pdf_backend_Names_gpush:nn #1 #2 %#1 name of name tree, #2 array content
   {
-    \pdf_object_unnamed_write:nn {dict} { /Names [#1] }
-    %n or x?
-    \__pdf_backend:x {put~@names~<</EmbeddedFiles~\pdf_object_ref_last: >>}
+     \pdf_object_unnamed_write:nn {dict} {/Names [#2] }
+     \__pdf_backend:x {put~@names~<</#1~\pdf_object_ref_last: >>}
   }
 
-
-\int_new:N \g__pdf_backend_EmbeddedFiles_int
-\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
- {
-   (
-    l3ef
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
-     {0}
-    \int_use:N \g__pdf_backend_EmbeddedFiles_int
-   )
- }
-\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
-\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
-\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:n #1
-    %#1 object ref
-    {
-      \int_gincr:N \g__pdf_backend_EmbeddedFiles_int
-      \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop
-        { #1 }
-        { \__pdf_backend_EmbeddedFiles_name: }
-      \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq
-        { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 }
-    }
-
+\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:nn #1 #2 {}
    % it needs a bit testing if it really works to set the box to 0 before the special ...
    % does it disturb viewing the xobject?
    % what happens with the resources (bdc)? (should work as they are specials too)

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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def	2021-07-31 20:56:25 UTC (rev 60127)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-dvips.def}{2021-07-21}{}
+  {l3backend-testphase-dvips.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvips}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -146,34 +146,13 @@
 
 
 
-\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 {}
-
-\int_new:N \g__pdf_backend_EmbeddedFiles_int
-\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
- {
-   (
-    l3ef
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
-     {0}
-    \int_use:N \g__pdf_backend_EmbeddedFiles_int
-   )
- }
-\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
-\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
-\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:n #1
+\cs_new_protected:Npn \__pdf_backend_Names_gpush:nn #1 #2  {}
+\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:nn #1 #2
       {
-        \int_gincr:N \g__pdf_backend_EmbeddedFiles_int
-        \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop
-         { #1 }
-         { \__pdf_backend_EmbeddedFiles_name: }
         \__pdf_backend_pdfmark:x
           {
-            /Name~\__pdf_backend_EmbeddedFiles_name:~
-            /FS~#1~
+            /Name~#1~
+            /FS~#2~
             /EMBED
           }
       }

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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def	2021-07-31 20:56:25 UTC (rev 60127)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-dvisvgm.def}{2021-07-21}{}
+  {l3backend-testphase-dvisvgm.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -112,26 +112,10 @@
 
 
 
-\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 {}
+\cs_new_protected:Npn \__pdf_backend_Names_gpush:nn #1 #2 {}
+\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:nn #1 #2
+      {}
 
-\int_new:N \g__pdf_backend_EmbeddedFiles_int
-\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
- {
-   (
-    l3ef
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
-     {0}
-    \int_use:N \g__pdf_backend_EmbeddedFiles_int
-   )
- }
-\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
-\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
-\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:n #1
-      {}
 \cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4 {}
 \cs_new_protected:Npn \__pdf_backend_xform_use:n #1 {}
 \cs_new:Npn \__pdf_backend_xform_ref:n {}

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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def	2021-07-31 20:56:25 UTC (rev 60127)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-luatex.def}{2021-07-21}{}
+  {l3backend-testphase-luatex.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -262,40 +262,13 @@
   }
 
 \cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1 {}
-\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+\cs_new_protected:Npn \__pdf_backend_Names_gpush:nn #1 #2 %#1 name of name tree, #2 array content
   {
-    \pdf_object_unnamed_write:nn {dict} {/Names [#1] }
-    \tex_pdfextension:D~names~{/EmbeddedFiles~\pdf_object_ref_last: }
+     \pdf_object_unnamed_write:nn {dict} {/Names [#2] }
+     \tex_pdfextension:D~names~ {/#1~\pdf_object_ref_last:}
   }
 
-
-\int_new:N \g__pdf_backend_EmbeddedFiles_int
-\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
- {
-   (
-    l3ef
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
-     {0}
-    \int_use:N \g__pdf_backend_EmbeddedFiles_int
-   )
- }
-\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
-\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
-\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:n #1
-    %#1 object ref
-    {
-      \int_gincr:N \g__pdf_backend_EmbeddedFiles_int
-      \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop
-        { #1 }
-        { \__pdf_backend_EmbeddedFiles_name: }
-      \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq
-        { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 }
-    }
-
+\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:nn #1 #2 {}
 \cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4
   {
     \hbox_set:Nn \l__pdf_backend_tmpa_box

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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def	2021-07-31 20:56:25 UTC (rev 60127)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-pdftex.def}{2021-07-21}{}
+  {l3backend-testphase-pdftex.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -280,40 +280,13 @@
        }
   }
 
-\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+\cs_new_protected:Npn \__pdf_backend_Names_gpush:nn #1 #2 %#1 name of name tree, #2 array content
   {
-     \pdf_object_unnamed_write:nn {dict} {/Names [#1] }
-     \tex_pdfnames:D {/EmbeddedFiles~\pdf_object_ref_last:}
+     \pdf_object_unnamed_write:nn {dict} {/Names [#2] }
+     \tex_pdfnames:D {/#1~\pdf_object_ref_last:}
   }
 
-
-\int_new:N \g__pdf_backend_EmbeddedFiles_int
-\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
- {
-   (
-    l3ef
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
-     {0}
-    \int_use:N \g__pdf_backend_EmbeddedFiles_int
-   )
- }
-\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
-\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
-\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:n #1
-    %#1 object ref
-    {
-      \int_gincr:N \g__pdf_backend_EmbeddedFiles_int
-      \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop
-        { #1 }
-        { \__pdf_backend_EmbeddedFiles_name: }
-      \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq
-        { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 }
-    }
-
+\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:nn #1 #2 {}
 \cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4
   {
     \hbox_set:Nn \l__pdf_backend_tmpa_box

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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def	2021-07-31 20:56:25 UTC (rev 60127)
@@ -20,7 +20,7 @@
 %% 
 %% File: l3backend-testphase.dtx
 \ProvidesExplFile
-  {l3backend-testphase-xetex.def}{2021-07-21}{}
+  {l3backend-testphase-xetex.def}{2021-07-31}{}
   {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX}
 \RequirePackage{l3ref-tmp}
 \cs_generate_variant:Nn \ref_label:nn {en}
@@ -224,41 +224,13 @@
           }
       }
   }
-\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+\cs_new_protected:Npn \__pdf_backend_Names_gpush:nn #1 #2 %#1 name of name tree, #2 array content
   {
-    \pdf_object_unnamed_write:nn {dict} { /Names [#1] }
-    %n or x?
-    \__pdf_backend:x {put~@names~<</EmbeddedFiles~\pdf_object_ref_last: >>}
+     \pdf_object_unnamed_write:nn {dict} {/Names [#2] }
+     \__pdf_backend:x {put~@names~<</#1~\pdf_object_ref_last: >>}
   }
 
-
-\int_new:N \g__pdf_backend_EmbeddedFiles_int
-\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
- {
-   (
-    l3ef
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
-     {0}
-    \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
-     {0}
-    \int_use:N \g__pdf_backend_EmbeddedFiles_int
-   )
- }
-\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
-\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
-\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:n #1
-    %#1 object ref
-    {
-      \int_gincr:N \g__pdf_backend_EmbeddedFiles_int
-      \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop
-        { #1 }
-        { \__pdf_backend_EmbeddedFiles_name: }
-      \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq
-        { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 }
-    }
-
+\cs_new_protected:Npn  \__pdf_backend_NamesEmbeddedFiles_add:nn #1 #2 {}
    % it needs a bit testing if it really works to set the box to 0 before the special ...
    % does it disturb viewing the xobject?
    % what happens with the resources (bdc)? (should work as they are specials too)

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase.lua	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase.lua	2021-07-31 20:56:25 UTC (rev 60127)
@@ -21,7 +21,6 @@
 --  File: l3backend-testphase.dtx
 
 
-
 ltx= ltx or {}
 ltx.__pdf      = ltx.__pdf or {}
 ltx.__pdf.Page = ltx.__pdf.Page or {}

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty	2021-07-31 20:56:25 UTC (rev 60127)
@@ -27,7 +27,7 @@
 %% File: l3pdffield.dtx
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{l3pdffield-testphase}{2021-07-21}{0.95g}%
+\ProvidesExplPackage{l3pdffield-testphase}{2021-07-31}{0.95h}%
   {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/pdflscape-ltx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty	2021-07-31 20:56:25 UTC (rev 60127)
@@ -22,7 +22,7 @@
 %% This work consists of the main source file pdflscape-ltx.sty
 %%
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesExplPackage{pdflscape-ltx}{2021-07-21}{0.95g}
+\ProvidesExplPackage{pdflscape-ltx}{2021-07-31}{0.95h}
  {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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty	2021-07-31 20:56:25 UTC (rev 60127)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: pdfmanagement-firstaid.dtx
-\ProvidesExplPackage{pdfmanagement-firstaid}{2021-07-21}{0.95g}
+\ProvidesExplPackage{pdfmanagement-firstaid}{2021-07-31}{0.95h}
   {LaTeX PDF management testphase bundle / firstaid-patches}
 
 \clist_map_inline:nn {pgf,transparent,hyperxmp,pdflscape,xcolor,color,beamer}

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx	2021-07-31 20:56:25 UTC (rev 60127)
@@ -27,7 +27,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: pdfmanagement-testphase.dtx
-\ProvidesExplFile{pdfmanagement-testphase.ltx}{2021-07-21}{0.95g}
+\ProvidesExplFile{pdfmanagement-testphase.ltx}{2021-07-31}{0.95h}
   {PDF~management~code~(testphase)}
 %% File: l3pdfdict.dtx
 \cs_new:Npn \__pdfdict_get_type:n #1
@@ -270,6 +270,7 @@
 \cs_set_eq:NN \pdfdict_use:n \__pdfdict_use:n
 %% File: l3pdfmanagement.dtx
 
+
 \msg_new:nnn  { pdfmanagement } { unknown-dict }
               { The~PDF~management~resource~'#1'~is~unknown. }
 
@@ -282,6 +283,9 @@
 \msg_new:nnn  { pdfmanagement } { no-show }
               { It~is~not~possible~to~show~the~content~of~'#1'.}
 
+\msg_new:nnn  { pdfmanagement } { name-exist }
+              { The~name~'#1'~has~already~been~used~for~name~tree~'#2'.}
+
 \msg_new:nnn  { pdfmanagement } { show-dict }
   {
     The~PDF~resource~'#1'~
@@ -298,6 +302,10 @@
     The~PDF~resources~management~is~not~active\\
     command~'#1'~ignored.
   }
+\tl_new:N \l__pdfmanagement_tmpa_tl
+\tl_new:N \l__pdfmanagement_tmpb_tl
+\seq_new:N \l__pdfmanagement_tmpa_seq
+
 \bool_new:N \g__pdfmanagement_active_bool
 \prg_new_conditional:Npnn \__pdfmanagement_if_active:  { p , T , F , TF }
   {
@@ -308,6 +316,7 @@
 \prg_set_eq_conditional:NNn
   \pdfmanagement_if_active: \__pdfmanagement_if_active: { p , T , F , TF }
 
+\cs_set_eq:NN \IfPDFManagementActiveTF\pdfmanagement_if_active:TF
 \hook_new:n {pdfmanagement/add}
 \cs_new_protected:Npn \pdfmanagement_add:nnn #1 #2 #3
   {
@@ -332,7 +341,8 @@
       }
   }
 
-\cs_generate_variant:Nn \pdfmanagement_add:nnn {nnx,nxx}
+\cs_generate_variant:Nn \pdfmanagement_add:nnn {nnx,nxx,xxx}
+\cs_set_eq:NN \PDFManagementAdd \pdfmanagement_add:xxx
 \tl_new:N \g__kernel_pdfmanagement_thispage_shipout_code_tl
 \tl_new:N \g__kernel_pdfmanagement_lastpage_shipout_code_tl
 \tl_new:N \g__kernel_pdfmanagement_end_run_code_tl
@@ -622,6 +632,11 @@
     AcroForm/CO
   }
 
+\clist_const:Nn \c__pdfmanagement_Catalog_nametree_clist
+  {
+    AP,
+    JavaScript,
+  }
 \clist_map_inline:Nn \c__pdfmanagement_Catalog_seq_clist
  {
    \seq_new:c { g__pdfmanagement_/Catalog/#1_seq } % new name later
@@ -637,6 +652,43 @@
       { g__pdfmanagement_/Catalog/OCProperties/Configs_seq }
       {  #1  }
   }
+\cs_new_protected:Npn \__pdfmanagement_nametree_add_aux:nnn #1 #2 #3
+  %#1 name tree, #2 sanitized name #3 value
+  {
+     \prop_get:coNTF
+       { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/#1 }}
+       { #2 }
+       \l__pdfmanagement_tmpb_tl
+       {
+         \msg_error:nnnn{pdfmanagement}{name-exist}{#2}{#1}
+       }
+       {
+         \prop_gput:con
+           { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/#1 }}
+           { #2 }
+           { #3 }
+       }
+  }
+\clist_map_inline:Nn \c__pdfmanagement_Catalog_nametree_clist
+ {
+   \pdfdict_new:n { g__pdf_Core/Catalog/Names/#1}
+   \cs_new_protected:cpn { __pdfmanagement_handler/Catalog/Names/#1/?_gput:nn } ##1 ##2
+     {
+       \pdf_string_from_unicode:nnN {utf8/string}{##1}\l__pdfmanagement_tmpa_tl
+       \exp_args:Nno
+         \__pdfmanagement_nametree_add_aux:nnn {#1}{\l__pdfmanagement_tmpa_tl}{##2}
+     }
+ }
+\pdfdict_new:n { g__pdf_Core/Catalog/Names/EmbeddedFiles}
+\cs_new_protected:cpn { __pdfmanagement_handler/Catalog/Names/EmbeddedFiles/?_gput:nn } #1 #2
+  {
+    \pdf_string_from_unicode:nnN {utf8/string}{#1}\l__pdfmanagement_tmpa_tl
+    \exp_args:Nno
+    \__pdfmanagement_nametree_add_aux:nnn
+      {EmbeddedFiles}{\l__pdfmanagement_tmpa_tl}{#2}
+    \exp_args:No
+    \__pdf_backend_NamesEmbeddedFiles_add:nn {\l__pdfmanagement_tmpa_tl}{#2}
+  }
 \cs_new_protected:Npn \__pdfmanagement_Catalog_gpush:
   {
     \use:c { __pdfmanagement_/Catalog/AA_gpush: }
@@ -655,7 +707,11 @@
       { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog} }
       \__pdf_backend_catalog_gput:nn
     % output names tree:
-    \use:c { __pdfmanagement_/Catalog/Names/EmbeddedFiles_gpush: }
+    \use:c{ __pdfmanagement_/Catalog/Names_gpush:n } {EmbeddedFiles}
+    \clist_map_inline:Nn \c__pdfmanagement_Catalog_nametree_clist
+     {
+      \use:c{ __pdfmanagement_/Catalog/Names_gpush:n } {##1}
+     }
   }
 \cs_new_protected:cpn { __pdfmanagement_/Catalog/AA_gpush: }
   {
@@ -789,12 +845,12 @@
       { 0 }
       {
         \__pdf_backend_object_new:nn  { __pdfmanagement/Catalog/OCProperties } { dict }
-        \seq_gpop_left:cN { g__pdfmanagement_/Catalog/OCProperties/Configs_seq} \l_tmpa_tl
+        \seq_gpop_left:cN { g__pdfmanagement_/Catalog/OCProperties/Configs_seq} \l__pdfmanagement_tmpa_tl
         \exp_args:Nnx
           \__pdf_backend_object_write:nn {__pdfmanagement/Catalog/OCProperties}
             {
               /OCGs~[ \seq_use:cn { g__pdfmanagement_/Catalog/OCProperties/OCGs_seq } {~} ]
-              /D~\l_tmpa_tl~
+              /D~\l__pdfmanagement_tmpa_tl~
               \seq_if_empty:cF { g__pdfmanagement_/Catalog/OCProperties/Configs_seq }
                 {
                   /Configs~
@@ -861,22 +917,54 @@
            }
      }
   }
+\int_new:N \g__pdfmanagement_EmbeddedFiles_int
+\cs_new:Npn \__pdfmanagement_EmbeddedFiles_name:
+ {
+   (
+    l3ef
+    \int_compare:nNnT {\g__pdfmanagement_EmbeddedFiles_int} < {10}
+     {0}
+    \int_compare:nNnT {\g__pdfmanagement_EmbeddedFiles_int} < {100}
+     {0}
+    \int_compare:nNnT {\g__pdfmanagement_EmbeddedFiles_int} < {1000}
+     {0}
+    \int_use:N \g__pdfmanagement_EmbeddedFiles_int
+   )
+ }
 \pdfdict_new:n { g__pdf_Core/Catalog/Names }
 
 \cs_new_protected:cpn { __pdfmanagement_handler/Catalog/Names/EmbeddedFiles_gput:n } #1
   {
-    \__pdf_backend_NamesEmbeddedFiles_add:n { #1 }
+    \int_gincr:N \g__pdfmanagement_EmbeddedFiles_int
+    \exp_args:Nnx
+    \prop_gput:cnn
+      { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/EmbeddedFiles }}
+      { \__pdfmanagement_EmbeddedFiles_name: }
+      { #1 }
+     \exp_args:Nx
+     \__pdf_backend_NamesEmbeddedFiles_add:nn {\__pdfmanagement_EmbeddedFiles_name:} { #1 }
   }
-\cs_new_protected:cpn { __pdfmanagement_/Catalog/Names/EmbeddedFiles_gpush: }
-  {
-    \seq_if_empty:NF \g__pdf_backend_EmbeddedFiles_seq
-      {
-        \exp_args:Nx \__pdf_backend_NamesEmbeddedFiles_gpush:n
-          {
-            \seq_use:Nn \g__pdf_backend_EmbeddedFiles_seq {~}
-          }
-      }
-  }
+\cs_new_protected:cpn  { __pdfmanagement_/Catalog/Names_gpush:n } #1 %#1 name of name tree
+ {
+   \pdfdict_if_empty:nF { g__pdf_Core/Catalog/Names/#1 }
+     {
+       \seq_clear:N \l__pdfmanagement_tmpa_seq
+       \prop_map_inline:cn
+         {\__kernel_pdfdict_name:n { g__pdf_Core/Catalog/Names/#1 }}
+         { \seq_put_right:Nn \l__pdfmanagement_tmpa_seq {##1~##2}}
+       \seq_sort:Nn  \l__pdfmanagement_tmpa_seq
+         {
+           \str_compare:nNnTF {##1} > {##2}
+             { \sort_return_swapped: }
+             { \sort_return_same: }
+         }
+       \exp_args:Nnx \__pdf_backend_Names_gpush:nn
+         {#1}
+         {
+           \seq_use:Nn \l__pdfmanagement_tmpa_seq {~}
+         }
+     }
+ }
 \cs_new_protected:cpn {__pdfmanagement_handler/Catalog/?_show:}
   {
     \iow_term:x

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty	2021-07-31 20:56:25 UTC (rev 60127)
@@ -19,7 +19,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: pdfmanagement-testphase.dtx
-\ProvidesExplPackage{pdfmanagement-testphase}{2021-07-21}{0.95g}
+\ProvidesExplPackage{pdfmanagement-testphase}{2021-07-31}{0.95h}
   {LaTeX PDF management testphase bundle}
 \providecommand\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
 \IfFormatAtLeastTF{2020-10-01}{}{

Modified: trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty	2021-07-31 20:56:25 UTC (rev 60127)
@@ -3,7 +3,7 @@
 %% a replacement for transparent sty from Heiko Oberdiek
 %%
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
-\ProvidesExplPackage{transparent-ltx}{2021-07-21}{0.95g}
+\ProvidesExplPackage{transparent-ltx}{2021-07-31}{0.95h}
   {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	2021-07-31 20:55:53 UTC (rev 60126)
+++ trunk/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty	2021-07-31 20:56:25 UTC (rev 60127)
@@ -1,6 +1,6 @@
 %% LaTeX2e file `xcolor-patches.sty'
 %%
-\ProvidesPackage{xcolor-patches-tmp-ltx}[2021-07-21 v0.95g patch xcolor for l3color]
+\ProvidesPackage{xcolor-patches-tmp-ltx}[2021-07-31 v0.95h patch xcolor for l3color]
 \@ifundefined{color_set:nn}{\RequirePackage{l3color}}{}
 
 \ExplSyntaxOn
@@ -116,3 +116,21 @@
          {\noexpand\xcolor@{\@@cls}{\the\toks@}{\@@mod}{\@@clr}}}%
     \fi}%
   \expandafter\endgroup\@@tmp\xglobal at stop}
+
+%re-predefine the colors
+\definecolorset{rgb/hsb/cmyk/gray}{}{}%
+ {brown,.75,.5,.25/.083333,.66667,.75/0,.25,.5,.25/.5475;%
+  lime,.75,1,0/.20833,1,1/.25,0,1,0/.815;%
+  orange,1,.5,0/.083333,1,1/0,.5,1,0/.595;%
+  pink,1,.75,.75/0,.25,1/0,.25,.25,0/.825;%
+  purple,.75,0,.25/.94444,1,.75/0,.75,.5,.25/.2525;%
+  teal,0,.5,.5/.5,1,.5/.5,0,0,.5/.35;%
+  violet,.5,0,.5/.83333,1,.5/0,.5,0,.5/.205}%
+\definecolorset{cmyk/rgb/hsb/gray}{}{}%
+ {olive,0,0,1,.5/.5,.5,0/.16667,1,.5/.39}
+\definecolorset{gray/rgb/hsb/cmyk}{}{}%
+ {darkgray,.25/.25,.25,.25/0,0,.25/0,0,0,.75;%
+  gray,.5/.5,.5,.5/0,0,.5/0,0,0,.5;%
+  lightgray,.75/.75,.75,.75/0,0,.75/0,0,0,.25}
+
+\endinput



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