[latex3-commits] [git/LaTeX3-latex3-pdfresources] verify: adapt to new l3pdf (779efc9)

Ulrike Fischer fischer at troubleshooting-tex.de
Wed Feb 17 21:52:22 CET 2021


Repository : https://github.com/latex3/pdfresources
On branch  : verify
Link       : https://github.com/latex3/pdfresources/commit/779efc9686ed937867464b5ae1b4506d53875d44

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

commit 779efc9686ed937867464b5ae1b4506d53875d44
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Feb 17 21:52:22 2021 +0100

    adapt to new l3pdf


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

779efc9686ed937867464b5ae1b4506d53875d44
 firstaid/hyperxmp-patches-tmp-ltx.sty |  2 +-
 hyperref-generic.dtx                  |  4 ++--
 l3backend-pdf-extra.dtx               | 18 +++++++++---------
 l3pdffile.dtx                         | 14 +++++++-------
 l3pdfmanagement.dtx                   |  4 ++--
 l3pdfmeta.dtx                         |  4 ++--
 l3pdftools.dtx                        | 22 +++++++++++++++++++++-
 7 files changed, 44 insertions(+), 24 deletions(-)

diff --git a/firstaid/hyperxmp-patches-tmp-ltx.sty b/firstaid/hyperxmp-patches-tmp-ltx.sty
index ece7d5d..5004d80 100644
--- a/firstaid/hyperxmp-patches-tmp-ltx.sty
+++ b/firstaid/hyperxmp-patches-tmp-ltx.sty
@@ -40,7 +40,7 @@
    \hyxmp at construct@packet
    %or some other command to write a object:
    \exp_args:Nnx
-    \pdf_object_now:nn{stream}{{/Type~/Metadata~/Subtype~/XML}{\hyxmp at xml}}%
+    \pdf_object_unnamed_write:nn{stream}{{/Type~/Metadata~/Subtype~/XML}{\hyxmp at xml}}%
     % reference in the Catalog:
     \pdfmanagement_add:nnx {Catalog} {Metadata}{\pdf_object_last:}
  }
diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index 900b078..3ed2831 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -3673,11 +3673,11 @@
          {
            \group_begin:
            \keys_set:nn { hyp / trans }{style=R,#1}
-           \pdf_object_now:nx { dict }
+           \pdf_object_unnamed_write:nx { dict }
              {
                \pdfdict_use:n {l_@@_page/Trans}
              }
-           \pdfmanagement_add:nnx {Page}{Trans}{\pdf_object_last:}
+           \pdfmanagement_add:nnx {Page}{Trans}{\pdf_object_ref_last:}
            \group_end:
          }
      }
