[latex3-commits] [git/LaTeX3-latex3-pdfresources] develop: expand date (issue #26), empty creator(issue #27) (6ed9edc)
Ulrike Fischer
fischer at troubleshooting-tex.de
Sun Aug 1 01:07:05 CEST 2021
Repository : https://github.com/latex3/pdfresources
On branch : develop
Link : https://github.com/latex3/pdfresources/commit/6ed9edced4fc90a7933d7faca9cea6aa54baec6a
>---------------------------------------------------------------
commit 6ed9edced4fc90a7933d7faca9cea6aa54baec6a
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sun Aug 1 01:07:05 2021 +0200
expand date (issue #26), empty creator(issue #27)
>---------------------------------------------------------------
6ed9edced4fc90a7933d7faca9cea6aa54baec6a
hyperref-generic.dtx | 34 ++++++++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index 4e0296c..b08677c 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -1091,6 +1091,16 @@
No~value~is~equivalent~to~using~`true`.
}
% \end{macrocode}
+% A message for creator and producer which can't be removed.
+% \begin{macrocode}
+\msg_new:nnn
+ { hyp }
+ { empty-info-value }
+ {
+ Empty~value~for~key~#1.\\
+ This~isn't~honored~by~all~backends.
+ }
+% \end{macrocode}
% \section{Variants}
% \begin{macrocode}
\cs_generate_variant:Nn\pdf_destination:nn {nf}
@@ -3763,7 +3773,8 @@
% \subsubsection{\enquote{info keys}}
% \begin{hypkey}{pdfauthor,pdftitle,pdfcreator,pdfsubject,pdfproducer,pdfkeywords}
% The keys store their value also in the metadate container, so that hyperxmp can
-% use them.
+% use them. Creator and Producer can't be removed with the pdfmanagement,
+% but we allow to set an empty value.
% \begin{macrocode}
\cs_new_protected:Npn \@@_setup_info_key:nn #1 #2
{
@@ -3773,7 +3784,22 @@
{
\tl_if_blank:nTF {##1}
{
- \pdfmanagement_remove:nn {Info}{#2}
+ \str_case:nnF { #1 }
+ {
+ {creator}
+ {
+ \msg_info:nnn { hyp }{ empty-info-value } { pdfcreator }
+ \pdfmanagement_add:nnx {Info}{Creator}{()}
+ }
+ {producer}
+ {
+ \msg_info:nnn { hyp }{ empty-info-value } { pdfproducer }
+ \pdfmanagement_add:nnx {Info}{Producer}{()}
+ }
+ }
+ {
+ \pdfmanagement_remove:nn {Info}{#2}
+ }
}
{
\@@_text_pdfstring_info:nN {##1}\l_@@_tmpa_str
@@ -3838,7 +3864,7 @@
\pdfmanagement_remove:nn {Info}{#2}
}
{
- \pdfmanagement_add:nnx {Info}{#2}{(\tl_to_str:n {##1})}
+ \pdfmanagement_add:nnx {Info}{#2}{(##1)}
}
\@@_store_metadata:nn {pdf#1}{##1}
}
@@ -3852,7 +3878,7 @@
\pdfmanagement_remove:nn {Info}{#2}
}
{
- \pdfmanagement_add:nnx {Info}{#2}{(\tl_to_str:n {##1})}
+ \pdfmanagement_add:nnx {Info}{#2}{(##1)}
}
\exp_args:Nx \@@_store_metadata:nn {pdf\str_lowercase:n{#1}}{##1}
}
More information about the latex3-commits
mailing list.