From 8f60c584b2c1e5e39516a1998602d1f79a720dfe Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 18 Mar 2021 21:12:52 +0000 Subject: pdfmanagement-testphase (18mar21) (branch) git-svn-id: svn://tug.org/texlive/branches/branch2020.0@58520 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/pdfmanagement-testphase/CHANGELOG.md | 18 +- .../doc/latex/pdfmanagement-testphase/README.md | 2 +- .../pdfmanagement-testphase/hyperref-generic.pdf | Bin 873009 -> 892975 bytes .../l3backend-testphase.pdf | Bin 565792 -> 567916 bytes .../latex/pdfmanagement-testphase/l3pdfannot.pdf | Bin 565696 -> 566379 bytes .../latex/pdfmanagement-testphase/l3pdfdict.pdf | Bin 523596 -> 523372 bytes .../latex/pdfmanagement-testphase/l3pdffield.pdf | Bin 556128 -> 555926 bytes .../latex/pdfmanagement-testphase/l3pdffile.pdf | Bin 547500 -> 547260 bytes .../pdfmanagement-testphase/l3pdfmanagement.pdf | Bin 649554 -> 649325 bytes .../latex/pdfmanagement-testphase/l3pdfmeta.pdf | Bin 656456 -> 656637 bytes .../latex/pdfmanagement-testphase/l3pdftools.pdf | Bin 514001 -> 515149 bytes .../latex/pdfmanagement-testphase/l3pdfxform.pdf | Bin 435022 -> 434789 bytes .../latex/pdfmanagement-testphase/ltdocinit.pdf | Bin 550289 -> 550068 bytes .../pdfmanagement-firstaid.pdf | Bin 419964 -> 419958 bytes .../pdfmanagement-testphase.pdf | Bin 444916 -> 444675 bytes .../pdfmanagement-testphase/hyperref-generic.dtx | 418 +++++++++++++++++---- .../l3backend-testphase.dtx | 30 +- .../latex/pdfmanagement-testphase/l3pdfannot.dtx | 57 ++- .../latex/pdfmanagement-testphase/l3pdfdict.dtx | 4 +- .../latex/pdfmanagement-testphase/l3pdffield.dtx | 45 +-- .../latex/pdfmanagement-testphase/l3pdffile.dtx | 6 +- .../pdfmanagement-testphase/l3pdfmanagement.dtx | 4 +- .../latex/pdfmanagement-testphase/l3pdfmeta.dtx | 4 +- .../latex/pdfmanagement-testphase/l3pdftools.dtx | 15 +- .../latex/pdfmanagement-testphase/l3pdfxform.dtx | 4 +- .../latex/pdfmanagement-testphase/ltdocinit.dtx | 4 +- .../pdfmanagement-firstaid.dtx | 14 +- .../pdfmanagement-testphase.dtx | 7 +- .../latex/pdfmanagement-testphase/color-ltx.sty | 4 +- .../pdfmanagement-testphase/hgeneric-testphase.def | 265 ++++++++++--- .../hyperxmp-patches-tmp-ltx.sty | 3 +- .../l3backend-testphase-dvipdfmx.def | 6 +- .../l3backend-testphase-dvips.def | 6 +- .../l3backend-testphase-dvisvgm.def | 6 +- .../l3backend-testphase-luatex.def | 6 +- .../l3backend-testphase-pdftex.def | 6 +- .../l3backend-testphase-xetex.def | 6 +- .../l3pdffield-testphase.sty | 43 +-- .../pdfmanagement-testphase/pdflscape-ltx.sty | 4 +- .../pdfmanagement-firstaid.sty | 12 +- .../pdfmanagement-testphase.ltx | 5 +- .../pdfmanagement-testphase.sty | 2 +- .../pdfmanagement-testphase/transparent-ltx.sty | 4 +- .../xcolor-patches-tmp-ltx.sty | 2 +- 44 files changed, 760 insertions(+), 252 deletions(-) diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/CHANGELOG.md b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/CHANGELOG.md index 4d417af72d2..2f09d1fbf85 100644 --- a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/CHANGELOG.md +++ b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/CHANGELOG.md @@ -5,7 +5,23 @@ first release 0.95a, 2021-02-23 will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), this project uses date-based 'snapshot' version identifiers. -## [Unreleased] +## [2021-03-17] + +### Fixed +- \pdffield-setup:nn +- ocgcolorlinks test for dvips (pdf version is not available) + +### Changed +- \pdf_name_from_unicode_e:n: use cvn operator with dvips +- \url: it has an optional argument through which protocol, formatting command and encoding + can be changed +- \href can use the url arguments too. +- \hyper@linkfile (GoToR links) now uses a filespec dictionary. This improves the + support for non-ascii files names. + +### Added +- \hrefurl, \hrefrun, \hrefpdf for better support of non-ascii input and + default options, see the hyperref-generic documentation. ## [2021-03-07] diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md index e8ccd6bde2e..40ae909e00f 100644 --- a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md +++ b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/README.md @@ -1,6 +1,6 @@ # LaTeX PDF management testphase bundle -Version: 0.95b, 2021-03-07 +Version: 0.95c, 2021-03-17 This package is used during a test phase to load the new PDF management code of LaTeX. diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/hyperref-generic.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/hyperref-generic.pdf index 49fbd11925b..ddb0c9b2b9c 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/hyperref-generic.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/hyperref-generic.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3backend-testphase.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3backend-testphase.pdf index b89ccd6af04..6e5e8afd77a 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3backend-testphase.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3backend-testphase.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfannot.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfannot.pdf index 6299ff3a302..3e647106b58 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfannot.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfannot.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfdict.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfdict.pdf index 4d2d2c1841a..970086e088d 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfdict.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfdict.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield.pdf index 6fc5c3844b2..0c96ffee00f 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffield.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffile.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffile.pdf index 49e015fef5d..f93e47b28d7 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffile.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdffile.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmanagement.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmanagement.pdf index 3a21c93c56d..92e9fe605e1 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmanagement.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmanagement.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmeta.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmeta.pdf index 1162dcd1cf1..f41e8f553f7 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmeta.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfmeta.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdftools.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdftools.pdf index e8988db4248..ed1f4381e48 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdftools.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdftools.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfxform.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfxform.pdf index 4c345d40066..8b0acbedcff 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfxform.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/l3pdfxform.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/ltdocinit.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/ltdocinit.pdf index 99ee652c793..81e648525e7 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/ltdocinit.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/ltdocinit.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-firstaid.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-firstaid.pdf index 92144a63e74..d702eae143c 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-firstaid.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-firstaid.pdf differ diff --git a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-testphase.pdf b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-testphase.pdf index c5021da1180..cc1239e23a8 100644 Binary files a/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-testphase.pdf and b/Master/texmf-dist/doc/latex/pdfmanagement-testphase/pdfmanagement-testphase.pdf differ diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx index ee7c99874ae..8c60439dd31 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx @@ -86,7 +86,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -172,7 +172,7 @@ % The current handling of the metadata is problematic: % \begin{itemize} % \item External package like \pkg{hyperxmp} wants to access them too and for -% this had to patch an number of internal hyperref commands---which is a problem +% this had to patch an number of internal \pkg{hyperref} commands---which is a problem % if the internal commands change (as happens with this new driver) % \item \pkg {hyperref} (and also \pkg{hyperxmp}) % tries to deduce some datas from document commands like @@ -212,7 +212,7 @@ % % \end{itemize} % \section{Dates} -% \pkg{hyperref has a few keys to set dates}. They typically expect the date +% \pkg{hyperref} has a few keys to set dates. They typically expect the date % in \enquote{PDF} format: |D:YYYYMMDDhhmmss+01'00'|. % % One should be aware that \pkg{hyperxmp} will sometimes @@ -243,6 +243,115 @@ % So if the PDF page size is wrong: load one of the other packages setting it % e.g. the \pkg{color} or the \pkg{graphicx} package. % +% \section{Commands to create \enquote{external} references} +% \pkg{hyperref} has three commands related to external references like +% URL and file: \cs{url}, +% \cs{nolinkurl} and \cs{href}. The first two take one argument, +% while the last has two: the url and some free text. +% +% +% \cs{url} and \cs{href} create link annotations. \cs{url} creates always an URI +% type, \cs{href} creates URI, GoToR and Launch +% depending on the structure of the argument. +% +% \cs{href} has to create a (in the PDF) valid url or file name from its first argument. +% \cs{url} has to create a (in the PDF) valid url from its only argument and has also to print +% this argument as url. \cs{nolinkurl} only prints the url. +% +% For the printing \cs{url} and \cs{nolinkurl} rely on the url package and its \cs{Url} command. +% +% (Expandable) commands are expanded and special chars can also be input by commands but +% beside this no conversion is done: for all input \pkg{hyperref} basically assumes that +% the input is already a valid percent encoded url or a valid file name. \pkg{hyperref} also +% doesn't extend or add protocols. +% +% As nowadays everyone is used to copy and paste links with all sorts of unicode into a browser and +% they work the \pkg{hyperref} input is clearly rather restricted. +% +% So the new driver tries to extend the input and print options. Both \cs{href} and \cs{url} +% can now be told to accept non-ascii url's and to convert them internally to +% percent encoding. It is possible to define a standard protocol and so to avoid to +% have to type it all the time. +% +% But extending the \emph{print} options for \cs{url} and \cs{nolinkurl} while still +% using the url-package is hard to impossible in pdf\LaTeX{} due to the way the url package works. +% Some chars can be added with the help of \cs{UrlSpecial} (at the cost of warnings) +% but it doesn't work for every input and documenting and explaining all the edge cases is no joy. +% So instead the new driver offers here the option to use different commands to format +% the printed output. It must be noted that this disable the special \enquote{hyphenation} method of +% url's. +% +% +% \subsection{Special problem: links to files} +% +% When a file is linked with \cs{href} than normally it is added as URI link. The exceptions are PDF's: +% for them PDF has the special type GoToR which allows also to link to a destination or a special page. +% +% After a number of tests with various PDF viewer established that non-ascii files names don't +% work at all with a simple file name specification GoToR links now use a full +% filespec dictionary. This works better, but still no every PDF viewer support this correctly. +% on various system. +% +% The following can be used to test viewers. It assumes that a \texttt{test.pdf}, +% a \texttt{grüßpdf.pdf} and a \texttt{grüße.txt} are in the current folder. +% +% \hrefpdf{test.pdf}{test-ascii} +% +% \hrefpdf{grüßpdf.pdf}{test grüßpdf.pdf} +% +% \hrefurl[urlencode]{grüße.txt}{test grüße.txt} +% +% +% \subsection{Splits} +% +% \cs{href} tries to be clever and to detect from the argument +% if a url or a file link or a launch command should be created. +% +% The rules are not trivial, and they make the code complicated. +% This detection also makes it more difficult to handle special cases +% like non-ascii input for the link types. +% +% For this reason three new commands have been create: +% +% \begin{itemize} +% \item \cs{hrefurl} for standard urls (and non-pdf files) +% \item \cs{hrefpdf} for references to pdf files +% \item \cs{hrefrun} for launch links +% \end{itemize} +% +% The new commands don't use prefixes like \cs{href}. +% Their argument should be the real content. +% +% \subsection{Options} +% All \cs{href} commands and \cs{url} have an option argument for keyval syntax. +% It accepts the following keys. Not all keys make sense for all keys, but they don't +% error, they are silently ignored. +% +% \begin{tabular}{llp{6cm}} +% key & applicable commands & note\\\hline +% urlencode & \cs{hrefurl} & if set the code will convert the argument to percent encoding. This allows non-ascii input.\\ +% protocol & \cs{hrefurl}, \cs{url} & This sets a prefix/protocol that is added to the url, see below. \\ +% format & \cs{url} & a command used to format the printed text. It replaces the standard \cs{Url}. This can improve non-ascii +% typesetting at the cost of losing the special line breaking.\\ +% destination & \cs{href}, \cs{hrefpdf} & A destination name in the PDF\\ +% page & \cs{href}, \cs{hrefpdf} & destination page, default: 1\\ +% pdfremotestartview &\cs{href}, \cs{hrefpdf} & start view, default: Fit\\ +% ismap & \cs{href}, \cs{hrefurl} & see PDF reference\\ +% afrelationship & \cs{href}, \cs{hrefpdf} & Changes the /AFRelationship key of the filespec dictionary. The value should be a PDF name without the starting slash.\\ +% run-parameter & \cs{hreflaunch} & run parameter (see the PDF reference)\\ +% nextactionraw & various & puts a /Next entry in the action dictionary (see the PDF reference)\\ +% \end{tabular} +% +% +% The first four keys can be set also in \cs{hypersetup} for all following commands in +% the current group through the keys +% \texttt{href/urlencode}, \texttt{href/protocol}, \texttt{href/destination}, \texttt{href/format}. +% +% It is possible to define own url commands with specific options e.g. with +% +% \begin{verbatim} +% \NewDocumentCommand\myurl{O{}}{\url[protocol=https://,format=\textsc,#1]} +% \end{verbatim} % % \section{Link decorations: border, color, OCG-color, \ldots} % Some main changes are @@ -329,7 +438,7 @@ % % The new key |colorscheme| allows to switch the colors (both for text and borders) % with a key word. It takes one of the values -% |orginal| (the colors as hyperref uses normally), |phelype|, |daleif|, +% |orginal| (the colors as \pkg{hyperref} uses normally), |phelype|, |daleif|, % |szabolcsA|, |szabolcsB|, |tivv|, |julian|, |henryford|. % % The names refer to the authors in answers and comments in @@ -396,7 +505,7 @@ % to pdftex and luatex driver, but a change for the xetex and dvips driver. % The (undocumentated) command \cs{setpdflinkmargin} does nothing. % Use either the key |pdflinkmargin| or \cs{pdfannot_link_margin:n} to change the margin. -% See also the description in section~\ref{sec:keydesc} and in the hyperref manual. +% See also the description in section~\ref{sec:keydesc} and in the \pkg{hyperref} manual. % \end{description} % % \section{PDF strings} @@ -483,7 +592,7 @@ % in \cs{hypersetup} and disable links and anchors completely. % The new driver passes the options also to the \pkg{bookmark} package if % \pkg{bookmark} hasn't been loaded yet as bookmarks can't work properly if -% the anchors from hyperref are missing. +% the anchors from \pkg{hyperref} are missing. % % \DescribeHypkey{link}% % \DescribeHypkey{url}% @@ -812,8 +921,7 @@ %<@@=hyp> % \end{macrocode} % \begin{macrocode} -\ProvidesFile{hgeneric-testphase.def} - [2021/02/22 v0.95b % +\ProvidesFile{hgeneric-testphase.def}[2021-03-17 v0.95c % generic Hyperref driver for the LaTeX PDF management testphase bundle] \RequirePackage{etoolbox} %why? @@ -989,9 +1097,10 @@ % \section{Variants} % \begin{macrocode} \cs_generate_variant:Nn\pdf_destination:nn {nf} +\cs_generate_variant:Nn\pdf_object_ref:n {e} % \end{macrocode} % \section{Overwriting/providing commands from hyperref} -% hyperref checks driver version, we need to suppress this during the development +% \pkg{hyperref} checks driver version, we need to suppress this during the development % \begin{macrocode} \chardef\Hy@VersionChecked=1 %don't check the version! % \end{macrocode} @@ -1066,7 +1175,165 @@ } } % \end{macrocode} +% Allow non-ascii in href, and add more href versions. +% We add a few new keys: +% |urlencode| to force percent encoding (\cs{hrefurl}, \cs{href}) +% |protocol | to add a protocol (\cs{hrefurl}, +% \cs{href} doesn't work here as it needs the colon for the split and the guessing.) +% |destination| to add a destination (\cs{hrefpdf}) % +% \begin{macrocode} + +\bool_new:N \l_@@_href_url_encode_bool +\bool_new:N \l_@@_href_url_ismap_bool +\tl_new:N \l_@@_href_url_protocol_tl +\tl_new:N \l_@@_href_pdf_destination_tl +\tl_new:N \l_@@_href_pdf_page_tl +\tl_new:N \l_@@_href_run_parameter_tl +\cs_new_protected:Npn \@@_href_url_format {\begingroup\Url} + + +\keys_define:nn { hyp / href } + { + ,urlencode .bool_set:N = \l_@@_href_url_encode_bool + ,format .code:n = { \cs_set_eq:NN \@@_href_url_format #1 }, + ,protocol .tl_set:N = \l_@@_href_url_protocol_tl + ,destination .tl_set:N = \l_@@_href_pdf_destination_tl + ,pdfremotestartview .code:n = + { + \keys_set:nn { hyp / setup } + { pdfremotestartview = #1 } + } + ,page .code:n = + { + \tl_set:Nn \l_@@_href_pdf_page_tl {#1} + \tl_set:Nn \Hy@href@page {#1} + } + ,ismap .bool_set:N = \l_@@_href_url_ismap_bool + ,run-parameter .tl_set:N = \l_@@_href_run_parameter_tl + ,nextactionraw .code:n = + { %perhaps some safety match later, see hyperref code + \tl_if_empty:nTF + { + \pdfdict_remove:nn{l_hyp/annot/A}{Next} + } + { + \pdfdict_put:nnn{l_hyp/annot/A}{Next}{#1} + \tl_set:Nn \Hy@href@nextactionraw {/Next~#1} + \keys_set:nn {hyp / setup }{ pdfnewwindow = true} + } + } + ,afrelationship .code:n = + { + \pdfdict_put:nnx + { l_pdffile/Filespec}{AFRelationship}{ \pdf_name_from_unicode_e:n {#1}} + } + + } + +\keys_define:nn { hyp / setup } + { + ,href / urlencode .bool_set:N = \l_@@_href_url_encode_bool + ,href / urlencode .default:n = {true} + ,href / urlencode .initial:n = {false} + ,href / protocol .tl_set:N = \l_@@_href_url_protocol_tl + ,href / destination .tl_set:N = \l_@@_href_pdf_destination_tl + ,href / format .code:n = { \cs_set_eq:NN \@@_href_url_format #1 } + } + + + +\DeclareRobustCommand*{\href}[1][]{% + \begingroup + \keys_set:nn { hyp / href } {#1} + \let\protect\@unexpandable@protect + \bool_if:NTF \l_@@_href_url_encode_bool + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/URI} + } + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/string} + } + \@ifnextchar\bgroup\Hy@href{\hyper@normalise\href@}% +} + + +\DeclareRobustCommand*{\hrefurl}[1][]{ + \group_begin: + \keys_set:nn { hyp / href } {#1} + \let\protect\@unexpandable@protect + \bool_if:NTF \l_@@_href_url_encode_bool + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/URI} + } + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/string} + } + \hyper@normalise\@@_href_url_aux:nn} + +\cs_new_protected:Npn \@@_href_url_aux:nn #1 #2 + { + \exp_args:Nno\hyper@linkurl{#2}{\l_@@_href_url_protocol_tl#1} + \group_end: + } + + +\DeclareRobustCommand*{\hrefpdf}[1][] + { + \begingroup + \keys_set:nn { hyp / href } {#1} + \let\protect\@unexpandable@protect + \hyper@normalise\@@_href_pdf_aux:nn + } + +\cs_new_protected:Npn \@@_href_pdf_aux:nn #1 #2 + { + \exp_args:Nnno\hyper@linkfile{#2}{#1}{\l_@@_href_pdf_destination_tl}\endgroup + } + +\DeclareRobustCommand*{\hrefrun}[1][] + { + \group_begin: + \keys_set:nn { hyp / href } {#1} + \let\protect\@unexpandable@protect + \hyper@normalise\@@_href_run_aux:nn + } + +\cs_new_protected:Npn \@@_href_run_aux:nn #1 #2 + { + \exp_args:Nnno\hyper@linklaunch{#2}{#1}{\l_@@_href_run_parameter_tl} + \group_end: + } + +\DeclareRobustCommand*{\url}[1][] + { + \group_begin: + \keys_set:nn {hyp / href } {#1} + \let\protect \@unexpandable@protect + \bool_if:NTF \l_@@_href_url_encode_bool + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/URI} + } + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/string} + } + \hyper@normalise\@@_href_url_aux:n + } + +\cs_new_protected:Npn \@@_href_url_aux:n #1 + { + \exp_args:Nno + \hyper@linkurl{\@@_href_url_format {#1}} + {\l_@@_href_url_protocol_tl#1} + \group_end: + } + + +\NewExpandableDocumentCommand\@@_secondoftwowithopt:wnn {omm}{#3} +\pdfstringdefDisableCommands{\let\hrefurl\@@_secondoftwowithopt:wnn} +\pdfstringdefDisableCommands{\let\hrefpdf\@@_secondoftwowithopt:wnn} +\pdfstringdefDisableCommands{\let\hrefrun\@@_secondoftwowithopt:wnn} +% \end{macrocode} % \section{Compability commands} % \subsection{Metadata} % A number of values should be accessible from other packages. Until now @@ -1591,7 +1858,7 @@ % \end{macrocode} % \end{macro} % \section {Core Hyperref Commands} -% Every hyperref has to define eight core command: +% Every \pkg{hyperref} has to define eight core command: % \begin{verbatim} % \hyper@anchor % \hyper@anchorstart @@ -1719,7 +1986,7 @@ } % \end{macrocode} % -% Now the three hyperref commands. +% Now the three \pkg{hyperref} commands. % The splitted commands \cs{hyper@linkstart} and \cs{hyper@linkend} are used for % footnotemarks, toc and natbib-cites. % \begin{function}{\hyper@link} @@ -1768,7 +2035,8 @@ \__hyp_link_goto_end: \group_end: \Hy@VerboseLinkStop - }{#3} + } + {{\let\protect\relax#3}} } \cs_new_protected:Npn \hyper@linkstart #1 #2 %#1 context, #2=destination name @@ -1810,13 +2078,9 @@ { \l_@@_text_enc_uri_print_tl } \l_@@_uri_tmpa_tl \pdfdict_put:nno{l_hyp/annot/A/URI}{URI}{\l_@@_uri_tmpa_tl} - \ifHy@href@ismap - \pdfdict_put:nnn{l_hyp/annot/A/URI}{IsMap}{true} - \fi - \tl_if_empty:NF \Hy@href@nextactionraw + \bool_if:NT \l_@@_href_url_ismap_bool { - \str_remove_once:Nn \Hy@href@nextactionraw {/Next} - \pdfdict_put:nno{l_hyp/annot/A/Next}{\Hy@href@nextactionraw} + \pdfdict_put:nnn{l_hyp/annot/A/URI}{IsMap}{true} } \cs_set_eq:NN \# \c_hash_str \cs_set_eq:NN \% \c_percent_str @@ -1825,19 +2089,16 @@ \pdfannot_dict_put:nnx {link/URI}{A}{<<\pdfdict_use:n {l_hyp/annot/A/URI}>>} \pdfannot_link:nxn { URI } { - % /A -% << -% \pdfdict_use:n {l_hyp/annot/A/URI} -% >> } { + \let\protect\relax #1 \Hy@xspace@end \Hy@VerboseLinkStop %where is the start?? } \group_end: } - {#1} + {{\let\protect\relax#1}} } % \end{macrocode} @@ -1847,52 +2108,60 @@ \pdfdict_put:nnn {l_hyp/annot/A/GoToR}{Type}{/Action} \pdfdict_put:nnn {l_hyp/annot/A/GoToR}{S}{/GoToR} + \cs_new_protected:Npn \hyper@linkfile #1 #2 #3 % link text, filename, destname { \bool_if:NTF \l_@@_annot_GoToR_bool { \group_begin: - \tl_set:Nn \l_@@_filename_tmpa_tl { #2 } - \Hy@CleanupFile \l_@@_filename_tmpa_tl - \@@_text_pdfstring:ooN - { \l_@@_filename_tmpa_tl } - { \l_@@_text_enc_file_print_tl } - \l_@@_filename_tmpa_tl - \pdfdict_put:nno {l_hyp/annot/A/GoToR}{F}{\l_@@_filename_tmpa_tl} + \tl_set:Nx \l_@@_filename_tmpa_tl { \text_expand:n { #2 } } + \exp_args:Nx + \pdf_object_if_exist:nF { @@_file_\tl_to_str:N \l_@@_filename_tmpa_tl } + { + \pdfdict_put:nnx { l_pdffile/Filespec}{Subtype}{\pdf_name_from_unicode_e:n {application/pdf}} + \exp_args:Nnox + \pdffile_embed_file:nnn + {} + {\l_@@_filename_tmpa_tl } + {@@_file_\tl_to_str:N \l_@@_filename_tmpa_tl } + } + \pdfdict_put:nnx + {l_hyp/annot/A/GoToR} + {F} + {\pdf_object_ref:e {@@_file_\tl_to_str:N \l_@@_filename_tmpa_tl}} \@@_text_pdfstring:nnN { #3 } { \l_@@_text_enc_dest_print_tl } \l_@@_dest_name_tmpa_tl - \Hy@MakeRemoteAction \tl_if_blank:eTF {#3} { \pdfdict_put:nnx {l_hyp/annot/A/GoToR}{D} - {[\Hy@href@page/\l_@@_dest_pdfremotestartview_tl]} + { + [ + \int_eval:n + { \int_max:nn {0}{ 0\l_@@_href_pdf_page_tl - 1 }} + /\l_@@_dest_pdfremotestartview_tl + ] + } } { \pdfdict_put:nno {l_hyp/annot/A/GoToR}{D}{\l_@@_dest_name_tmpa_tl} } - \tl_if_empty:NF \Hy@href@nextactionraw - { - \str_remove_once:Nn \Hy@href@nextactionraw {/Next} - \pdfdict_put:nno{l_hyp/annot/A/Next}{Next}{\Hy@href@nextactionraw} - } \mode_leave_vertical: - \pdfannot_dict_put:nnx {link/GoToR}{A}{<<\pdfdict_use:n {l_hyp/annot/A/GoToR}>>} + \pdf_object_unnamed_write:nx{dict}{\pdfdict_use:n {l_hyp/annot/A/GoToR}} + \pdfannot_dict_put:nnx {link/GoToR}{A}{\pdf_object_ref_last:} \pdfannot_link:nxn %expansion?? { GoToR } { - % /A<< -% \pdfdict_use:n {l_hyp/annot/A/GoToR} -% >> } { + \let\protect\relax #1\Hy@xspace@end \Hy@VerboseLinkStop %where is the start?? } \group_end: } - {#1} + {{\let\protect\relax#1}} } % \end{macrocode} % @@ -1931,11 +2200,6 @@ \pdfdict_put:nnx {l_hyp/annot/A/Launch}{Win} {<