diff --git a/l3backend-pdf-extra.dtx b/l3backend-pdf-extra.dtx
index 1b61371..80f83e7 100644
--- a/l3backend-pdf-extra.dtx
+++ b/l3backend-pdf-extra.dtx
@@ -777,7 +777,7 @@
 %this require management
 \cs_set_protected:Npn \@@_backend_bdc_contobj:nn #1 #2
   {
-    \pdf_object_now:nn { dict }{ #2 }
+    \pdf_object_unnamed_write:nn { dict }{ #2 }
     \@@_backend_bdcobject:n { #1 }
   }
 
@@ -870,7 +870,7 @@
    }
 \cs_set_protected:Npn \@@_backend_bdc_contobj:nn #1 #2
   {
-    \pdf_object_now:nn { dict } { #2 }
+    \pdf_object_unnamed_write:nn { dict } { #2 }
     \@@_backend_bdcobject:n { #1 }
   }
 \cs_set_protected:Npn \@@_backend_bdc_contstream:nn #1 #2
@@ -979,7 +979,7 @@
   }
 \cs_set_protected:Npn \@@_backend_bdc_contobj:nn #1 #2
    {
-     \pdf_object_now:nn { dict } { #2 }
+     \pdf_object_unnamed_write:nn { dict } { #2 }
      \@@_backend_bdcobject:n { #1 }
    }
 \cs_set_protected:Npn \@@_backend_bdc_contstream:nn #1 #2
@@ -1044,23 +1044,23 @@
 %<*pdftex>
 \cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 %array content
   {
-     \pdf_object_now:nn {dict} {/Names [#1] }
-     \tex_pdfnames:D {/EmbeddedFiles~\pdf_object_last:}
+     \pdf_object_unnamed_write:nn {dict} {/Names [#1] }
+     \tex_pdfnames:D {/EmbeddedFiles~\pdf_object_ref_last:}
   }
 %</pdftex>
 %<*luatex>
 \cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 %array content
   {
-    \pdf_object_now:nn {dict} {/Names [#1] }
-    \tex_pdfextension:D~names~{/EmbeddedFiles~\pdf_object_last: }
+    \pdf_object_unnamed_write:nn {dict} {/Names [#1] }
+    \tex_pdfextension:D~names~{/EmbeddedFiles~\pdf_object_ref_last: }
   }
 %</luatex>
 %<*dvipdfmx|xdvipdfmx>
 \cs_new_protected:Npn \@@_backend_NamesEmbeddedFiles_gpush:n #1 %array content
   {
-    \pdf_object_now:nn {dict} { /Names [#1] }
+    \pdf_object_unnamed_write:nn {dict} { /Names [#1] }
     %n or x?
-    \__pdf_backend:x {put~@names~<</EmbeddedFiles~\pdf_object_last: >>}
+    \__pdf_backend:x {put~@names~<</EmbeddedFiles~\pdf_object_ref_last: >>}
   }
 %</dvipdfmx|xdvipdfmx>
 
diff --git a/l3pdffile.dtx b/l3pdffile.dtx
index 4219a5f..71cfbc9 100644
--- a/l3pdffile.dtx
+++ b/l3pdffile.dtx
@@ -170,14 +170,14 @@
 % \subsubsection{Task 1: Embedding a file}
 % Embedding an existing file is in most cases quite straightforward. This module
 % offers commands, but it can also be done with the basic commands
-% from the l3pdf module \cs{pdf_object_now:nn} or
+% from the l3pdf module \cs{pdf_object_unnamed_write:nn} or
 % \cs{pdf_object_new:nn}/\cs{pdf_object_write:nn} or primitive commands
 % to create objects.
 % The object number should be stored for the reference
 % in the /FileSpec dictionary.
 %
 % \begin{verbatim}
-% \pdf_object_now:nx {fstream}
+% \pdf_object_unnamed_write:nx {fstream}
 %   {
 %     {
 %       /Type /EmbeddedFile
@@ -191,7 +191,7 @@
 %     }
 %     {example-image.eps}
 %   }
-% \tl_set:Nx \l_my_fileobj_tl {\pdf_object_last:}
+% \tl_set:Nx \l_my_fileobj_tl {\pdf_object_ref_last:}
 % \end{verbatim}
 %
 % \begin{itemize}
@@ -541,7 +541,7 @@
 %   e.g. result from \@@_mimetype_set:NN
 \cs_new_protected:Npn \@@_fstream_write:nN #1 #2
   {
-    \pdf_object_now:nx { fstream }
+    \pdf_object_unnamed_write:nx { fstream }
       {
         {
           #2
@@ -566,7 +566,7 @@
 %   e.g. result from \@@_mimetype_set:NN
 \cs_new_protected:Npn \@@_stream_write:nN #1 #2
   {
-    \pdf_object_now:nx { stream }
+    \pdf_object_unnamed_write:nx { stream }
       {
         {
           #2
@@ -638,7 +638,7 @@
                 \@@_fstream_write:VN
                   \l_pdffile_source_name_str
                   \l_@@_automimetype_tl
-                \tl_set:Nx \l_@@_embed_ref_tl { \pdf_object_last: }
+                \tl_set:Nx \l_@@_embed_ref_tl { \pdf_object_ref_last: }
               }
               {
                 \msg_error:nnn { pdffile }{ file-not-found }{ #1 }
@@ -699,7 +699,7 @@
          \@@_stream_write:nN
            { #1 }
            \l_@@_automimetype_tl
-         \tl_set:Nx \l_@@_embed_ref_tl { \pdf_object_last: }
+         \tl_set:Nx \l_@@_embed_ref_tl { \pdf_object_ref_last: }
          \exp_args:Nnxx
            \@@_filespec_write:nnn
              %#1 dict, #2 target file name, #3 object ref
diff --git a/l3pdfmanagement.dtx b/l3pdfmanagement.dtx
index e276c84..3357c65 100644
--- a/l3pdfmanagement.dtx
+++ b/l3pdfmanagement.dtx
@@ -513,8 +513,8 @@
 %
 %  or
 %  \begin{verbatim}
-%  \pdf_object_now:nn   {dict} { ... }
-%  \pdfmanagement_add:nnx  {Catalog} {OutputIntents}{\pdf_object_last:}
+%  \pdf_object_unnamed_write:nn   {dict} { ... }
+%  \pdfmanagement_add:nnx  {Catalog} {OutputIntents}{\pdf_object_ref_last:}
 %  \end{verbatim}
 %
 %
diff --git a/l3pdfmeta.dtx b/l3pdfmeta.dtx
index fda9e74..3f6e9e9 100644
--- a/l3pdfmeta.dtx
+++ b/l3pdfmeta.dtx
@@ -548,8 +548,8 @@
               {l_pdfmeta/outputintent}{##1}{\l_@@_tmpa_str}
           }
        }
-     \pdf_object_now:nx {dict}{\pdfdict_use:n {l_pdfmeta/outputintent} }
-     \pdfmanagement_add:nnx {Catalog}{OutputIntents}{\pdf_object_last:}
+     \pdf_object_unnamed_write:nx {dict}{\pdfdict_use:n {l_pdfmeta/outputintent} }
+     \pdfmanagement_add:nnx {Catalog}{OutputIntents}{\pdf_object_ref_last:}
     \group_end:
   }
 
diff --git a/l3pdftools.dtx b/l3pdftools.dtx
index e85e827..62659b1 100644
--- a/l3pdftools.dtx
+++ b/l3pdftools.dtx
@@ -432,10 +432,30 @@
 % \begin{macro}{ \pdf_pageobject_ref:n }
 %    \begin{macrocode}
 %<*package>
-\cs_new:Npn \pdf_pageobject_ref:n #1 { \@@_backend_pageobject_ref:n { #1 }}
+\cs_if_free:NT \pdf_pageobject_ref:n
+  {
+   \cs_new:Npn \pdf_pageobject_ref:n #1 { \@@_backend_pageobject_ref:n { #1 }}
+  }
 %</package>
 %    \end{macrocode}
 % \end{macro}
+%
+% \subsection{transition commands}
+%    \begin{macrocode}
+%define old for new formats
+\cs_if_free:NT \pdf_object_now:nn
+ {
+   \cs_set_eq:NN \pdf_object_now:nn \pdf_object_unnamed_write:nn
+   \cs_set_eq:NN \pdf_object_last: \pdf_object_ref_last:
+ }
+%define new for old formats
+\cs_if_free:NT \pdf_object_unnamed_write:nn
+ {
+   \cs_set_eq:NN \pdf_object_unnamed_write:nn \pdf_object_now:nn
+   \cs_generate_variant:Nn \pdf_object_unnamed_write:nn {nx}
+   \cs_set_eq:NN \pdf_object_ref_last: \pdf_object_last:
+ }
+%    \end{macrocode}
 % \end{implementation}
 %
 % \PrintIndex





More information about the latex3-commits mailing list.