[latex3-commits] [git/LaTeX3-latex3-pdfresources] main: missed a few name conversions (70e0943)

Ulrike Fischer fischer at troubleshooting-tex.de
Sun Feb 14 18:29:13 CET 2021


Repository : https://github.com/latex3/pdfresources
On branch  : main
Link       : https://github.com/latex3/pdfresources/commit/70e09437eb71120af9f6d26057b97b5062baa79b

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

commit 70e09437eb71120af9f6d26057b97b5062baa79b
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Feb 14 18:29:13 2021 +0100

    missed a few name conversions


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

70e09437eb71120af9f6d26057b97b5062baa79b
 l3backend-pdf-extra.dtx |  4 +++-
 l3pdfmanagement.dtx     | 24 +++++++++++++++++-------
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/l3backend-pdf-extra.dtx b/l3backend-pdf-extra.dtx
index f7bbfab..3b4dfe4 100644
--- a/l3backend-pdf-extra.dtx
+++ b/l3backend-pdf-extra.dtx
@@ -622,7 +622,9 @@
 \cs_new_protected:Npn \@@_backend_PageResources_gput:nnn #1 #2 #3
   {
    % this is not used for output, but there is a test if the resource is empty
-   \prop_gput:cnn { \__kernel_pdfdict_name:n { g_@@_Core/Page/Resources/#1} } { #2 }{ #3 }
+   \exp_args:Nnx
+   \prop_gput:cnn { \__kernel_pdfdict_name:n { g_@@_Core/Page/Resources/#1} }
+     { \str_convert_pdfname:n {#2} }{ #3 }
    %objects are not filled with \pdf_object_write as this is not additive!
     \@@_backend:x
       {
diff --git a/l3pdfmanagement.dtx b/l3pdfmanagement.dtx
index 556c69e..e276c84 100644
--- a/l3pdfmanagement.dtx
+++ b/l3pdfmanagement.dtx
@@ -139,8 +139,9 @@
 % property lists and writes it later into the right PDF dictionary\footnote{Currently all
 % resources are PDF dictionaries, so resource and dictionary mean the same.}
 % Which values for \Arg{resource path} exist is described in the following.
-% \Arg{name} should be a valid PDF Name without
-% the starting slash.
+% \Arg{name} should be a PDF Name without the starting slash. Like with all
+% 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.
 %
@@ -219,7 +220,10 @@
 %     \cs{pdfmanagement_add:nnn} \{Info\} \Arg{name} \Arg{value}
 %   \end{syntax}
 %   Adds |/|\meta{name} and the \meta{value} to the Info dictionary.
-%   \meta{name} should be a valid pdf name without the leading slash,
+%   \meta{name} should be a PDF name without the leading slash,
+%   Like with all
+%   keys used in PDF dictionaries (see the l3pdfdict module) the name is escaped
+%   with \cs{str_convert_pdfname:n} when stored.
 %   \meta{value} should be a valid pdf value. Any escaping or (re)encoding must be
 %   done explicitly.
 %   If a \meta{name} is used twice, only the last \meta{value}
@@ -730,8 +734,11 @@
                   { @@_handler/#1/#2_gput:n }
                   { \use:c {@@_handler/#1/#2_gput:n} {#3} } %special handler
                   {
+                    \exp_args:Nnx
                     \prop_gput:cnn
-                      { \__kernel_pdfdict_name:n { g__pdf_Core/#1 } }{ #2 } { #3 }
+                      { \__kernel_pdfdict_name:n { g__pdf_Core/#1 } }
+                      { \str_convert_pdfname:n { #2 } }
+                      { #3 }
                   }
               }
           }
@@ -746,9 +753,10 @@
 
 \cs_new_protected:Npn \@@_get:nnN  #1 #2 #3 %path,key,macro
   {
+    \exp_args:Nnx
     \prop_get:cnN
       { \__kernel_pdfdict_name:n { g__pdf_Core/#1 } }
-      { #2 } #3
+      { \str_convert_pdfname:n {#2} } #3
   }
 
 
@@ -764,8 +772,9 @@
                   { @@_handler/#1/#2_gremove: }
                   { \use:c {@@_handler/#1/#2_gremove:} } %special handler
                   {
+                    \exp_args:Nnx
                     \prop_gremove:cn
-                      { \__kernel_pdfdict_name:n { g__pdf_Core/#1 } }{ #2 }
+                      { \__kernel_pdfdict_name:n { g__pdf_Core/#1 } }{ \str_convert_pdfname:n {#2} }
                   }
               }
           }
@@ -778,8 +787,9 @@
   {
     \pdfdict_if_exist:nTF { g__pdf_Core/#1 }
           {
+            \exp_args:Nnx
             \prop_gremove:cn
-              { \__kernel_pdfdict_name:n { g__pdf_Core/#1 } }{ #2 }
+              { \__kernel_pdfdict_name:n { g__pdf_Core/#1 } }{ \str_convert_pdfname:n{#2} }
           }
           {
             \msg_error:nnn { pdfmanagement } { unknown-dict } { #1 }





More information about the latex3-commits mailing list.