>} } - \tl_if_empty:NF \Hy@href@nextactionraw - { - \str_remove_once:Nn \Hy@href@nextactionraw {/Next} - \pdfdict_put:nno{l_hyp/annot/A/Next}{Next}{\Hy@href@nextactionraw} - } \mode_leave_vertical: \pdfannot_dict_put:nnx {link/Launch}{A}{<<\pdfdict_use:n {l_hyp/annot/A/Launch}>>} \pdfannot_link:nxn @@ -1947,15 +2211,16 @@ % >> } { + \let\protect\relax #2\Hy@xspace@end \Hy@VerboseLinkStop %where is the start?? } \group_end: } - {#2} + {{\let\protect\relax#2}} } % \end{macrocode} -% The actually command used by hyperref is \cs{@hyper@launch} which uses a delimited +% The actually command used by \pkg{hyperref} is \cs{@hyper@launch} which uses a delimited % argument, because of the color the definition is a bit convoluted. % \begin{macrocode} \use:x @@ -1984,11 +2249,6 @@ \mode_leave_vertical: \pdfdict_put:nnx {l_hyp/annot/A/Named}{N} {\pdf_name_from_unicode_e:n{#1}} - \tl_if_empty:NF \Hy@href@nextactionraw - { - \str_remove_once:Nn \Hy@href@nextactionraw {/Next} - \pdfdict_put:nno{l_hyp/annot/A/Next}{Next}{\Hy@href@nextactionraw} - } \pdfannot_dict_put:nnx {link/Named}{A}{<<\pdfdict_use:n {l_hyp/annot/A/Named}>>} \pdfannot_link:nxn { Named } { @@ -2009,7 +2269,7 @@ } \group_end: } - {#2} + {{\let\protect\relax#2}} } % \end{macrocode} @@ -2117,7 +2377,7 @@ % \end{macro} % \subsection{Textcolor of links} % colors are added in the hooks. This means that they can also be removed if needed. -% They add a group---this isn't needed with hyperref code, but could be relevant +% They add a group---this isn't needed with \pkg{hyperref} code, but could be relevant % with low-level annotations. % \begin{macrocode} \prop_map_inline:Nn \c_@@_map_hyp_annot_prop @@ -2472,19 +2732,9 @@ % These are the keys for ocgcolors. We try to disable it % for pdf version below 1.5 % \begin{macrocode} -\pdf_version_compare:NnTF < {1.5} - { - \keys_define:nn { hyp / setup } - { - ,_ocgcolorlinks .code:n = - { - \msg_warning:nnxx - { hyp } - { ignore-deprecated-or-unknown-option-in-pdf-version } - { ocgcolorlinks } { \pdf_version_major:.\pdf_version_minor: } - } - } - } +\bool_lazy_or:nnTF + { \pdf_version_compare_p:Nn > {1.4} } + { \str_if_eq_p:ee{\pdf_version_major:}{-1} } { \keys_define:nn { hyp / setup } { @@ -2499,6 +2749,18 @@ ,_ocgcolorlinks .default:n = true } } + { + \keys_define:nn { hyp / setup } + { + ,_ocgcolorlinks .code:n = + { + \msg_warning:nnxx + { hyp } + { ignore-deprecated-or-unknown-option-in-pdf-version } + { ocgcolorlinks } { \pdf_version_major:.\pdf_version_minor: } + } + } + } \keys_define:nn { hyp / setup } { @@ -2519,7 +2781,15 @@ \seq_map_inline:Nn \c_@@_annot_types_seq { - \pdf_version_compare:NnTF < {1.5} + \bool_lazy_or:nnTF + { \pdf_version_compare_p:Nn > {1.4} } + { \str_if_eq_p:ee{\pdf_version_major:}{-1} } + { + \keys_define:nn { hyp / setup } + { + ,ocgcolor#1 .bool_set:c = { l_hyp_annot_ocgcolor#1_bool } + } + } { \keys_define:nn { hyp / setup } { @@ -2533,12 +2803,6 @@ } } } - { - \keys_define:nn { hyp / setup } - { - ,ocgcolor#1 .bool_set:c = { l_hyp_annot_ocgcolor#1_bool } - } - } } % \end{macrocode} % \end{hypkey} @@ -3678,7 +3942,7 @@ % set in the preamble for all pages or in the document for the current and the % following pages. Due to the asynchronous page breaking one has to be careful % to set it on the right page, e.g. only after a |\newpage|. -% The generic driver uses a different syntax than the other hyperref drivers: +% The generic driver uses a different syntax than the other \pkg{hyperref} drivers: % various transition options can be set by a keyval syntax in the value of % |pdfpagetransition|. A typical setting looks e.g. like this\\ % |\hypersetup{pdfpagetransition={style=Fly,duration=2,direction=90,opaque=false}}| diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx index 796ba7f701a..1b1e1b1b91f 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx @@ -45,7 +45,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % @@ -56,27 +56,27 @@ % \begin{macrocode} %\ProvidesExplFile %<*dvipdfmx> - {l3backend-testphase-dvipdfmx.def}{2021-03-07}{} + {l3backend-testphase-dvipdfmx.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx} % %<*dvips> - {l3backend-testphase-dvips.def}{2021-03-07}{} + {l3backend-testphase-dvips.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvips} % %<*dvisvgm> - {l3backend-testphase-dvisvgm.def}{2021-03-07}{} + {l3backend-testphase-dvisvgm.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm} % %<*luatex> - {l3backend-testphase-luatex.def}{2021-03-07}{} + {l3backend-testphase-luatex.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)} % %<*pdftex> - {l3backend-testphase-pdftex.def}{2021-03-07}{} + {l3backend-testphase-pdftex.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)} % %<*xdvipdfmx> - {l3backend-testphase-xetex.def}{2021-03-07}{} + {l3backend-testphase-xetex.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX} % % \end{macrocode} @@ -144,6 +144,22 @@ \directlua { require("l3backend-testphase.lua") } % % \end{macrocode} +% \subsection{Converting unicode strings to a pdfname} +% dvips needs a special function here, so we add this as backend function. +% \begin{macrocode} +%<*pdftex|luatex|dvipdfmx|xdvipdfmx|dvisvgm> +\cs_new:Npn \__kernel_pdf_name_from_unicode_e:n #1 + { + / \str_convert_pdfname:e { \text_expand:n { #1 } } + } +% +%<*dvips> +\cs_new:Npn \__kernel_pdf_name_from_unicode_e:n #1 + { + ~ ( \text_expand:n { #1 } ) ~ cvn + } +% +% \end{macrocode} % \subsection{Hooks} % \subsubsection{Add the \enquote{end run} hooks} % Here we add the end run hook to suitable diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx index 71ee24f53df..256e3e6dc9b 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx @@ -52,7 +52,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-02-21} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -163,7 +163,8 @@ % \texttt{Launch}, \texttt{GoTo} or \texttt{Named}. The dictionary can be changed % by the commands \cs{pdfannot_dict_put:nnn} and friends described below. % \end{variable} -% \begin{function}[added = 2020-03-12, updated = 2020-12-06]{ \pdfannot_link:nnn } +% \begin{function}[added = 2020-03-12, updated = 2020-12-06] +% { \pdfannot_link:nnn,\pdfannot_link:nxn } % \begin{syntax} % \cs{pdfannot_link:nnn} \Arg{type} \Arg{user action spec} \Arg{link text} % \end{syntax} @@ -191,22 +192,56 @@ % text. None of the hooks introduce a group. % \meta{type} should normally be identical to the value of the |/S| key % in the action dictionary. -% As example +% As example either with a direct action % \begin{verbatim} +% \pdfannot_link:nnn { URI } +% { +% /A<< +% /Type/Action +% /S/URI +% /URI(https://www.latex-project.org) +% >> +% } +% { link text} +% \end{verbatim} +% Or through a dictionary: +% \begin{verbatim} +% \pdfdict_new:n {l_my_action_dict} +% \pdfdict_put:nnn {l_my_action_dict}{Type}{/Action} +% \pdfdict_put:nnn {l_my_action_dict}{S}{/URI} +% \pdfdict_put:nnn {l_my_action_dict}{URI}{(https://www.latex-project.org)} +% % \pdfannot_dict_put:nnn % {link/URI} { C } {[1~0~0]} %red border -% \pdfannot_link:nnn { URI } +% +% \pdfannot_link:nxn { URI } % { -% /A -% << -% /Type/Action -% /S/URI -% /URI(https://www.latex-project.org) -% >> +% /A <<\pdfdict_use:n{l_my_action_dict}>> % } % { link text } % \end{verbatim} % +% Or if you want to exclude the possibility of a duplicated /A entry +% (if the action is already in the link/GoTo dictionary e.g. if you can expect +% other packages to add a dictionary). An alternative is to ensure that +% no /A is there by removing it explicitly. +% +% \begin{verbatim} +% \pdfdict_new:n {l_my_action_dict} +% \pdfdict_put:nnn {l_my_action_dict}{Type}{/Action} +% \pdfdict_put:nnn {l_my_action_dict}{S}{/URI} +% \pdfdict_put:nnn {l_my_action_dict}{URI}{(https://www.latex-project.org)} +% +% +% \pdfannot_dict_put:nnn +% {link/URI} { C } {[1~0~0]} %red border +% +% \group_begin: +% \pdfannot_dict_put:nnx {link/GoTo}{A}{<<\pdfdict_use:n{l_my_action_dict}>>} +% \pdfannot_link:nnn { URI }{}{ link text } +% \group_end: +% \end{verbatim} +% % % \end{function} % \begin{function}[updated = 2020-12-06]{ \pdfannot_link_begin:nnw, \pdfannot_link_end:n } @@ -357,7 +392,7 @@ % \begin{macrocode} %<@@=pdfannot> %<*header> -\ProvidesExplPackage {l3pdfannot} {2021-03-07} {0.95b} +\ProvidesExplPackage{l3pdfannot}{2021-03-17}{0.95c} {PDF-annotations} \RequirePackage{l3pdfdict} % diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx index 2362863e3ac..25a3599445c 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -212,7 +212,7 @@ % \begin{macrocode} %<@@=pdfdict> %<*header> -\ProvidesExplPackage {l3pdfdict} {2021-03-07} {0.95b} +\ProvidesExplPackage{l3pdfdict}{2021-03-17}{0.95c} {Tools for PDF dictionaries (LaTeX PDF management testphase bundle)} % % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx index 3d7e6123e11..dc3fcc3df6a 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx @@ -68,7 +68,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -349,7 +349,8 @@ %<*package> %<@@=pdffield> \NeedsTeXFormat{LaTeX2e} -\ProvidesExplPackage{l3pdffield-checkbox}{0000-00-00}{v0.00a}{form field checkbox}% +\ProvidesExplPackage{l3pdffield-testphase}{2021-03-17}{0.95c}% + {form field checkboxes} % \end{macrocode} % \subsection{hyperref specific command} % hyperref sets NeedAppearances by default. As this is deprecated we disable this. @@ -397,26 +398,26 @@ % \begin{macrocode} \bitset_new:Nn \l_@@_Ff_bitset { - ReadOnly = 0, - Required = 1, - NoExport = 2, - Multiline = 12,%Tx - Password = 13, - NoToggleToOff = 14,%Btn, radio button - Radio = 15,%Btn: Radio: 15=1, 16=0 - Pushbutton = 16,%Btn: Checkbox: 15=0, 16=0 + ReadOnly = 1, + Required = 2, + NoExport = 3, + Multiline = 13,%Tx + Password = 14, + NoToggleToOff = 15,%Btn, radio button + Radio = 16,%Btn: Radio: 15=1, 16=0 + Pushbutton = 17,%Btn: Checkbox: 15=0, 16=0 %Btn: Pushbutton: 16=1 - Combo = 17,%Ch: Combo=1 List=0 - Edit = 18,%Ch, Combo=1 -> + edit field - Sort = 19,%Ch, not relevant for view... - FileSelect = 20,%Tx - MultiSelect = 21,%Ch - DoNotSpellCheck = 22,%Tx, Ch (if Combo + Edit set) - DoNotScroll = 23,%Tx - Comb = 24,%Tx, requires MaxLen in dict - RadiosInUnison = 25,%Btn Radio - RichText = 25,%Tx - CommitOnSelChange = 26 + Combo = 18,%Ch: Combo=1 List=0 + Edit = 19,%Ch, Combo=1 -> + edit field + Sort = 20,%Ch, not relevant for view... + FileSelect = 21,%Tx + MultiSelect = 22,%Ch + DoNotSpellCheck = 23,%Tx, Ch (if Combo + Edit set) + DoNotScroll = 24,%Tx + Comb = 25,%Tx, requires MaxLen in dict + RadiosInUnison = 26,%Btn Radio + RichText = 26,%Tx + CommitOnSelChange = 27 } \bitset_new:Nn \l_@@_F_bitset @@ -881,7 +882,7 @@ \cs_new_protected:Npn \pdffield_setup:nn #1 #2 { - \keys_set:n {pdffield / #1 } {#2} + \keys_set:nn {pdffield / #1 } {#2} } % % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx index 4a65e09fd67..e8810f81ffe 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -125,7 +125,7 @@ % \end{verbatim} % The strings (keys) in the |/Names| dictionary must be sorted lexically. % But they don't have to be the file name or anything related to -% the file name. The resource management code uses l3emb0001, l3emb0002~\ldots, +% the file name. The resource management code uses l3ef0001, l3ef0002~\ldots, % which allows up to 9999 files. % The key can be needed to identify the start file in a collection, % so their relation to the files are stored in a property list. @@ -376,7 +376,7 @@ % % \begin{macrocode} %<*header> -\ProvidesExplPackage {l3pdffile} {2021-03-07} {0.95b} +\ProvidesExplPackage{l3pdffile}{2021-03-17}{0.95c} {embedding and referencing files in PDF---LaTeX PDF management testphase bundle} \RequirePackage{l3pdftools} %temporarly!! % diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx index f6b9a7fafe1..e22600ea5bb 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx @@ -61,7 +61,7 @@ % }^^A % } % -% \date{Version 0.95b,released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -557,7 +557,7 @@ %<@@=pdfmanagement> %<*header> % -\ProvidesExplPackage {l3pdfmanagement} {2021-03-07} {0.95b} +\ProvidesExplPackage{l3pdfmanagement}{2021-03-17}{0.95c} {Management of core PDF dictionaries (LaTeX PDF management testphase bundle)} % % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx index 48d2f147592..2b48f0646c4 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-02-21} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -340,7 +340,7 @@ % \begin{macrocode} %<@@=pdfmeta> %<*header> -\ProvidesExplPackage {l3pdfmeta} {2021-03-07} {0.95b} +\ProvidesExplPackage{l3pdfmeta}{2021-03-17}{0.95c} {PDF-Standards---LaTeX PDF management testphase bundle} % % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx index d1ded1659b8..60d60d184ed 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -68,13 +68,20 @@ % \cs{pdf_name_from_unicode_e:n} \Arg{content} % \end{syntax} % This converts \meta{content} to a format suitable for a PDF Name. -% It will first expand the content with \cs{text_expand:n} and +% The output depends on the backend: For almost all backends +% it will first expand the content with \cs{text_expand:n} and % then escape it in the way needed in a PDF Name with % \cs{str_convert_pdfname:e}, and at last prepend a slash before. % Typically such names use only ascii, % but non-ascii is supported, but should be utf8 encoded. For example\\ % |\pdf_name_from_unicode_e:n {A~B\c_percent_str C\c_hash_str D€}}|\\ % will output |/A#20B#25C#23D#E2#82#AC|. +% +% With dvips it will expand the content with \cs{text_expand:n} and then wrap it +% in a |cvn| operation (\enquote{convert to name}). +% So the example above will output |(A B%C#D€) cvn| to +% the postscript. The content should not contain unbalanced parentheses with dvips. +% % \end{function} % \begin{function}[added=2020-07-04] % {\pdf_string_from_unicode:nnN} @@ -208,7 +215,7 @@ % % \begin{macrocode} %<*header> -\ProvidesExplPackage {l3pdftools} {2021-03-07} {0.95b} +\ProvidesExplPackage{l3pdftools}{2021-03-17}{0.95c} {candidate commands for l3pdf---LaTeX PDF management testphase bundle} % % \end{macrocode} @@ -224,7 +231,7 @@ \cs_new:Npn \pdf_name_from_unicode_e:n #1 { - / \str_convert_pdfname:e { \text_expand:n { #1 } } + \__kernel_pdf_name_from_unicode_e:n { #1 } } \cs_generate_variant:Nn \pdf_name_from_unicode_e:n {V} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx index fa522534717..f0fcda4aab4 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx @@ -52,7 +52,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -133,7 +133,7 @@ % \begin{macrocode} %<@@=pdf> %<*header> -\ProvidesExplPackage {l3pdfxform-beta} {2021-03-07} {0.95b} +\ProvidesExplPackage{l3pdfxform}{2021-03-17}{0.95c} {command to create xforms (beta)---LaTeX PDF management testphase bundle} % % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx index 53bb237c696..fec2da64ba2 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -164,7 +164,7 @@ % \begin{macrocode} %<@@=pdfmanagement> %<*header> -\ProvidesExplPackage {ltdocinit} {2021-03-07} {0.95b} +\ProvidesExplPackage{ltdocinit}{2021-03-17}{0.95c} {Initialize document metadata} % % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx index dc33bf093c1..54fb0ffa102 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -67,7 +67,7 @@ % |firstaidoff={name1,name2,...}|. % \begin{macrocode} %<*package> -\ProvidesExplPackage {pdfmanagement-firstaid} {2021-03-07} {0.95b} +\ProvidesExplPackage{pdfmanagement-firstaid}{2021-03-17}{0.95c} {LaTeX PDF management testphase bundle / firstaid-patches} %<@@=pdfmanagement> @@ -204,7 +204,7 @@ % the commands to add page resources \def\pgf@sys@addpdfresource@extgs@plain##1 { - \exp_after:wN %for transparent which passes a command + %\exp_after:wN %for transparent which passes a command \@@_patch_pgfextgs:w ##1\q_stop } \def\pgf@sys@addpdfresource@patterns@plain##1 @@ -226,11 +226,13 @@ \tl_set:Nn #2 {#4} } +\cs_generate_variant:Nn \tl_trim_spaces:n{V} +\cs_generate_variant:Nn \__pdf_backend_PageResources_gput:nnn {nex} \cs_new:Npn \@@_patch_pgfextgs:w #1/#2<<#3>>#4\q_stop { - \exp_args:Nne - \__pdf_backend_PageResources_gput:nnn - {ExtGState}{\tl_trim_spaces:n{#2}}{<<#3>>} + \tl_set:Nx\l_tmpa_tl{#2} + \__pdf_backend_PageResources_gput:nex + {ExtGState}{\tl_trim_spaces:V\l_tmpa_tl}{<<#3 #4>>} } \cs_new:Npn \@@_patch_pgfpatterns:w #1/#2\space#3\q_stop { diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx index 7f37e132d7a..8cee17982e0 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Version 0.95b, released 2021-03-07} +% \date{Version 0.95c, released 2021-03-17} % % \maketitle % \begin{documentation} @@ -384,7 +384,7 @@ % \begin{macrocode} %<@@=pdf> %<*package> -\ProvidesExplPackage {pdfmanagement-testphase} {2021-03-07} {0.95b} +\ProvidesExplPackage{pdfmanagement-testphase}{2021-03-17}{0.95c} {LaTeX PDF management testphase bundle} \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \IfFormatAtLeastTF{2020-10-01}{}{ @@ -411,8 +411,7 @@ % to allow to set it in the document. % \begin{macrocode} %<*header> -\ProvidesExplFile - {pdfmanagement-testphase.ltx}{2021-03-07}{0.95b} +\ProvidesExplFile{pdfmanagement-testphase.ltx}{2021-03-17}{0.95c} {PDF~management~code~(testphase)} % %<*package> diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty index 0fbe8eb6717..15754414a16 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty @@ -22,8 +22,8 @@ %% This file has the LPPL maintenance status "maintained". %% \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{color-ltx} - [2021/03/07 v1.2e Standard LaTeX Color (patched for l3color, part of pdfmanagement-testphase 2021-03-07 v0.95b) (DPC)] +\ProvidesPackage{color-ltx}[2021-03-17 v0.95c + Standard LaTeX Color (patched for l3color, part of pdfmanagement-testphase, original version 2021/03/07 v1.2e) (DPC)] \edef\Gin@codes{% \catcode`\noexpand\^^A\the\catcode`\^^A\relax \catcode`\noexpand\"\the\catcode`\"\relax diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def index aa58d10853b..98d06175e9d 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def @@ -19,8 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: hyperref-generic.dtx -\ProvidesFile{hgeneric-testphase.def} - [2021/02/22 v0.95b % +\ProvidesFile{hgeneric-testphase.def}[2021-03-17 v0.95c % generic Hyperref driver for the LaTeX PDF management testphase bundle] \RequirePackage{etoolbox} %why? @@ -152,6 +151,7 @@ No~value~is~equivalent~to~using~`true`. } \cs_generate_variant:Nn\pdf_destination:nn {nf} +\cs_generate_variant:Nn\pdf_object_ref:n {e} \chardef\Hy@VersionChecked=1 %don't check the version! \cs_set_eq:NN \hypercalcbp \dim_to_decimal_in_bp:n \providecommand\@pdfborder{} @@ -186,6 +186,150 @@ { hyp~/~setup }{ \l_keys_key_str } { #1 } } } + +\bool_new:N \l__hyp_href_url_encode_bool +\bool_new:N \l__hyp_href_url_ismap_bool +\tl_new:N \l__hyp_href_url_protocol_tl +\tl_new:N \l__hyp_href_pdf_destination_tl +\tl_new:N \l__hyp_href_pdf_page_tl +\tl_new:N \l__hyp_href_run_parameter_tl +\cs_new_protected:Npn \__hyp_href_url_format {\begingroup\Url} + +\keys_define:nn { hyp / href } + { + ,urlencode .bool_set:N = \l__hyp_href_url_encode_bool + ,format .code:n = { \cs_set_eq:NN \__hyp_href_url_format #1 }, + ,protocol .tl_set:N = \l__hyp_href_url_protocol_tl + ,destination .tl_set:N = \l__hyp_href_pdf_destination_tl + ,pdfremotestartview .code:n = + { + \keys_set:nn { hyp / setup } + { pdfremotestartview = #1 } + } + ,page .code:n = + { + \tl_set:Nn \l__hyp_href_pdf_page_tl {#1} + \tl_set:Nn \Hy@href@page {#1} + } + ,ismap .bool_set:N = \l__hyp_href_url_ismap_bool + ,run-parameter .tl_set:N = \l__hyp_href_run_parameter_tl + ,nextactionraw .code:n = + { %perhaps some safety match later, see hyperref code + \tl_if_empty:nTF + { + \pdfdict_remove:nn{l_hyp/annot/A}{Next} + } + { + \pdfdict_put:nnn{l_hyp/annot/A}{Next}{#1} + \tl_set:Nn \Hy@href@nextactionraw {/Next~#1} + \keys_set:nn {hyp / setup }{ pdfnewwindow = true} + } + } + ,afrelationship .code:n = + { + \pdfdict_put:nnx + { l_pdffile/Filespec}{AFRelationship}{ \pdf_name_from_unicode_e:n {#1}} + } + + } + +\keys_define:nn { hyp / setup } + { + ,href / urlencode .bool_set:N = \l__hyp_href_url_encode_bool + ,href / urlencode .default:n = {true} + ,href / urlencode .initial:n = {false} + ,href / protocol .tl_set:N = \l__hyp_href_url_protocol_tl + ,href / destination .tl_set:N = \l__hyp_href_pdf_destination_tl + ,href / format .code:n = { \cs_set_eq:NN \__hyp_href_url_format #1 } + } + +\DeclareRobustCommand*{\href}[1][]{% + \begingroup + \keys_set:nn { hyp / href } {#1} + \let\protect\@unexpandable@protect + \bool_if:NTF \l__hyp_href_url_encode_bool + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/URI} + } + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/string} + } + \@ifnextchar\bgroup\Hy@href{\hyper@normalise\href@}% +} + +\DeclareRobustCommand*{\hrefurl}[1][]{ + \group_begin: + \keys_set:nn { hyp / href } {#1} + \let\protect\@unexpandable@protect + \bool_if:NTF \l__hyp_href_url_encode_bool + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/URI} + } + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/string} + } + \hyper@normalise\__hyp_href_url_aux:nn} + +\cs_new_protected:Npn \__hyp_href_url_aux:nn #1 #2 + { + \exp_args:Nno\hyper@linkurl{#2}{\l__hyp_href_url_protocol_tl#1} + \group_end: + } + +\DeclareRobustCommand*{\hrefpdf}[1][] + { + \begingroup + \keys_set:nn { hyp / href } {#1} + \let\protect\@unexpandable@protect + \hyper@normalise\__hyp_href_pdf_aux:nn + } + +\cs_new_protected:Npn \__hyp_href_pdf_aux:nn #1 #2 + { + \exp_args:Nnno\hyper@linkfile{#2}{#1}{\l__hyp_href_pdf_destination_tl}\endgroup + } + +\DeclareRobustCommand*{\hrefrun}[1][] + { + \group_begin: + \keys_set:nn { hyp / href } {#1} + \let\protect\@unexpandable@protect + \hyper@normalise\__hyp_href_run_aux:nn + } + +\cs_new_protected:Npn \__hyp_href_run_aux:nn #1 #2 + { + \exp_args:Nnno\hyper@linklaunch{#2}{#1}{\l__hyp_href_run_parameter_tl} + \group_end: + } + +\DeclareRobustCommand*{\url}[1][] + { + \group_begin: + \keys_set:nn {hyp / href } {#1} + \let\protect \@unexpandable@protect + \bool_if:NTF \l__hyp_href_url_encode_bool + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/URI} + } + { + \tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/string} + } + \hyper@normalise\__hyp_href_url_aux:n + } + +\cs_new_protected:Npn \__hyp_href_url_aux:n #1 + { + \exp_args:Nno + \hyper@linkurl{\__hyp_href_url_format {#1}} + {\l__hyp_href_url_protocol_tl#1} + \group_end: + } + +\NewExpandableDocumentCommand\__hyp_secondoftwowithopt:wnn {omm}{#3} +\pdfstringdefDisableCommands{\let\hrefurl\__hyp_secondoftwowithopt:wnn} +\pdfstringdefDisableCommands{\let\hrefpdf\__hyp_secondoftwowithopt:wnn} +\pdfstringdefDisableCommands{\let\hrefrun\__hyp_secondoftwowithopt:wnn} \cs_new_protected:Npn \__hyp_store_metadata:nn #1 #2 %#1 key, #2 value. { %\tl_set:cn {@#1}{#2} @@ -456,7 +600,8 @@ \__hyp_link_goto_end: \group_end: \Hy@VerboseLinkStop - }{#3} + } + {{\let\protect\relax#3}} } \cs_new_protected:Npn \hyper@linkstart #1 #2 %#1 context, #2=destination name @@ -493,13 +638,9 @@ { \l__hyp_text_enc_uri_print_tl } \l__hyp_uri_tmpa_tl \pdfdict_put:nno{l_hyp/annot/A/URI}{URI}{\l__hyp_uri_tmpa_tl} - \ifHy@href@ismap - \pdfdict_put:nnn{l_hyp/annot/A/URI}{IsMap}{true} - \fi - \tl_if_empty:NF \Hy@href@nextactionraw + \bool_if:NT \l__hyp_href_url_ismap_bool { - \str_remove_once:Nn \Hy@href@nextactionraw {/Next} - \pdfdict_put:nno{l_hyp/annot/A/Next}{\Hy@href@nextactionraw} + \pdfdict_put:nnn{l_hyp/annot/A/URI}{IsMap}{true} } \cs_set_eq:NN \# \c_hash_str \cs_set_eq:NN \% \c_percent_str @@ -508,16 +649,16 @@ \pdfannot_dict_put:nnx {link/URI}{A}{<<\pdfdict_use:n {l_hyp/annot/A/URI}>>} \pdfannot_link:nxn { URI } { - % /A } { + \let\protect\relax #1 \Hy@xspace@end \Hy@VerboseLinkStop %where is the start?? } \group_end: } - {#1} + {{\let\protect\relax#1}} } \pdfdict_new:n {l_hyp/annot/A/GoToR} @@ -529,45 +670,54 @@ \bool_if:NTF \l__hyp_annot_GoToR_bool { \group_begin: - \tl_set:Nn \l__hyp_filename_tmpa_tl { #2 } - \Hy@CleanupFile \l__hyp_filename_tmpa_tl - \__hyp_text_pdfstring:ooN - { \l__hyp_filename_tmpa_tl } - { \l__hyp_text_enc_file_print_tl } - \l__hyp_filename_tmpa_tl - \pdfdict_put:nno {l_hyp/annot/A/GoToR}{F}{\l__hyp_filename_tmpa_tl} + \tl_set:Nx \l__hyp_filename_tmpa_tl { \text_expand:n { #2 } } + \exp_args:Nx + \pdf_object_if_exist:nF { __hyp_file_\tl_to_str:N \l__hyp_filename_tmpa_tl } + { + \pdfdict_put:nnx { l_pdffile/Filespec}{Subtype}{\pdf_name_from_unicode_e:n {application/pdf}} + \exp_args:Nnox + \pdffile_embed_file:nnn + {} + {\l__hyp_filename_tmpa_tl } + {__hyp_file_\tl_to_str:N \l__hyp_filename_tmpa_tl } + } + \pdfdict_put:nnx + {l_hyp/annot/A/GoToR} + {F} + {\pdf_object_ref:e {__hyp_file_\tl_to_str:N \l__hyp_filename_tmpa_tl}} \__hyp_text_pdfstring:nnN { #3 } { \l__hyp_text_enc_dest_print_tl } \l__hyp_dest_name_tmpa_tl - \Hy@MakeRemoteAction \tl_if_blank:eTF {#3} { \pdfdict_put:nnx {l_hyp/annot/A/GoToR}{D} - {[\Hy@href@page/\l__hyp_dest_pdfremotestartview_tl]} + { + [ + \int_eval:n + { \int_max:nn {0}{ 0\l__hyp_href_pdf_page_tl - 1 }} + /\l__hyp_dest_pdfremotestartview_tl + ] + } } { \pdfdict_put:nno {l_hyp/annot/A/GoToR}{D}{\l__hyp_dest_name_tmpa_tl} } - \tl_if_empty:NF \Hy@href@nextactionraw - { - \str_remove_once:Nn \Hy@href@nextactionraw {/Next} - \pdfdict_put:nno{l_hyp/annot/A/Next}{Next}{\Hy@href@nextactionraw} - } \mode_leave_vertical: - \pdfannot_dict_put:nnx {link/GoToR}{A}{<<\pdfdict_use:n {l_hyp/annot/A/GoToR}>>} + \pdf_object_unnamed_write:nx{dict}{\pdfdict_use:n {l_hyp/annot/A/GoToR}} + \pdfannot_dict_put:nnx {link/GoToR}{A}{\pdf_object_ref_last:} \pdfannot_link:nxn %expansion?? { GoToR } { - % /A<< } { + \let\protect\relax #1\Hy@xspace@end \Hy@VerboseLinkStop %where is the start?? } \group_end: } - {#1} + {{\let\protect\relax#1}} } \pdfdict_new:n {l_hyp/annot/A/Launch} \pdfdict_put:nnn {l_hyp/annot/A/Launch}{Type}{/Action} @@ -600,11 +750,6 @@ \pdfdict_put:nnx {l_hyp/annot/A/Launch}{Win} {<

>} } - \tl_if_empty:NF \Hy@href@nextactionraw - { - \str_remove_once:Nn \Hy@href@nextactionraw {/Next} - \pdfdict_put:nno{l_hyp/annot/A/Next}{Next}{\Hy@href@nextactionraw} - } \mode_leave_vertical: \pdfannot_dict_put:nnx {link/Launch}{A}{<<\pdfdict_use:n {l_hyp/annot/A/Launch}>>} \pdfannot_link:nxn @@ -613,12 +758,13 @@ % /A } { + \let\protect\relax #2\Hy@xspace@end \Hy@VerboseLinkStop %where is the start?? } \group_end: } - {#2} + {{\let\protect\relax#2}} } \use:x { % filename, anchor text, linkname @@ -641,11 +787,6 @@ \mode_leave_vertical: \pdfdict_put:nnx {l_hyp/annot/A/Named}{N} {\pdf_name_from_unicode_e:n{#1}} - \tl_if_empty:NF \Hy@href@nextactionraw - { - \str_remove_once:Nn \Hy@href@nextactionraw {/Next} - \pdfdict_put:nno{l_hyp/annot/A/Next}{Next}{\Hy@href@nextactionraw} - } \pdfannot_dict_put:nnx {link/Named}{A}{<<\pdfdict_use:n {l_hyp/annot/A/Named}>>} \pdfannot_link:nxn { Named } { @@ -662,7 +803,7 @@ } \group_end: } - {#2} + {{\let\protect\relax#2}} } \cs_new_protected:Npn \__hyp_color_export:nnN #1 #2 #3 @@ -1002,19 +1143,9 @@ } } } -\pdf_version_compare:NnTF < {1.5} - { - \keys_define:nn { hyp / setup } - { - ,_ocgcolorlinks .code:n = - { - \msg_warning:nnxx - { hyp } - { ignore-deprecated-or-unknown-option-in-pdf-version } - { ocgcolorlinks } { \pdf_version_major:.\pdf_version_minor: } - } - } - } +\bool_lazy_or:nnTF + { \pdf_version_compare_p:Nn > {1.4} } + { \str_if_eq_p:ee{\pdf_version_major:}{-1} } { \keys_define:nn { hyp / setup } { @@ -1029,6 +1160,18 @@ ,_ocgcolorlinks .default:n = true } } + { + \keys_define:nn { hyp / setup } + { + ,_ocgcolorlinks .code:n = + { + \msg_warning:nnxx + { hyp } + { ignore-deprecated-or-unknown-option-in-pdf-version } + { ocgcolorlinks } { \pdf_version_major:.\pdf_version_minor: } + } + } + } \keys_define:nn { hyp / setup } { @@ -1049,7 +1192,15 @@ \seq_map_inline:Nn \c__hyp_annot_types_seq { - \pdf_version_compare:NnTF < {1.5} + \bool_lazy_or:nnTF + { \pdf_version_compare_p:Nn > {1.4} } + { \str_if_eq_p:ee{\pdf_version_major:}{-1} } + { + \keys_define:nn { hyp / setup } + { + ,ocgcolor#1 .bool_set:c = { l_hyp_annot_ocgcolor#1_bool } + } + } { \keys_define:nn { hyp / setup } { @@ -1063,12 +1214,6 @@ } } } - { - \keys_define:nn { hyp / setup } - { - ,ocgcolor#1 .bool_set:c = { l_hyp_annot_ocgcolor#1_bool } - } - } } \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop { diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty index ee89218a7d2..b38a47f09c1 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty @@ -19,8 +19,7 @@ % % for those people who are interested. \NeedsTeXFormat{LaTeX2e}[2020/10/01] -\ProvidesExplPackage{hyperxmp-patches-tmp-ltx} - {2021-03-07} {0.95b} +\ProvidesExplPackage{hyperxmp-patches-tmp-ltx}{2021-03-17}{0.95c} {Store hyperref metadata in XMP format / temporay patches to test pdfresource management ... UF} \cs_if_exist:NT \pdfmanagement_add:nnn diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def index 96dbc8e7360..da3b99f7cb4 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-dvipdfmx.def}{2021-03-07}{} + {l3backend-testphase-dvipdfmx.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx} \RequirePackage{l3ref-tmp} \cs_generate_variant:Nn \ref_label:nn {en} @@ -44,6 +44,10 @@ \int_new:N \g__pdf_backend_resourceid_int \int_new:N \g__pdf_backend_name_int \int_new:N \g__pdf_backend_page_int +\cs_new:Npn \__kernel_pdf_name_from_unicode_e:n #1 + { + / \str_convert_pdfname:e { \text_expand:n { #1 } } + } \tl_gput_right:Nn \@kernel@after@shipout@lastpage { \g__kernel_pdfmanagement_end_run_code_tl diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def index 5e25e98b46e..a8baaf26b4d 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-dvips.def}{2021-03-07}{} + {l3backend-testphase-dvips.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvips} \RequirePackage{l3ref-tmp} \cs_generate_variant:Nn \ref_label:nn {en} @@ -43,6 +43,10 @@ \int_new:N \g__pdf_backend_resourceid_int \int_new:N \g__pdf_backend_name_int \int_new:N \g__pdf_backend_page_int +\cs_new:Npn \__kernel_pdf_name_from_unicode_e:n #1 + { + ~ ( \text_expand:n { #1 } ) ~ cvn + } \tl_gput_right:Nn\@kernel@after@shipout@lastpage { \g__kernel_pdfmanagement_end_run_code_tl diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def index 3a5cabd7792..ba0b8b91d95 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-dvisvgm.def}{2021-03-07}{} + {l3backend-testphase-dvisvgm.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm} \RequirePackage{l3ref-tmp} \cs_generate_variant:Nn \ref_label:nn {en} @@ -43,6 +43,10 @@ \int_new:N \g__pdf_backend_resourceid_int \int_new:N \g__pdf_backend_name_int \int_new:N \g__pdf_backend_page_int +\cs_new:Npn \__kernel_pdf_name_from_unicode_e:n #1 + { + / \str_convert_pdfname:e { \text_expand:n { #1 } } + } \tl_if_exist:NTF \@kernel@after@shipout@background { \g@addto@macro \@kernel@before@shipout@background{\relax} diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def index 585890eea24..866c334bbf4 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-luatex.def}{2021-03-07}{} + {l3backend-testphase-luatex.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)} \RequirePackage{l3ref-tmp} \cs_generate_variant:Nn \ref_label:nn {en} @@ -44,6 +44,10 @@ \int_new:N \g__pdf_backend_name_int \int_new:N \g__pdf_backend_page_int \directlua { require("l3backend-testphase.lua") } +\cs_new:Npn \__kernel_pdf_name_from_unicode_e:n #1 + { + / \str_convert_pdfname:e { \text_expand:n { #1 } } + } \tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage { \g__kernel_pdfmanagement_end_run_code_tl diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def index 7dfb98a71b5..518c05f7376 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-pdftex.def}{2021-03-07}{} + {l3backend-testphase-pdftex.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)} \RequirePackage{l3ref-tmp} \cs_generate_variant:Nn \ref_label:nn {en} @@ -43,6 +43,10 @@ \int_new:N \g__pdf_backend_resourceid_int \int_new:N \g__pdf_backend_name_int \int_new:N \g__pdf_backend_page_int +\cs_new:Npn \__kernel_pdf_name_from_unicode_e:n #1 + { + / \str_convert_pdfname:e { \text_expand:n { #1 } } + } \tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage { \g__kernel_pdfmanagement_end_run_code_tl diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def index 76ff8572398..7d9d4e523ab 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-xetex.def}{2021-03-07}{} + {l3backend-testphase-xetex.def}{2021-03-17}{} {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX} \RequirePackage{l3ref-tmp} \cs_generate_variant:Nn \ref_label:nn {en} @@ -44,6 +44,10 @@ \int_new:N \g__pdf_backend_resourceid_int \int_new:N \g__pdf_backend_name_int \int_new:N \g__pdf_backend_page_int +\cs_new:Npn \__kernel_pdf_name_from_unicode_e:n #1 + { + / \str_convert_pdfname:e { \text_expand:n { #1 } } + } \tl_gput_right:Nn \@kernel@after@shipout@lastpage { \g__kernel_pdfmanagement_end_run_code_tl diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty index ed28f7b00e6..b4d93ec6de4 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty @@ -20,7 +20,8 @@ %% %% File: l3pdfpdffield-checkbox.dtx \NeedsTeXFormat{LaTeX2e} -\ProvidesExplPackage{l3pdffield-checkbox}{0000-00-00}{v0.00a}{form field checkbox}% +\ProvidesExplPackage{l3pdffield-testphase}{2021-03-17}{0.95c}% + {form field checkboxes} \csname HyField@NeedAppearancesfalse\endcsname % suppress NeedAppearances \str_new:N \l__pdffield_field_name_str \str_new:N \l__pdffield_tmpa_str @@ -48,26 +49,26 @@ \bitset_new:Nn \l__pdffield_Ff_bitset { - ReadOnly = 0, - Required = 1, - NoExport = 2, - Multiline = 12,%Tx - Password = 13, - NoToggleToOff = 14,%Btn, radio button - Radio = 15,%Btn: Radio: 15=1, 16=0 - Pushbutton = 16,%Btn: Checkbox: 15=0, 16=0 + ReadOnly = 1, + Required = 2, + NoExport = 3, + Multiline = 13,%Tx + Password = 14, + NoToggleToOff = 15,%Btn, radio button + Radio = 16,%Btn: Radio: 15=1, 16=0 + Pushbutton = 17,%Btn: Checkbox: 15=0, 16=0 %Btn: Pushbutton: 16=1 - Combo = 17,%Ch: Combo=1 List=0 - Edit = 18,%Ch, Combo=1 -> + edit field - Sort = 19,%Ch, not relevant for view... - FileSelect = 20,%Tx - MultiSelect = 21,%Ch - DoNotSpellCheck = 22,%Tx, Ch (if Combo + Edit set) - DoNotScroll = 23,%Tx - Comb = 24,%Tx, requires MaxLen in dict - RadiosInUnison = 25,%Btn Radio - RichText = 25,%Tx - CommitOnSelChange = 26 + Combo = 18,%Ch: Combo=1 List=0 + Edit = 19,%Ch, Combo=1 -> + edit field + Sort = 20,%Ch, not relevant for view... + FileSelect = 21,%Tx + MultiSelect = 22,%Ch + DoNotSpellCheck = 23,%Tx, Ch (if Combo + Edit set) + DoNotScroll = 24,%Tx + Comb = 25,%Tx, requires MaxLen in dict + RadiosInUnison = 26,%Btn Radio + RichText = 26,%Tx + CommitOnSelChange = 27 } \bitset_new:Nn \l__pdffield_F_bitset @@ -443,7 +444,7 @@ \cs_new_protected:Npn \pdffield_setup:nn #1 #2 { - \keys_set:n {pdffield / #1 } {#2} + \keys_set:nn {pdffield / #1 } {#2} } \endinput% diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty index ef27c06cf1e..d43c363fe5b 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty @@ -1,8 +1,6 @@ %% %% This is file `pdflscape-ltx.sty', %% -%% Version: 2021/02/22 v0.95b -%% %% Copyright (C) 2021 The LaTeX Project %% %% This work may be distributed and/or modified under the @@ -24,7 +22,7 @@ %% This work consists of the main source file pdflscape-ltx.sty %% \NeedsTeXFormat{LaTeX2e} -\ProvidesExplPackage {pdflscape-ltx}{2021/02/22}{v0.95b} +\ProvidesExplPackage{pdflscape-ltx}{2021-03-17}{0.95c} {Display of landscape pages in PDF - adaption of pdflscape to the PDFmanagement bundle (testphase)} \RequirePackage{lscape} diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty index 382d32ad61e..0bd7d33a23b 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: pdfmanagement-firstaid.dtx -\ProvidesExplPackage {pdfmanagement-firstaid} {2021-03-07} {0.95b} +\ProvidesExplPackage{pdfmanagement-firstaid}{2021-03-17}{0.95c} {LaTeX PDF management testphase bundle / firstaid-patches} \clist_map_inline:nn {pgf,transparent,hyperxmp,pdflscape,xcolor,color,beamer} @@ -91,7 +91,7 @@ % the commands to add page resources \def\pgf@sys@addpdfresource@extgs@plain##1 { - \exp_after:wN %for transparent which passes a command + %\exp_after:wN %for transparent which passes a command \__pdfmanagement_patch_pgfextgs:w ##1\q_stop } \def\pgf@sys@addpdfresource@patterns@plain##1 @@ -110,11 +110,13 @@ \tl_set:Nn #2 {#4} } +\cs_generate_variant:Nn \tl_trim_spaces:n{V} +\cs_generate_variant:Nn \__pdf_backend_PageResources_gput:nnn {nex} \cs_new:Npn \__pdfmanagement_patch_pgfextgs:w #1/#2<<#3>>#4\q_stop { - \exp_args:Nne - \__pdf_backend_PageResources_gput:nnn - {ExtGState}{\tl_trim_spaces:n{#2}}{<<#3>>} + \tl_set:Nx\l_tmpa_tl{#2} + \__pdf_backend_PageResources_gput:nex + {ExtGState}{\tl_trim_spaces:V\l_tmpa_tl}{<<#3 #4>>} } \cs_new:Npn \__pdfmanagement_patch_pgfpatterns:w #1/#2\space#3\q_stop { diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx index eb1dbf97ad1..32de8d45bc7 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx @@ -27,8 +27,7 @@ %% and all files in that bundle must be distributed together. %% %% File: pdfmanagement-testphase.dtx -\ProvidesExplFile - {pdfmanagement-testphase.ltx}{2021-03-07}{0.95b} +\ProvidesExplFile{pdfmanagement-testphase.ltx}{2021-03-17}{0.95c} {PDF~management~code~(testphase)} %% File: l3pdfdict.dtx \cs_new:Npn \__pdfdict_get_type:n #1 @@ -1548,7 +1547,7 @@ \cs_new:Npn \pdf_name_from_unicode_e:n #1 { - / \str_convert_pdfname:e { \text_expand:n { #1 } } + \__kernel_pdf_name_from_unicode_e:n { #1 } } \cs_generate_variant:Nn \pdf_name_from_unicode_e:n {V} diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty index 93bc00d080d..21614ec555a 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: pdfmanagement-testphase.dtx -\ProvidesExplPackage {pdfmanagement-testphase} {2021-03-07} {0.95b} +\ProvidesExplPackage{pdfmanagement-testphase}{2021-03-17}{0.95c} {LaTeX PDF management testphase bundle} \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \IfFormatAtLeastTF{2020-10-01}{}{ diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty index 7fd747325db..8d5abb7e2a3 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty @@ -3,8 +3,8 @@ %% a replacement for transparent sty from Heiko Oberdiek %% \NeedsTeXFormat{LaTeX2e}[2020/10/01] -\ProvidesExplPackage{transparent-ltx}% - {2021-03-07}{v0.95b}{Transparency with color stacks (replacement for transparent.sty from Heiko Oberdiek)}% +\ProvidesExplPackage{transparent-ltx}{2021-03-17}{0.95c} + {Transparency with color stacks (replacement for transparent.sty from Heiko Oberdiek)}% \RequirePackage{l3opacity} diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty index 5363a830773..aec0fbb6321 100644 --- a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty +++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty @@ -1,6 +1,6 @@ %% LaTeX2e file `xcolor-patches.sty' %% -\ProvidesPackage{xcolor-patches-tmp-ltx}[2021/02/22 v0.95b patch xcolor for l3color] +\ProvidesPackage{xcolor-patches-tmp-ltx}[2021-03-17 v0.95c patch xcolor for l3color] \@ifundefined{color_set:nn}{\RequirePackage{l3color}}{} \ExplSyntaxOn -- cgit v1.2.3