[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: working on dates (5c62448)
Ulrike Fischer
fischer at troubleshooting-tex.de
Thu Feb 4 00:25:44 CET 2021
Repository : https://github.com/latex3/pdfresources
On branch : reworking-annot
Link : https://github.com/latex3/pdfresources/commit/5c6244850552cc52b2529b9a7e02d0be5faedf20
>---------------------------------------------------------------
commit 5c6244850552cc52b2529b9a7e02d0be5faedf20
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Thu Feb 4 00:25:44 2021 +0100
working on dates
>---------------------------------------------------------------
5c6244850552cc52b2529b9a7e02d0be5faedf20
hyperref-generic.dtx | 54 +++++++++++++++++++++++++++++++++++++++++++++++++---
info/key-list.tex | 13 ++++++++++++-
2 files changed, 63 insertions(+), 4 deletions(-)
diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index 80cddc4..0504d25 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -585,6 +585,13 @@
% /D & \meta{array of numbers} & dash pattern (lines/gaps) (default [3])
% \end{tabular}
%
+% \DecribeHypkey{pdfcreationdate}\DecribeHypkey{pdfmoddate}
+% Setting these keys is normally not needed. If they are used the values
+% are stored directly in the Info dictionary for |/Creationdate| and |/ModDate|.
+% The values are converted to strings but not processed further, so they should
+% have the correct PDF format without the enclosing parentheses,
+% e.g. |D:20200202111111+01'00'|.
+%
% \DescribeHypkey{pdflinkmargin}As described in the \pkg{hyperref} manual
% the behaviour differs between the backends: with dvips it is possible to
% change links locally, pdflatex and lualatex work by page, with dvipdfmx
@@ -2542,7 +2549,8 @@
% \end{macrocode}
% \end{hypkey}
% \begin{hypkey}{extension,hypertexnames,naturalnames,
-% pageanchor,linktoc,linktocpage,plainpages}
+% pageanchor,linktoc,linktocpage,plainpages,localanchorname,
+% linkfileprefix}
% \begin{macrocode}
\keys_define:nn { hyp / setup }
{
@@ -2552,6 +2560,11 @@
,hypertexnames / true .code:n = { \Hy at hypertexnamestrue}
,hypertexnames / false .code:n = { \Hy at hypertexnamesfalse}
,hypertexnames .default:n = {true}
+ ,linkfileprefix .tl_set:N = \Hy at linkfileprefix
+ ,localanchorname .choice:
+ ,localanchorname / true .code:n = { \Hy at localanchornametrue }
+ ,localanchorname / false .code:n = { \Hy at localanchornamefalse }
+ ,localanchorname .default:n = {true}
,naturalnames .choice:
,naturalnames / true .code:n = { \Hy at naturalnamestrue}
,naturalnames / false .code:n = { \Hy at naturalnamesfalse}
@@ -3314,11 +3327,45 @@
\@@_setup_info_key:nn {producer} {Producer}
\@@_setup_info_key:nn {creator} {Creator}
% ignored key: addtopdfcreator
-\@@_setup_info_key:nn {creationdate} {Creationdate}
-\@@_setup_info_key:nn {moddate} {ModDate}
\@@_setup_info_key:nn {subject} {Subject}
\@@_setup_info_key:nn {keywords} {Keywords}
+\cs_new_protected:Npn \@@_setup_info_date_key:nn #1 #2
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ pdf#1 .code:n =
+ {
+ \tl_if_blank:nTF {##1}
+ {
+ \pdfmanagement_remove:nn {Info}{#2}
+ }
+ {
+ \pdfmanagement_add:nnx {Info}{#2}{(\tl_to_str:n {##1})}
+ }
+ \@@_store_metadata:nn {pdf#1}{##1}
+ }
+ }
+ \keys_define:nn { hyp / info }
+ {
+ #2 .code:n =
+ {
+ \tl_if_blank:nTF {##1}
+ {
+ \pdfmanagement_remove:nn {Info}{#2}
+ }
+ {
+ \pdfmanagement_add:nnx {Info}{#2}{(\tl_to_str:n {##1})}
+ }
+ \exp_args:Nx \@@_store_metadata:nn {pdf\str_lowercase:n{#1}}{##1}
+ }
+ }
+ }
+
+%CreationDate and ModDate is special and should not use the hex encoding.
+\@@_setup_info_date_key:nn {creationdate} {CreationDate}
+\@@_setup_info_date_key:nn {moddate} {ModDate}
+
%pdfinfo allows to set the key with keyval ...
\keys_define:nn { hyp / setup }
{
@@ -3328,6 +3375,7 @@
}
}
+
% default values
\keys_set:nn { hyp / setup} {pdfcreator = LaTeX~with~hyperref}
\keys_set:nn { hyp / setup} {pdfauthor = }
diff --git a/info/key-list.tex b/info/key-list.tex
index f2fbebb..9887d14 100644
--- a/info/key-list.tex
+++ b/info/key-list.tex
@@ -1,7 +1,18 @@
\subsection{Big alphabetical list}
The following is a complete listing of available options for
-\textsf{hyperref}, arranged alphabetically.
+\textsf{hyperref}, arranged alphabetically
+
+but some are missing ...
+=== open
+done localanchorname
+done linkfileprefix
+obsolet,removed pdfpagehidden
+pdfusetitle !
+addtopdfcreator
+pdfcreationdate
+pdfmoddate
+pdfescapeform ?? form fields, need to be checked there.
\begin{longtable}{@{}l>{\ttfamily}llp{7cm}@{}}
done & allbordercolors & & Set all border color options\\
More information about the latex3-commits
mailing list.