From d9784b9287b55be1161c5d383c2a7ebde45671ee Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 8 Mar 2021 03:00:59 +0000 Subject: CTAN sync 202103080300 --- .../contrib/pdfmanagement-testphase/CHANGELOG.md | 31 + .../contrib/pdfmanagement-testphase/README.md | 2 +- .../contrib/pdfmanagement-testphase/color-ltx.sty | 2 +- .../pdfmanagement-testphase/hyperref-generic.dtx | 38 +- .../pdfmanagement-testphase/hyperref-generic.pdf | Bin 843358 -> 873009 bytes .../hyperxmp-patches-tmp-ltx.sty | 2 +- .../l3backend-testphase.dtx | 14 +- .../l3backend-testphase.pdf | Bin 545241 -> 565792 bytes .../contrib/pdfmanagement-testphase/l3pdfannot.dtx | 159 +++- .../contrib/pdfmanagement-testphase/l3pdfannot.pdf | Bin 532029 -> 565696 bytes .../contrib/pdfmanagement-testphase/l3pdfdict.dtx | 4 +- .../contrib/pdfmanagement-testphase/l3pdfdict.pdf | Bin 496017 -> 523596 bytes .../contrib/pdfmanagement-testphase/l3pdffield.dtx | 961 +++++++++++++++++++++ .../contrib/pdfmanagement-testphase/l3pdffield.pdf | Bin 0 -> 556128 bytes .../contrib/pdfmanagement-testphase/l3pdffile.dtx | 64 +- .../contrib/pdfmanagement-testphase/l3pdffile.pdf | Bin 519787 -> 547500 bytes .../pdfmanagement-testphase/l3pdfmanagement.dtx | 4 +- .../pdfmanagement-testphase/l3pdfmanagement.pdf | Bin 619976 -> 649554 bytes .../contrib/pdfmanagement-testphase/l3pdfmeta.dtx | 4 +- .../contrib/pdfmanagement-testphase/l3pdfmeta.pdf | Bin 625958 -> 656456 bytes .../contrib/pdfmanagement-testphase/l3pdftools.dtx | 6 +- .../contrib/pdfmanagement-testphase/l3pdftools.pdf | Bin 487709 -> 514001 bytes .../contrib/pdfmanagement-testphase/l3pdfxform.dtx | 4 +- .../contrib/pdfmanagement-testphase/l3pdfxform.pdf | Bin 410316 -> 435022 bytes .../contrib/pdfmanagement-testphase/ltdocinit.dtx | 10 +- .../contrib/pdfmanagement-testphase/ltdocinit.pdf | Bin 521875 -> 550289 bytes .../pdfmanagement-testphase/pdflscape-ltx.sty | 4 +- .../pdfmanagement-firstaid.dtx | 15 +- .../pdfmanagement-firstaid.pdf | Bin 395182 -> 419964 bytes .../pdfmanagement-testphase.dtx | 10 +- .../pdfmanagement-testphase.ins | 8 + .../pdfmanagement-testphase.pdf | Bin 419957 -> 444916 bytes .../pdfmanagement-testphase/transparent-ltx.sty | 2 +- .../xcolor-patches-tmp-ltx.sty | 2 +- 34 files changed, 1216 insertions(+), 130 deletions(-) create mode 100644 macros/latex/contrib/pdfmanagement-testphase/CHANGELOG.md create mode 100644 macros/latex/contrib/pdfmanagement-testphase/l3pdffield.dtx create mode 100644 macros/latex/contrib/pdfmanagement-testphase/l3pdffield.pdf (limited to 'macros/latex/contrib/pdfmanagement-testphase') diff --git a/macros/latex/contrib/pdfmanagement-testphase/CHANGELOG.md b/macros/latex/contrib/pdfmanagement-testphase/CHANGELOG.md new file mode 100644 index 0000000000..4d417af72d --- /dev/null +++ b/macros/latex/contrib/pdfmanagement-testphase/CHANGELOG.md @@ -0,0 +1,31 @@ +# Changelog +All notable changes to the `pdfmanagement-testphase` bundle since the +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-07] + +### Added +- \pdfannot_widget_box:nnnn +- \pdfannot_dict_use:n +- module l3pdffield for form fields. Currently it only supports checkboxes. + +### Changed +- + +### Removed +- \pdfannot_box:nnnnn: Concept to mix manual specs and dictionaries is wrong. + This can lead to duplicate entries in the dictionaries. + +### Fixed +- Wrong default setting of \g_@@_active_bool (issue #13) +- l3pdffile: Wrong casing: FileSpec -> Filespec +- beamer linkbordercolor error (workaround in firstaid) + +## [2021-02-23] + +First release diff --git a/macros/latex/contrib/pdfmanagement-testphase/README.md b/macros/latex/contrib/pdfmanagement-testphase/README.md index a3743c6504..e8ccd6bde2 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/README.md +++ b/macros/latex/contrib/pdfmanagement-testphase/README.md @@ -1,6 +1,6 @@ # LaTeX PDF management testphase bundle -Version: 0.95a, 2021-02-22 +Version: 0.95b, 2021-03-07 This package is used during a test phase to load the new PDF management code of LaTeX. diff --git a/macros/latex/contrib/pdfmanagement-testphase/color-ltx.sty b/macros/latex/contrib/pdfmanagement-testphase/color-ltx.sty index 60a55ad9c3..0fbe8eb671 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/color-ltx.sty +++ b/macros/latex/contrib/pdfmanagement-testphase/color-ltx.sty @@ -23,7 +23,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{color-ltx} - [2021/02/22 v1.2d Standard LaTeX Color (patched for l3color) (DPC)] + [2021/03/07 v1.2e Standard LaTeX Color (patched for l3color, part of pdfmanagement-testphase 2021-03-07 v0.95b) (DPC)] \edef\Gin@codes{% \catcode`\noexpand\^^A\the\catcode`\^^A\relax \catcode`\noexpand\"\the\catcode`\"\relax diff --git a/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx b/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx index c279519c3b..ee7c99874a 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.dtx @@ -86,7 +86,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-22} +% \date{Version 0.95b, released 2021-03-07} % % \maketitle % \begin{documentation} @@ -813,7 +813,7 @@ % \end{macrocode} % \begin{macrocode} \ProvidesFile{hgeneric-testphase.def} - [2021/02/22 v0.95a % + [2021/02/22 v0.95b % generic Hyperref driver for the LaTeX PDF management testphase bundle] \RequirePackage{etoolbox} %why? @@ -1822,12 +1822,13 @@ \cs_set_eq:NN \% \c_percent_str \Hy@safe@activestrue \mode_leave_vertical: + \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} - >> + % /A +% << +% \pdfdict_use:n {l_hyp/annot/A/URI} +% >> } { #1 @@ -1877,12 +1878,13 @@ \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}>>} \pdfannot_link:nxn %expansion?? { GoToR } { - /A<< - \pdfdict_use:n {l_hyp/annot/A/GoToR} - >> + % /A<< +% \pdfdict_use:n {l_hyp/annot/A/GoToR} +% >> } { #1\Hy@xspace@end @@ -1935,13 +1937,14 @@ \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 { Launch } { - /A - << - \pdfdict_use:n {l_hyp/annot/A/Launch} - >> + % /A +% << +% \pdfdict_use:n {l_hyp/annot/A/Launch} +% >> } { #2\Hy@xspace@end @@ -1986,12 +1989,13 @@ \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 } { - /A - << - \pdfdict_use:n { l_hyp/annot/A/Named } - >> +% /A +% << +% \pdfdict_use:n { l_hyp/annot/A/Named } +% >> } { #2 diff --git a/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.pdf b/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.pdf index 910f9e61fd..49fbd11925 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.pdf and b/macros/latex/contrib/pdfmanagement-testphase/hyperref-generic.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty b/macros/latex/contrib/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty index e0cb3a4e1b..ee89218a7d 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty +++ b/macros/latex/contrib/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty @@ -20,7 +20,7 @@ % for those people who are interested. \NeedsTeXFormat{LaTeX2e}[2020/10/01] \ProvidesExplPackage{hyperxmp-patches-tmp-ltx} - {2021-02-22} {0.95a} + {2021-03-07} {0.95b} {Store hyperref metadata in XMP format / temporay patches to test pdfresource management ... UF} \cs_if_exist:NT \pdfmanagement_add:nnn diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx index ffa7fd0b63..796ba7f701 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.dtx @@ -45,7 +45,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-22} +% \date{Version 0.95b, released 2021-03-07} % % \maketitle % @@ -56,27 +56,27 @@ % \begin{macrocode} %\ProvidesExplFile %<*dvipdfmx> - {l3backend-testphase-dvipdfmx.def}{2021-02-22}{} + {l3backend-testphase-dvipdfmx.def}{2021-03-07}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx} % %<*dvips> - {l3backend-testphase-dvips.def}{2021-02-22}{} + {l3backend-testphase-dvips.def}{2021-03-07}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvips} % %<*dvisvgm> - {l3backend-testphase-dvisvgm.def}{2021-02-22}{} + {l3backend-testphase-dvisvgm.def}{2021-03-07}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm} % %<*luatex> - {l3backend-testphase-luatex.def}{2021-02-22}{} + {l3backend-testphase-luatex.def}{2021-03-07}{} {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)} % %<*pdftex> - {l3backend-testphase-pdftex.def}{2021-02-22}{} + {l3backend-testphase-pdftex.def}{2021-03-07}{} {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)} % %<*xdvipdfmx> - {l3backend-testphase-xetex.def}{2021-02-22}{} + {l3backend-testphase-xetex.def}{2021-03-07}{} {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX} % % \end{macrocode} diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.pdf b/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.pdf index 0d2d78f683..b89ccd6af0 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.pdf and b/macros/latex/contrib/pdfmanagement-testphase/l3backend-testphase.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx index 94b7a89af8..71ee24f53d 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.dtx @@ -52,7 +52,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-21} +% \date{Version 0.95b, released 2021-02-21} % % \maketitle % \begin{documentation} @@ -70,26 +70,15 @@ % \subsection{General annotation commands} % % \begin{function}[added = 2019-09-05, updated = 2020-04-14] -% { \pdfannot_box:nnnn } +% { \pdfannot_box:nnnn,\pdfannot_box:nnnx } % \begin{syntax} % \cs{pdfannot_box:nnnn} \Arg{width} \Arg{height} \Arg{depth} \Arg{annot spec} % \end{syntax} % This creates an \texttt{/Type/Annot} object with the given dimensions. -% It doesn't use hooks or dictionaries. -% \end{function} -% \begin{function}[added = 2020-03-30] -% { \pdfannot_box:nnnnn } -% \begin{syntax} -% \cs{pdfannot_box:nnnnn} \Arg{type} \Arg{width} \Arg{height} \Arg{depth} \Arg{annot spec} -% \end{syntax} -% This creates an \texttt{/Type/Annot} object with the given dimensions. -% \meta{type} should be currently one of |link/URI|, |link/GoToR|, -% |link/Launch|, |link/GoTo| or |link/Named| or -% |widget|, it will then insert the attribute dictionary of this type -% additionally to the manually given \meta{annot spec}. -% The attribute dictionaries can be filled with commands described below. -% Hooks are not used. +% It doesn't use hooks or dictionaries. The annotation doesn't occupy space but +% as it is a whatsit it can affect spacing. % \end{function} +% % \begin{function}[added = 2019-09-05] % { \pdfannot_box_ref_last: } % \begin{syntax} @@ -97,6 +86,32 @@ % \end{syntax} % This retrieves the object reference of the last box annotation created. % \end{function} +% \subsection{Dictionary for the annotation spec} +% +% \meta{annot spec} in the above command can be given in two ways. One way is +% to enter the needed dictionary keys and values directly: +% \begin{verbatim} +% \pdfannot_box:nnnn{1cm}{1cm}{0cm}{/Subtype/Link /Border[0~0~1]} +% \end{verbatim} +% +% A second method is to make use of the dictionary commands provided by \pkg{l3pdfdict}: +% +% \begin{verbatim} +% \pdfdict_new:n {l_my_annot} +% \pdfdict_put:nnn{l_my_annot}{Subtype}{/Link} +% \pdfdict_put:nnn{l_my_annot}{Border}{[0~0~1]} +% \pdfannot_box:nnnx{1cm}{1cm}{0cm}{\pdfdict_use:n{l_my_annot}} +% \end{verbatim} +% +% The second method is clearly slower and more to type. But it has the advantage +% that using such a dictionary makes it easy to add, remove and change entries. +% It also avoids the potential problem that a key is added twice with different +% values. This allows to create user interfaces to change settings and +% also makes it easy to extend the interfaces in case some new setting +% should be included. For these reasons both the PDF management itself, +% but also the specific annotation commands in the following sections +% all make use of such dictionaries. +% % \subsection{Link annotations} % Link annotations are special cases of annotations. In the PDF they are identified % by an |/Subtype/Link| entry in the dictionary. @@ -152,16 +167,22 @@ % \begin{syntax} % \cs{pdfannot_link:nnn} \Arg{type} \Arg{user action spec} \Arg{link text} % \end{syntax} -% This creates a link around the \meta{link text} with the specified +% This creates a link around the \meta{link text}. +% \texttt{/Subtype/Link} is added automatically through the dictionary. % \meta{user action spec}\footnote{The wording follows the pdftex documentation}. -% \texttt{/Subtype/Link} is added automatically. +% is provided as a fast method to add dictionary contents, +% but it should be noted that no provision is taken to avoid clashes with +% values added through the dictionary. If needed clashing entries should be +% removed from the dictionary first. Normally the argument is not needed, all +% entries can be added through the dictionary too. % \meta{type} should be one of \texttt{URI}, \texttt{GoToR}, % \texttt{Launch}, \texttt{GoTo} or \texttt{Named}. The |GoTo| variant does % \emph{not} complain if the destination name is not known like % \cs{pdfannot_link_goto_begin:nw}. % The attributes stored in the local dictionary % \texttt{link/}\meta{type} are inserted as -% \emph{attr spec} and the code in the begin and end hook +% \emph{attr spec} before \meta{user action spec}. +% The code in the begin and end hook % \texttt{pdfannot/link/\meta{type}/before} % and \texttt{pdfannot/link/\meta{type}/after} % is executed before and after the link (outside the link command) @@ -193,10 +214,14 @@ % \cs{pdfannot_link_begin:nnw} \Arg{type} \Arg{user action spec} \meta{content} % \cs{pdfannot_link_end:n} \Arg{type} % \end{syntax} -% This creates a link around the \meta{content} with the specified -% \meta{user action spec} (e.g. an /A dictionary with an URI) or -% \meta{destination} (a name as defined with the -% first argument of \cs{pdf_destination:nn}). +% This creates a link like the previous command. +% \texttt{/Subtype/Link} is added automatically through the dictionary. +% \meta{user action spec}\footnote{The wording follows the pdftex documentation}. +% is provided as a fast method to add dictionary contents, +% but it should be noted that no provision is taken to avoid clashes with +% values added through the dictionary. If needed clashing entries should be +% removed from the dictionary first. Normally the argument is not needed, all +% entries can be added through the dictionary too. % \texttt{/Subtype/Link} is added automatically. % In contrast to \cs{pdfannot_link:nnn} this function % does not absorb the argument when finding the \meta{content}, and so can @@ -278,6 +303,17 @@ % \texttt{link/GoTo}, \texttt{link/Named}. % \end{function} % +% \begin{function}[EXP,added = 2021-03-03] +% { \pdfannot_dict_use:n } +% \begin{syntax} +% \cs{pdfannot_dict_use:n} \Arg{dictionary name} +% \end{syntax} +% This outputs the property list of the dictionary as a list of +% |/key value| pairs. +% This can be used e.g. when writing a dictionary object with +% \cs{pdf_object_write:nx} +% \end{function} +% % \begin{variable}[added = 2020-12-28]{\l_pdfannot_F_bitset} % This is a bitset variable, with the named index names suitable for the % /F flag in an annotation. @@ -291,6 +327,27 @@ % |Print|, |NoZoom|, |NoRotate|, |NoView|, |ReadOnly|, |Locked|, |ToggleNoView|, % |LockedContents| which correspond to the names used in the PDF references. % \end{variable} +% \subsection{Widget annotations} +% Widget annotations are quite important for form fields, as they are used +% to build the actually instance of such fields. +% +% As they can contain meaningful content hooks are probably needed to allow tagging +% and other manipulations, so like with link special commands are provided. +% Widget are normally in a box and line and page breaks are not relevant, so +% the command is offered as box command. +% +% \begin{function}[added = 2021-03-02] +% { \pdfannot_widget_box:nnn } +% \begin{syntax} +% \cs{pdfannot_widget_box:nnn} \Arg{width} \Arg{height} \Arg{depth} +% \end{syntax} +% This creates an \texttt{/Type/Annot} object with the given dimensions. +% The annotation doesn't occupy space. +% It will insert the attribute dictionary of the widget type (which +% is prefilled with \texttt{/Subtype/Widget}). +% The hooks \texttt{pdfannot/widget/before} and \texttt{pdfannot/widget/after} +% are executed before and after the widget. +% \end{function} % \end{documentation} % % \begin{implementation} @@ -300,7 +357,7 @@ % \begin{macrocode} %<@@=pdfannot> %<*header> -\ProvidesExplPackage {l3pdfannot} {2021-02-22} {0.95a} +\ProvidesExplPackage {l3pdfannot} {2021-03-07} {0.95b} {PDF-annotations} \RequirePackage{l3pdfdict} % @@ -349,41 +406,45 @@ % type or not type? Syntax for type? % should there be a version without type? % \end{NOTE} - +% \begin{macro}{\pdfannot_box:nnnn,\pdfannot_box:nnnx,\pdfannot_box_ref_last:} % \begin{macrocode} \cs_new_protected:Npn \pdfannot_box:nnnn #1 #2 #3 #4 { \__pdf_backend_annotation:nnnn {#1}{#2}{#3}{#4} \bool_gset_false:N\g_@@_use_lastlink_bool } - +\cs_generate_variant:Nn \pdfannot_box:nnnn {nnnx} \cs_new:Npn \pdfannot_box_ref_last: { \__pdf_backend_annotation_last: } -\cs_new_protected:Npn \pdfannot_box:nnnnn #1 #2 #3 #4 #5 - { - \exp_args:Nx - \__pdf_backend_annotation:nnnn {#2}{#3}{#4} - { - \pdfdict_if_exist:nT { l_@@/#1 } - { - \pdfdict_use:n { l_@@/#1} - } - #5 - } - \bool_gset_false:N\g_@@_use_lastlink_bool - } % \end{macrocode} +% \end{macro} % \subsection{Annotations, subtype Widget}\label{pdf:annot:widget} -% Currently no code is provided here. -% The local dictionary \texttt{l_@@/Widget} is a skeleton -% dictionary for this subtype. It currently contains as only entry +% Widgets are typically boxes, so we provide a box command. +% A local dictionary \texttt{l_@@/Widget} is used. +% It contains like the other dictionaries % the subtype setting (the /Type is added by the backend). % \begin{macrocode} - \pdfdict_new:n { l_@@/widget } + \pdfdict_new:n { l_@@/widget } \pdfdict_put:nnn { l_@@/widget }{ Subtype }{ /Widget } + \hook_new_pair:nn + {pdfannot/widget/before} + {pdfannot/widget/after} + \hook_new_pair:nn + {pdfannot/widget/begin} + {pdfannot/widget/end} +\cs_new_protected:Npn \pdfannot_widget_box:nnn #1 #2 #3 + { + \hook_use:n { pdfannot/widget/before } + \pdfannot_box:nnnx {#1}{#2}{#3} + { + \pdfdict_use:n { l_@@/widget} + } + \hook_use:n { pdfannot/widget/after } + \bool_gset_false:N\g_@@_use_lastlink_bool + } % \end{macrocode} % % \subsection{Annotations, subtype Link}\label{sec:links} @@ -427,6 +488,7 @@ \seq_map_inline:Nn \c_pdfannot_link_types_seq { \pdfdict_new:n { l_@@/link/#1 } + \pdfdict_put:nnn { l_@@/link/#1 }{ Subtype }{ /Link } \hook_new_pair:nn {pdfannot/link/#1/before} {pdfannot/link/#1/after} @@ -454,7 +516,6 @@ } } { - /Subtype/Link #2 %exp_not? } \bool_gset_true:N \g_@@_use_lastlink_bool @@ -504,7 +565,8 @@ % \begin{macrocode} \cs_new_protected:Npn \pdfannot_link_goto_begin:nw #1 %#1 destination { - \hook_use:n { pdfannot/link/GoTo/before} + \pdfdict_remove:nn { l_@@/link/GoTo} {Subtype} + \hook_use:n { pdfannot/link/GoTo/before} %the backend add it too \mode_leave_vertical: \exp_args:Nxx %xetex needs expansion \__pdf_backend_link_begin_goto:nnw @@ -513,6 +575,7 @@ } { #1 } \bool_gset_true:N \g_@@_use_lastlink_bool + \pdfdict_put:nnn { l_@@/link/GoTo} {Subtype}{GoTo} \hook_use:n { pdfannot/link/GoTo/begin} } @@ -556,6 +619,7 @@ % \pdfannot_dict_put:nnx, % \pdfannot_dict_remove:nn, % \pdfannot_dict_show:n +% \pdfannot_dict_use:n % } % \begin{macrocode} \cs_new_protected:Npn \pdfannot_dict_put:nnn #1 #2 #3 @@ -575,6 +639,11 @@ { \pdfdict_show:n { l_@@/#1 } } + +\cs_new:Npn \pdfannot_dict_use:n #1 + { + \pdfdict_use:n { l_@@/#1 } + } % % \end{macrocode} % \end{macro} diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.pdf b/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.pdf index 67a37e0921..6299ff3a30 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.pdf and b/macros/latex/contrib/pdfmanagement-testphase/l3pdfannot.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfdict.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3pdfdict.dtx index 558b721ca5..2362863e3a 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/l3pdfdict.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/l3pdfdict.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-22} +% \date{Version 0.95b, released 2021-03-07} % % \maketitle % \begin{documentation} @@ -212,7 +212,7 @@ % \begin{macrocode} %<@@=pdfdict> %<*header> -\ProvidesExplPackage {l3pdfdict} {2021-02-22} {0.95a} +\ProvidesExplPackage {l3pdfdict} {2021-03-07} {0.95b} {Tools for PDF dictionaries (LaTeX PDF management testphase bundle)} % % \end{macrocode} diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfdict.pdf b/macros/latex/contrib/pdfmanagement-testphase/l3pdfdict.pdf index f52defd085..4d2d2c1841 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/l3pdfdict.pdf and b/macros/latex/contrib/pdfmanagement-testphase/l3pdfdict.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdffield.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3pdffield.dtx new file mode 100644 index 0000000000..3d7e6123e1 --- /dev/null +++ b/macros/latex/contrib/pdfmanagement-testphase/l3pdffield.dtx @@ -0,0 +1,961 @@ +% \iffalse meta-comment +% +%% File: l3pdfpdffield-checkbox.dtx +% +% Copyright (C) 2021 The LaTeX Project +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file +% +% http://www.latex-project.org/lppl.txt +% +% This file is part of the "LaTeX PDF management testphase bundle" (The Work in LPPL) +% and all files in that bundle must be distributed together. +% +% ----------------------------------------------------------------------- +% +% The development version of the bundle can be found at +% +% https://github.com/latex3/pdfresources +% +% for those people who are interested. +% +%<*driver> +\RequirePackage{pdfmanagement-testphase} +\DeclareDocumentMetadata{} +\makeatletter +\declare@file@substitution{doc.sty}{doc-v3beta.sty} +\makeatother +\documentclass[full]{l3doc} +\usepackage{array,booktabs} +\usepackage{l3pdffield-testphase,bearwear} +\hypersetup{pdfauthor=The LaTeX Project, + pdftitle=l3pdffield (LaTeX PDF management testphase bundle)} +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +% +% \fi +% \NewDocElement[ +% idxgroup=checkbox keys, +% idxtype = {checkbox key}, +% printtype= \textit{checkbox key} +% ]{Checkboxkey}{checkboxkey} +% \providecommand\hook[1]{\texttt{#1}} +% \ExplSyntaxOn +% \pdffield_store_appearance:nn {bear/Yes} +% { +% \tikz\bear\bearwear[shirt=red,body~deco={\node[font=\tiny\bfseries,white]~at~(beartummy){Yes};}]; +% } +% \pdffield_store_appearance:nn {bear/Off} +% { +% \tikz\bear\bearwear[body~deco={\node[font=\tiny\bfseries,white]~at~(beartummy){Off};}]; +% } +% \ExplSyntaxOff +% \title{^^A +% The \pkg{l3pdffield} module\\ Commands to create form fields ^^A +% \\ \LaTeX{} PDF management testphase bundle +% } +% +% \author{^^A +% The \LaTeX{} Project\thanks +% {^^A +% E-mail: +% \href{mailto:latex-team@latex-project.org} +% {latex-team@latex-project.org}^^A +% }^^A +% } +% +% \date{Version 0.95b, released 2021-03-07} +% +% \maketitle +% \begin{documentation} +% \section{\pkg{l3pdffield} Introduction} +% The implementation of form fields in hyperref has some bugs, see for example +% \url{https://github.com/latex3/hyperref/issues/94}. This package is a first step +% towards the goal to review and improve the code of form fields. +% +% Like the \pkg{pdfmanagement-testphase} package itself it is a temporary package: +% the definite home of the code is not yet decided. +% +% It handles for now \emph{only} checkboxes, other form fields like pushbutton, +% radio buttons or text fields will follow later. As currently no fonts are used, +% it doesn't relies on the hyperref code +% to initialize the form, but it can be used with hyperref. +% +% The code requires the new PDF management. The code makes use of +% \pkg{l3pdfxform} to create the Xobjects. This code doesn't support yet the +% the dvips backend. +% +% +% +% Please keep in mind +% \begin{itemize} +% \item Not every PDF viewer supports checkboxes. +% \item The handling can depend on settings in the PDF viewer. In adobe reader for +% example I had to disable an option to avoid that it tries to create an appearance +% itself +% \item Standards like pdf/A disable form fields too (as you typically can't change the PDF). +% \end{itemize} +% +% If \pkg{hyperref} is loaded before +% the package will suppress the deprecated |/NeedAppearances| setting. If \pkg{hyperref} +% is loaded later you should do it in the \cs{Form} options. +% +% So a typical use together with hyperref could look like this +% +% \begin{verbatim} +% \RequirePackage{pdfmanagement-testphase} +% \DeclareDocumentMetadata{uncompress} +% \documentclass{article} +% \usepackage{hyperref} +% \usepackage{l3pdffield-testphase} +% \begin{document} +% \Form +% \end{verbatim} +% \section{Step 1: Checkboxes} +% Click me: +% \ExplSyntaxOn\pdffield_checkbox:n{name=bear,appearance=bear,width=23pt,height=30pt,depth=10pt}\ExplSyntaxOff +% +% \bigskip +% \subsection{Commands} +% \begin{function}{\pdffield_checkbox:n} +% \begin{syntax} +% \cs{pdffield_checkbox:n}\Arg{key val list} +% \end{syntax} +% This creates a checkbox to check and uncheck. The list of allowed keys is described below. +% Typically the \meta{key val list} should at least set the name. Checkboxes with the same +% name belong to the same field and are checked and unchecked together. The default appearance +% is a quadratic frame with a \cs{texttimes} in it for the checked case. +% \end{function} +% +%\begin{function}{\pdffield_setup:nn} +% \begin{syntax} +% \cs{pdffield_setup:nn}\Arg{field type}\Arg{key val list} +% \end{syntax} +% This allows to setup up values for following fields. \Arg{field type} +% should be a field, currently the only allowed value is |checkbox|. +% \end{function} +% +%\begin{function}{\pdffield_store_appearance:nn} +% \begin{syntax} +% \cs{pdffield_store_appearance:nn}\Arg{name/state}\Arg{content} +% \end{syntax} +% This is a small wrapper around \cs{pdfxform_new:nn} and store appearances for the fields. +% \meta{state} should be for checkboxes either |Yes| or |Off| (and typically +% you should define both). \meta{name} is the name +% that is used in the |appearance| key, |checkbox/default| is predefined and so can't be used. +% \meta{content} is arbitrary content. The dimensions should fit to the planed size of the +% checkbox.% +% \end{function} +% \subsection{Keys} +% +% The new checkbox commands accepts following keys: +% +% \DescribeCheckboxkey{name} This sets the (internal) name of the field. It shouldn't contain +% a period, be not empty and sensibly consist of simple chars. Checkboxes instances +% with the same name belong to the same field and are checked and unchecked together. +% +% \DescribeCheckboxkey{altname} This sets an alternative name for user interaction. +% This name can only be set at the first checkbox instance, when the field is initialized. +% \DescribeCheckboxkey{mappingname} This sets an alternative name for export. +% This name can only be set at the first checkbox instance, when the field is initialized. +% +% \DescribeCheckboxkey{width} +% \DescribeCheckboxkey{height} +% \DescribeCheckboxkey{depth} These keys allow to set the dimensions of checkbox instance. +% The value should be a command that expands to a dimension expression. By default +% |width| and |height| use \cs{normalbaselineskip}, the |depth| is zero. +% +% \DescribeCheckboxkey{appearance} This key sets the normal appearance. It takes as value a +% \meta{name} and expects that the two appearances \meta{name}|/Yes| and \meta{name}|/Off| +% has been created with the command described below. The initial value is |checkbox/default| +% and shows a \cs{texttimes}. +% +% \DescribeCheckboxkey{rollover-appearance} This key sets the rollover appearance (when the +% mouse hovers over the checkbox). It takes as value a +% \meta{name} and expects that the two appearances \meta{name}|/Yes| and \meta{name}|/Off| +% has been created with the command described below. Initially this is not set. +% An empty value removes the entry. +% +% \DescribeCheckboxkey{down-appearance} This key sets the down appearance (when the +% mouse clicks). It takes as value a +% \meta{name} and expects that the two appearances \meta{name}|/Yes| and \meta{name}|/Off| +% has been created with the command described below. Initially this is not set. +% An empty value removes the entry. +% +% \DescribeCheckboxkey{checked} This is a boolean key which allows to set if the +% checkbox should be initially checked or not. It sets the |/V| and |/DV| key of the field +% and the |/AS| key of the annotation instance. It is possible to use different +% values for different instances, if one wants to confuse the user. +% +% \DescribeCheckboxkey{setfieldflags} +% \DescribeCheckboxkey{unsetfieldflags} +% These keys allow to set or unset the field flags. They expect a comma lists of +% flag names. Allowed names |ReadOnly|, |Required|, +% |NoExport|, |Multiline|, |Password|, |NoToggleToOff|, |Radio|, |Pushbotton|, +% |Combo|, |Edit|, |Sort|, |FileSelect|, |MultiSelect|, |DoNotSpellCheck|, +% |DoNotScroll|, |Comb|, |RadiosInUnison|, |RichText|, |CommitOnSelChange|. +% +% From these |Radio|, |Pushbotton| are set automatically automatically by the code +% as this is required for a checkbox. Not every one from the rest makes sense for +% checkboxes but the same key will be used for other fields too. +% Check the PDF reference to decide which one to set or unset. +% +% \begin{checkboxkey}{keystroke,format,validate,calculate} +% These keys add the |/K, |/F, |/V|, |/C| key to the |/AA| dictionary of the field object. +% Their value should be javascript code. The |/AA| dictionary is suppressed +% if a pdf/A standard is set. These keys are probably not of much used with a checkbox. +% \end{checkboxkey} +% +% \vspace{2\baselineskip} +% \begin{checkboxkey}{onfocus,onblur,onmousedown,onmouseup,onenter,onexit} +% These keys adds the |/F, |/Bl, |/D|, |/U|, |E| and |X| key to the |/AA| dictionary +% of the widget annotation (the checkbox instance) object. +% Their value should be javascript code. The |/AA| dictionary +% is suppressed if a pdf/A standard is set. +% +% For example +% \begin{verbatim} +% onenter={app.alert('Hello');} +% \end{verbatim} +% \end{checkboxkey} +% +% \subsection{Using with hyperref} +% The \cs{CheckBox} command from hyperref also prints a label, something that the +% command here don't do. A redefinition like the following should allow to \cs{CheckBox} +% to use the commands of this module. Be aware that the behaviour will not be identical! +% Not every setting and key from \pkg{hyperref} has been copied. +% +% \begin{verbatim} +% \ExplSyntaxOn\makeatletter +% \def\@CheckBox[#1]#2{\LayoutCheckField{#2}{\pdffield_checkbox:n {name=#2,#1}}} +% \ExplSyntaxOff\makeatother +% \end{verbatim} +% +% \subsection{Some background} +% Form fields consist of a field object and number of instances of the field: +% A checkbox can appear on more than one page or location and if one instance +% is checked all other instances follows and are checked too. +% +% All instances are in this case widget annotations and are referenced in the Kid array of the field +% object\footnote{Fields can actually build a tree: between the root field and +% widget annotations there can be more fields. The last one before the widget is +% the \emph{terminal} field, but unless a sensible +% use case comes up, I will assume that the widget annotations are direct children of +% the root and that the root field is the terminal field.}. +% This means that the code has to collect all the children and write +% out the field object at the end of the document. +% +% If a field has only one children the content of the field dictionary and the +% widget annotation dictionary can be merged---some examples in the PDF reference +% show such merged dictionaries---but the code here keeps them separate, at the end +% this is clearer. +% +% All the root field objects must be referenced in the AcroForm dictionary in the +% Fields entry. This can be done with +% +% \begin{verbatim} +% \pdfmanagement_add:nnx{Catalog/AcroForm}{Fields}{} +% \end{verbatim} +% +% A checkbox has two different looks: checked and unchecked. The current hyperref +% implementation uses symbolic names for the two states and and adds some +% values with the /MK key and lets the PDF viewer +% create a look from them. But this doesn't work reliably. Also newer PDF versions +% deprecate the /NeedAppearances setting and require that such a look, +% an \enquote{appearance}, is given as form XObjects: +% such form XObjects are like small pictures stored in the PDF and can be referenced +% in various part of the PDF. They can be created with the commands of +% the \pkg{l3pdfxform} package. +% +% The checkbox instances---the widget annotations---cover a rectangular area on +% the page, the XObjects are squeezed into this rectangle. So for the best result +% both should have the same ratio of width and height. +% XObjects used as appearances can not be rotated, if needed one has to +% create a new appearance. +% +% \subsubsection{The field dictionary} +% +% The field dictionary shall or can have the following entries +% +% \begin{description} +% \item[FT] required for terminal fields (here for the root field), +% the value is always \texttt{Btn}, so this entry is set by the code. +% \item[Parents] currently irrelevant as we don't have a field hierarchy. +% \item[Kids] an array. Contains references to the children, in our case to +% the widget annotations. The array is build by the code. +% +% \item[T] required, the name, a (unique) text string without a period. +% This field is a mandatory argument which must be given by the user. +% The value should be passed through a suitable string conversion and checked +% if it contains a period (which is not allowed). +% +% \item[TU,TM] optional, alternative names for user messages (TU) and export (TM). +% As these fields are optional they should be set by some key-val option. +% +% \item[Ff] A bitset, two flags must be unset for a checkbox (Radio and Pushbotton), +% for the rest we need a keyval interface. +% +% \item[V] describes the initial value, for checkboxes is should be either |/Yes| +% or |/Off|. The initial value will be |/Yes|, keys are need to set both the local +% and the default value. +% +% \item[DV] optional, the default value after a reset. Should like |V| be either +% |/Yes| or |/Off|. +% +% \item[AA] An action dictionary. For this we need a special command to setup such +% dictionaries, so that they then can be used in various places. +% +% \end{description} +% +% \subsubsection{The widget annotation dictionary} +% +% \begin{description} +% \item[Type] Value: |/Annot|, set automatically +% \item[Subtype] Value: |/Widget| this is added automatically. +% We use an internal dictionary which is locally copied over the one from l3pdfannot. +% It can be filled with keyval options. +% \item[Parent] The reference to the field, automatically added. +% \item[Rect] the size, calculated from the box size +% \item[Contents] a text string, not really needed but an optional key should allow to +% set it, +% \item[AP] the appearance dictionary. It should look like this +% |/AP <>>>|. I need to test if it makes sense here to +% have a |/R| and |/D| entry too. The objects refer to suitable xforms. +% \item[AS] should be either |/Yes| or |/Off|, and sensibly by default be +% the same as the V entry in the field dictionary. If they differ the AS entry wins. +% +% \item[A] Action, this must be checked. +% \item[AA] additional actions. This must be checked too. +% +% \item[Border, C, OC, AF, BM, Lang, P, NM, M, F, BS, H]: These are not specifically +% needed for checkbox. An interface to add something to the used annot dictionary +% is needed (or already there), but probably no special key-val support for now. +% +% \item[MK] this is what hyperref uses to set the appearance, but I +% explicitly leave it out and use |AP|. +% +% \item[Q] (alignment), used by hyperref but not relevant as we don't have variable +% text here. +% \end{description} +% \end{documentation} +% +% \begin{implementation} +% \section{\pkg{l3pdffield-checkbox} Implementation} +% \begin{macrocode} +%<*package> +%<@@=pdffield> +\NeedsTeXFormat{LaTeX2e} +\ProvidesExplPackage{l3pdffield-checkbox}{0000-00-00}{v0.00a}{form field checkbox}% +% \end{macrocode} +% \subsection{hyperref specific command} +% hyperref sets NeedAppearances by default. As this is deprecated we disable this. +% \begin{macrocode} +\csname HyField@NeedAppearancesfalse\endcsname % suppress NeedAppearances +% values from hyperref: +%\def\DefaultOptionsofCheckBox{print} +%\def\DefaultHeightofCheckBox{\normalbaselineskip} +%\def\DefaultWidthofCheckBox{\normalbaselineskip} +% \end{macrocode} +% \subsection{local variables} +% \begin{macrocode} +\str_new:N \l_@@_field_name_str +\str_new:N \l_@@_tmpa_str +\str_new:N \l_@@_name_tmpa_str +\tl_new:N \l_@@_keys_tmpa_tl +% \end{macrocode} +% +% \subsection{messages} +% \begin{macrocode} +\msg_new:nnn {pdffield}{no-period} + { + The~field~name~`#1`~contains~a~period. \\ + This~is~not~allowed. ` + } +\msg_new:nnn {pdffield}{empty-name} + { + The~field~name~is~empty. \\ + This~is~not~allowed. ` + } +\msg_new:nnn {pdffield}{appearance-missing} + { + The~appearance~`#1`~is~missing~for~the~#2~appearance. + } +\msg_new:nnn {pdffield}{field-keys-ignored} + { + The~field~`#1`~is~already~initialized\\ + The~field~keys~`#2`~are~ignored. + } +% \end{macrocode} + +% \subsection{bitsets} +% A bitset for the field flag Ff +% and an internal copy of the annot bitset. +% \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 + %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 + } + +\bitset_new:Nn \l_@@_F_bitset + { + Invisible = 1, + Hidden = 2, + Print = 3, + NoZoom = 4, + NoRotate = 5, + NoView = 6, + ReadOnly = 7, + Locked = 8, + ToggleNoView = 9, + LockedContents = 10 + } +% \end{macrocode} +% \subsection{The field dictionary} +% The field dictionary is the main object. It references the +% actual widget annotations as kids. It is created at the first +% checkbox with a specific name. +% To be able to set values from the outside it will use a +% dictionary which can be filled by key-val. +% \begin{macrocode} +\pdfdict_new:n {l_@@/checkbox/field} +\pdfdict_put:nnn {l_@@/checkbox/field}{FT}{/Btn} +% \end{macrocode} +% We need to check if the name contains a dot. But we will do this in an external command +% to avoid to have it twice. Here we assume that the name is already converted and safe. +% +% We also assume that values that can be changed by the user are set outside +% in the dictionary. +% If the field object already exists nothing is done. +% \begin{macro}{\@@_checkbox_field_add:n} +% \begin{syntax} +% \cs{@@_checkbox_field_add:n}\Arg{name} +% \end{syntax} +% \meta{name} should be a PDF text string without period. It identifies the +% field. +% \begin{macrocode} +\cs_new_protected:Npn \@@_checkbox_field_new:n #1 + { + \group_begin: + \pdf_object_new:nn {@@_checkbox/field/#1} {dict} + \pdf_object_new:nn {@@_checkbox/field/#1/Kids} {array} + \seq_new:c {g_@@_checkbox/field/#1/Kids_seq} + \hook_gput_code:nnn {shipout/lastpage}{pdffield} %xetex needs this ... + { + \pdf_object_write:nx {@@_checkbox/field/#1/Kids} + { + \seq_use:cn{g_@@_checkbox/field/#1/Kids_seq}{~} + } + } + \pdfdict_put:nnn {l_@@/checkbox/field}{T}{(#1)} + % V,DV are names describing the appearance. With checkboxes + % the values /Yes and /Off are used. + % this values are taken from the outside + \pdfdict_put:nnx {l_@@/checkbox/field} + {Kids} + { + \pdf_object_ref:n {@@_checkbox/field/#1/Kids} + } + \bitset_set_false:Nn \l_@@_Ff_bitset {Radio} + \bitset_set_false:Nn \l_@@_Ff_bitset {Pushbutton} + \pdfdict_put:nnx {l_@@/checkbox/field} + {Ff} + {\bitset_to_arabic:N \l_@@_Ff_bitset } + \pdfdict_if_empty:nF{l_@@/checkbox/field/AA} + { + \pdfmeta_standard_verify:nT + {annot_widget_no_AA} + { + \pdfdict_put:nnx + {l_@@/checkbox/field} + {AA} + {<<\pdfdict_use:n {l_@@/checkbox/field/AA}>>} + } + } + \pdf_object_write:nx {@@_checkbox/field/#1} { \pdfdict_use:n {l_@@/checkbox/field} } + \pdfmanagement_add:nnx + { Catalog / AcroForm } + { Fields } + {\pdf_object_ref:n {@@_checkbox/field/#1} } + \group_end: + } + +% \end{macrocode} +% \end{macro} +% \subsection{The annot dictionary} +% We assume that the annotation should really occupy space on the page and +% leave vertical mode. +% We also assume that keys like AP, AS are added before through keys to +% the dictionary. +% We use a local dictionary which is copied into |l__pdfannot/widget| in the code. +% \begin{macrocode} +\pdfdict_new:n {l_@@/checkbox/annot} +\pdfdict_put:nnn {l_@@/checkbox/annot}{Subtype}{/Widget} +% \end{macrocode} +% +% \begin{macro}{\@@_checkbox_annot_add:nnnn} +% \begin{macrocode} +\cs_new_protected:Npn \@@_checkbox_annot_add:nnnn #1 #2 #3 #4 %name, wd, ht, dp, + { + \group_begin: +% \end{macrocode} +% Copy the internal dictionary to the pdfannot dictionary. This +% perhaps need a function in l3pdfannot, +% as it actually uses an internal name of another module. +% \begin{macrocode} + \pdfdict_put:nnx {l_@@/checkbox/annot}{AP}{<<\pdfdict_use:n{l_@@/checkbox/annot/AP}>>} + \pdfmeta_standard_verify:nF + {annot_flags} + { + \bitset_set_true:Nn \l_@@_F_bitset {Print} + \bitset_set_false:Nn \l_@@_F_bitset {Hidden} + \bitset_set_false:Nn \l_@@_F_bitset {Invisible} + \bitset_set_false:Nn \l_@@_F_bitset {NoView} + } + \pdfdict_if_empty:nF{l_@@/checkbox/annot/AA} + { + \pdfmeta_standard_verify:nT + {annot_widget_no_AA} + { + \pdfdict_put:nnx + {l_@@/checkbox/annot} + {AA} + {<<\pdfdict_use:n {l_@@/checkbox/annot/AA}>>} + } + } + \pdfdict_put:nnx {l_@@/checkbox/annot}{F}{ \bitset_to_arabic:N \l_@@_F_bitset } + \pdfdict_set_eq:nn {l__pdfannot/widget}{l_@@/checkbox/annot} + \pdfannot_dict_put:nnx {widget}{Parent}{\pdf_object_ref:n{@@_checkbox/field/#1}} + \mode_leave_vertical: + \hbox_to_wd:nn + { #2 } + { + \rule [-#4]{0pt}{\dim_eval:n{#3+#4} } + \pdfannot_widget_box:nnn + { #2 } + { #3 } + { #4 } + \hfill + } + \seq_gput_right:cx {g_@@_checkbox/field/#1/Kids_seq}{ \pdfannot_box_ref_last:} + \group_end: + } + +% \end{macrocode} +% \end{macro} +% \subsection{Appearances} +% We don't try to force a size or content here. +% The default appearances are a cross (\cs{texttimes}), +% Every appearance should have two versions and follow the naming +% checkbox/\meta{name}/Yes and checkbox/\meta{name}/Off. +% TODO check if one delay the creation to a sensible place +% (and don't forget that the appearance key sets an initial +% value) +% \begin{macro}{\pdffield_store_appearance:nn,\@@_store_default_appearances:} +% \begin{macrocode} +\cs_new_protected:Npn \pdffield_store_appearance:nn #1 #2 + { + \pdfxform_new:nnn {@@_#1}{}{#2} + } + +\cs_new_protected:Nn \@@_store_default_appearances: + { + \pdffield_store_appearance:nn {checkbox/default/Yes} + { + \normalsize + \fboxsep 0pt + \framebox + [ \dim_eval:n { \box_ht:N\strutbox+\box_dp:N\strutbox } ] + { \texttimes \strut } + } + \pdffield_store_appearance:nn {checkbox/default/Off} + { + \normalsize + \fboxsep 0pt + \framebox + [ \dim_eval:n { \box_ht:N\strutbox+\box_dp:N\strutbox } ] + { \phantom{\texttimes} \strut } + } + } + +\@@_store_default_appearances: +% \end{macrocode} +% \end{macro} +% We define a dictionary for the AP content, so that we can add R and D too +% \begin{macrocode} +\pdfdict_new:n {l_@@/checkbox/annot/AP} +% \end{macrocode} +% +% \subsection{Assembling the checkbox} +% \begin{macro}{\@@_checkbox_add:n} +% \begin{macrocode} + +\cs_new_protected:Npn \@@_checkbox_add:n #1 + { + \group_begin: + \keys_set_filter:nnnN {pdffield / checkbox }{field}{#1}\l_@@_keys_tmpa_tl + \str_if_empty:NT \l_@@_field_name_str + { + \msg_error:nn {pdffield}{empty-name} + } + \exp_args:Nx + \pdf_object_if_exist:nTF {@@_checkbox/field/\l_@@_field_name_str} + { + \tl_if_empty:NF \l_@@_keys_tmpa_tl + { + \msg_warning:nnxx + {pdffield} + {field-keys-ignored} + {\l_@@_field_name_str} + {\l_@@_keys_tmpa_tl} + } + } + { + \keys_set:nV { pdffield/checkbox } \l_@@_keys_tmpa_tl + \exp_args:No + \@@_checkbox_field_new:n {\l_@@_field_name_str} + } + \exp_args:No + \@@_checkbox_annot_add:nnnn + {\l_@@_field_name_str} + {\l_@@_annot_wd_tl } + {\l_@@_annot_ht_tl } + {\l_@@_annot_dp_tl } + \group_end: + } +% \end{macrocode} +% \end{macro} +% \subsection{Keys} +% The size of the checkbox +% +% \begin{macrocode} +\tl_new:N \l_@@_annot_ht_tl +\tl_new:N \l_@@_annot_wd_tl +\tl_new:N \l_@@_annot_dp_tl + +\keys_define:nn { pdffield / checkbox } + { + ,width .tl_set:N = \l_@@_annot_wd_tl + ,height .tl_set:N = \l_@@_annot_ht_tl + ,depth .tl_set:N = \l_@@_annot_dp_tl + ,width .initial:n = \normalbaselineskip + ,height .initial:n = \normalbaselineskip + ,depth .initial:n = 0pt + } +% \end{macrocode} +% The names. The main name should not be empty, it is added to the dictionary +% when the field is created. A new name means a new field. +% The other names can only be set when the field is created, +% so we put them in the field group. +% \begin{macrocode} +\keys_define:nn { pdffield / checkbox } + { + ,name .code:n = + { + \pdf_string_from_unicode:nnN {utf8/string-raw}{#1}\l_@@_field_name_str + \str_if_in:NnT \l_@@_field_name_str {.} + { + \msg_error:nnx {pdffield}{no-period}{\l_@@_field_name_str} + } + \str_if_empty:NT\l_@@_field_name_str + { + \msg_error:nn {pdffield}{empty-name} + } + } + ,name .value_required:n = true + ,name .initial:n = checkbox + ,altname .code:n = + { + \pdf_string_from_unicode:nnN {utf8/string}{#1}\l_@@_name_tmpa_str + \pdfdict_put:nnx { l_@@/checkbox/field }{TU}{\l_@@_name_tmpa_str} + } + ,altname .groups:n = {field} + ,mappingname .code:n = + { + \pdf_string_from_unicode:nnN {utf8/string}{#1}\l_@@_name_tmpa_str + \pdfdict_put:nnx { l_@@/checkbox/field }{TM}{\l_@@_name_tmpa_str} + } + ,mappingname .groups:n = {field} + } +% \end{macrocode} + +% A key to decide if the Box is initially checked or not +% \begin{macrocode} +\keys_define:nn { pdffield / checkbox } + { + ,checked .choice: + ,checked / false .code:n = + { + \pdfdict_put:nnn {l_@@/checkbox/field}{V}{/Off} + \pdfdict_put:nnn {l_@@/checkbox/annot}{AS}{/Off} + \pdfdict_put:nnn {l_@@/checkbox/field}{DV}{/Off} + } + ,checked / true .code:n = + { + \pdfdict_put:nnn {l_@@/checkbox/field}{V}{/Yes} + \pdfdict_put:nnn {l_@@/checkbox/annot}{AS}{/Yes} + \pdfdict_put:nnn {l_@@/checkbox/field}{DV}{/Yes} + } + ,checked .default:n = {true} + ,checked .initial:n = {false} + } +% \end{macrocode} +% Flags. We don't add lots of individual keys but mapped the key names directly +% \begin{macrocode} +\keys_define:nn { pdffield / checkbox } + { + ,setfieldflags .code:n = + { + \clist_map_inline:nn {#1} + { + \bitset_set_true:Nn \l_@@_Ff_bitset {##1} + } + } + ,setfieldflags .groups:n = {field} + ,unsetfieldflags .code:n = + { + \clist_map_inline:nn {#1} + { + \bitset_set_false:Nn \l_@@_Ff_bitset {##1} + } + } + ,unsetfieldflags .groups:n = {field} + ,setannotflags .code:n = + { + \clist_map_inline:nn {#1} + { + \bitset_set_true:Nn \l_@@_F_bitset {##1} + } + } + ,unsetannotflags .code:n = + { + \clist_map_inline:nn {#1} + { + \bitset_set_false:Nn \l_@@_F_bitset {##1} + } + } + } + +\keys_define:nn { pdffield / checkbox } + { + appearance .code:n = %value is a name of an appearance + { + \pdfxform_if_exist:nTF { @@_#1/Yes } + { + \pdfdict_put:nnn {l_@@/checkbox/annot/AP} + {N} + { + << + /Yes ~ \pdfxform_ref:n { @@_#1/Yes} + /Off ~ \pdfxform_ref:n { @@_#1/Off} + >> + } + } + { + \msg_error:nnnn{pdffield}{appearance-missing}{#1}{normal} + } + }, + appearance .initial:n = checkbox/default, + } + +\keys_define:nn { pdffield / checkbox } + { + rollover-appearance .code:n = %value is a name of an appearance + { + \tl_if_empty:nTF {#1} + { + \pdfdict_remove:nn {l_@@/checkbox/annot/AP} {R} + } + { + \pdfxform_if_exist:nTF { @@_#1/Yes } + { + \pdfdict_put:nnn {l_@@/checkbox/annot/AP} + {R} + { + << + /Yes ~ \pdfxform_ref:n { @@_#1/Yes} + /Off ~ \pdfxform_ref:n { @@_#1/Off} + >> + } + } + { + \msg_warning:nnnn{pdffield}{appearance-missing}{#1}{rollover} + } + + } + }, + } + +\keys_define:nn { pdffield / checkbox } + { + down-appearance .code:n = %value is a name of an appearance + { + \tl_if_empty:nTF {#1} + { + \pdfdict_remove:nn {l_@@/checkbox/annot/AP} {D} + } + { + \pdfxform_if_exist:nTF { @@_#1/Yes } + { + \pdfdict_put:nnn {l_@@/checkbox/annot/AP} + {D} + { + << + /Yes ~ \pdfxform_ref:n { @@_#1/Yes} + /Off ~ \pdfxform_ref:n { @@_#1/Off} + >> + } + } + { + \msg_warning:nnnn{pdffield}{appearance-missing}{#1}{down} + } + } + }, + } +% \end{macrocode} +% +% Keys for the AA dictionary. They all trigger javascript option. +% \begin{macro}{\@@_define_AAaction_key:nnn} +% \begin{macrocode} +\pdfdict_new:n {l_@@/checkbox/annot/AA} +\pdfdict_new:n {l_@@/checkbox/field/AA} + +\cs_new_protected:Npn \@@_define_AAaction_key:nnn #1 #2 #3 %#1 key, #2 pdf, #3 dict + { + \keys_define:nn { pdffield / checkbox } + { + #1 .code:n = + { + \pdf_string_from_unicode:nnN {utf8/string}{##1}\l_@@_tmpa_str + \str_if_empty:NTF \l_@@_tmpa_str + { + \pdfdict_remove:nn {l_@@/checkbox/#3/AA}{#2} + } + { + \pdfdict_put:nnx {l_@@/checkbox/#3/AA} + {#2} + {<>} + } + }, + #1 .groups:n = {#3} + } + } +\@@_define_AAaction_key:nnn {keystroke}{K}{field} +\@@_define_AAaction_key:nnn {format} {F}{field} +\@@_define_AAaction_key:nnn {validate} {V}{field} +\@@_define_AAaction_key:nnn {calculate}{C}{field} +\@@_define_AAaction_key:nnn {onfocus} {Fo}{annot} +\@@_define_AAaction_key:nnn {onblur} {Bl}{annot} +\@@_define_AAaction_key:nnn {onmousedown}{D}{annot} +\@@_define_AAaction_key:nnn {onmouseup}{U}{annot} +\@@_define_AAaction_key:nnn {onenter} {E}{annot} +\@@_define_AAaction_key:nnn {onexit} {X}{annot} +% \end{macrocode} +% \end{macro} +% \subsection{user commands} +% \begin{macro}{\pdffield_checkbox:n,\pdffield_setup:nn} +% \begin{macrocode} +\cs_set_eq:NN \pdffield_checkbox:n \@@_checkbox_add:n + +\cs_new_protected:Npn \pdffield_setup:nn #1 #2 + { + \keys_set:n {pdffield / #1 } {#2} + } +% +% \end{macrocode} +% \end{macro} +%\end{implementation} + +\endinput% +%%%% +% +%Field dict +%Ft : /Btn /Tx /Ch /Sig +%Parent : OR +%Kids: array, other fields or annot/widget +%T: partial fieldname (test string) +%TU: alternate description (test string) +%TM: mapping name +%Q integer (variable text field) +%Ff: flags ->pdffield/checkbox/field +%V: value % not pushbutton +%DV: default value % not pushbutton +%AA: Action dict ... -> see below +%Opt: array of strings, connected to kids +% or for choices, choices +%TI integer (lists) +%I array Ch (complicated ...) +% +%/DA ( 0 0 1 rg /Ti 12 Tf ) %text field +%/MaxLen %text field +% +%Lock dict (Sig) +%SV dict (Sig) +% +% +% +% +%Connected widget: +%/AS default appearance from AP ( here/Yes or /Off) +%% Appearance +%%checkbox +%/AP <>>> +%/C / Border /BS +% +%/OC ? +%/Structparens? +%/F flags +% +% +%AA: Submit: +% /S /SubmitForm +% /F file /URI (/F ( ftp : / / www . beatles . com / Movies / AbbeyRoad . mov ) +% /Fields array +% +% /S /ImportData +% /F file +% +% /S /ResetData +% /Fields array +% +% /S /JavaScript +% /JS text string or stream +% %\pdf_flag_new:nn {annot/field/submit} %name is wrong ... +% { +% Include/Exclude = 0, +% IncludeNoValueFields = 1, +% ExportFormat = 2, +% GetMethod = 3, % if ExportFormat=0 -> =0 to +% SubmitCoordinates = 4, % if ExportFormat=0 -> =0 to +% XFDF = 5, +% IncludeAppendSaves = 6, +% IncludeAnnotations = 7, +% SubmitPDF = 8, +% CanonicalFormat = 9, +% ExclNonUserAnnots = 10, +% ExclFKey = 11, +% EmbedForm = 12 +% } +% source: %adapted from https://chat.stackexchange.com/transcript/message/54421537#54421537 diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdffield.pdf b/macros/latex/contrib/pdfmanagement-testphase/l3pdffield.pdf new file mode 100644 index 0000000000..6fc5c3844b Binary files /dev/null and b/macros/latex/contrib/pdfmanagement-testphase/l3pdffield.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdffile.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3pdffile.dtx index c1a2a25591..4a65e09fd6 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/l3pdffile.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/l3pdffile.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-22} +% \date{Version 0.95b, released 2021-03-07} % % \maketitle % \begin{documentation} @@ -70,7 +70,7 @@ % Case 1 (Links) are created with the \cs{pdfannot} commands. % This module handles the two other cases. Actually from the view % of the PDF format they are quite similar: Case 2 is case 3 without the stream -% object and without the /EF entry in the /FileSpec dictionary (this points to the +% object and without the /EF entry in the /Filespec dictionary (this points to the % stream object of the file). Not embedding the file makes the PDF smaller. But it is % also less portable: the files can only be found if they are in the right location % relative to the PDF. The normal case is to embed the file. @@ -78,7 +78,7 @@ % The tasks to embed and reference such a file are % \begin{enumerate} % \item Embed the file in a stream. -% \item Create a FileSpec dictionary which references the stream object in the /EF +% \item Create a Filespec dictionary which references the stream object in the /EF % dictionary: % \begin{verbatim} % << @@ -94,7 +94,7 @@ % and name it \texttt{blub.tex}. The second name is then what the user will see % in the attachment list or in the properties of an annotation. % -%\item Reference the FileSpec dictionary so that the user can access the file. +%\item Reference the Filespec dictionary so that the user can access the file. % This can be done in various way: % \begin{enumerate} % \item With an annotation (/Subtype/FileAttachment). This is done by @@ -104,7 +104,7 @@ % \medskip % \begin{tabular}{lll} % key & value type & notes\\\hline -% /FS & object reference &(FileSpec dictionary)\\ +% /FS & object reference &(Filespec dictionary)\\ % /Name & name & /Graph, /PushPin, /Paperclip, /Tag\\ % /Contents & text string & optional but recommended\\ % /F & integer & Flags\\ @@ -137,7 +137,7 @@ % /AF /NamedAF BDC % /Properties < -\ProvidesExplPackage {l3pdffile} {2021-02-22} {0.95a} +\ProvidesExplPackage {l3pdffile} {2021-03-07} {0.95b} {embedding and referencing files in PDF---LaTeX PDF management testphase bundle} \RequirePackage{l3pdftools} %temporarly!! % @@ -402,7 +402,7 @@ \msg_new:nnn { pdffile } { target-name-missing } { - a~target~name~for~the~/FileSpec~dictionary~is~missing. + a~target~name~for~the~/Filespec~dictionary~is~missing. } \msg_new:nnn { pdffile } { object-exists } @@ -492,10 +492,10 @@ \int_use:N\c_sys_day_int ) } -\pdfdict_new:n { l_pdffile/FileSpec } -\pdfdict_put:nnn { l_pdffile/FileSpec } - {Type} { /FileSpec } -\pdfdict_put:nnn { l_pdffile/FileSpec } +\pdfdict_new:n { l_pdffile/Filespec } +\pdfdict_put:nnn { l_pdffile/Filespec } + {Type} { /Filespec } +\pdfdict_put:nnn { l_pdffile/Filespec } {AFRelationship} { /Unspecified } % \end{macrocode} @@ -621,11 +621,11 @@ \pdf_object_new:nn { #1 } {dict} \group_begin: \@@_filename_convert_to_print:nN { #2 } \l_@@_tmpa_str - \pdfdict_put:nnx {l_pdffile/FileSpec}{F} { \l_@@_tmpa_str } - \pdfdict_put:nnx {l_pdffile/FileSpec}{UF}{ \l_@@_tmpa_str } + \pdfdict_put:nnx {l_pdffile/Filespec}{F} { \l_@@_tmpa_str } + \pdfdict_put:nnx {l_pdffile/Filespec}{UF}{ \l_@@_tmpa_str } \pdf_object_write:nx { #1 } { - \pdfdict_use:n { l_pdffile/FileSpec} + \pdfdict_use:n { l_pdffile/Filespec} \tl_if_empty:nF { #3 } { /EF <> diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdffile.pdf b/macros/latex/contrib/pdfmanagement-testphase/l3pdffile.pdf index a79ea7df55..49e015fef5 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/l3pdffile.pdf and b/macros/latex/contrib/pdfmanagement-testphase/l3pdffile.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfmanagement.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3pdfmanagement.dtx index 55514bd06c..f6b9a7fafe 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/l3pdfmanagement.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/l3pdfmanagement.dtx @@ -61,7 +61,7 @@ % }^^A % } % -% \date{Version 0.95a,released 2021-02-22} +% \date{Version 0.95b,released 2021-03-07} % % \maketitle % \begin{documentation} @@ -557,7 +557,7 @@ %<@@=pdfmanagement> %<*header> % -\ProvidesExplPackage {l3pdfmanagement} {2021-02-22} {0.95a} +\ProvidesExplPackage {l3pdfmanagement} {2021-03-07} {0.95b} {Management of core PDF dictionaries (LaTeX PDF management testphase bundle)} % % \end{macrocode} diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfmanagement.pdf b/macros/latex/contrib/pdfmanagement-testphase/l3pdfmanagement.pdf index 51c580ade5..3a21c93c56 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/l3pdfmanagement.pdf and b/macros/latex/contrib/pdfmanagement-testphase/l3pdfmanagement.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfmeta.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3pdfmeta.dtx index a374e39fc7..48d2f14759 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/l3pdfmeta.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/l3pdfmeta.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-21} +% \date{Version 0.95b, released 2021-02-21} % % \maketitle % \begin{documentation} @@ -340,7 +340,7 @@ % \begin{macrocode} %<@@=pdfmeta> %<*header> -\ProvidesExplPackage {l3pdfmeta} {2021-02-22} {0.95a} +\ProvidesExplPackage {l3pdfmeta} {2021-03-07} {0.95b} {PDF-Standards---LaTeX PDF management testphase bundle} % % \end{macrocode} diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfmeta.pdf b/macros/latex/contrib/pdfmanagement-testphase/l3pdfmeta.pdf index ef9a1db31b..1162dcd1cf 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/l3pdfmeta.pdf and b/macros/latex/contrib/pdfmanagement-testphase/l3pdfmeta.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdftools.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3pdftools.dtx index 481ddce872..d1ded1659b 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/l3pdftools.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/l3pdftools.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-22} +% \date{Version 0.95b, released 2021-03-07} % % \maketitle % \begin{documentation} @@ -164,7 +164,7 @@ % This command adds a BDC marked content operator to the current page stream. % \meta{tag} is the tag of this operator (without the leading slash). % As object this commands uses the last anonymous dictionary object created with -% \cs{pdf_object_now:nn}. It lies in the responsibility of the user that the last +% \cs{pdf_object_unnamed_write:nn}. It lies in the responsibility of the user that the last % object is the wanted one. Like with \cs{pdf_bdcobject:nn} the command works correctly % only if the resources management has been activated and should be used only % if this can be ensured. @@ -208,7 +208,7 @@ % % \begin{macrocode} %<*header> -\ProvidesExplPackage {l3pdftools} {2021-02-22} {0.95a} +\ProvidesExplPackage {l3pdftools} {2021-03-07} {0.95b} {candidate commands for l3pdf---LaTeX PDF management testphase bundle} % % \end{macrocode} diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdftools.pdf b/macros/latex/contrib/pdfmanagement-testphase/l3pdftools.pdf index e185a813ec..e8988db424 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/l3pdftools.pdf and b/macros/latex/contrib/pdfmanagement-testphase/l3pdftools.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfxform.dtx b/macros/latex/contrib/pdfmanagement-testphase/l3pdfxform.dtx index ec9afe865d..fa52253471 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/l3pdfxform.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/l3pdfxform.dtx @@ -52,7 +52,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-22} +% \date{Version 0.95b, released 2021-03-07} % % \maketitle % \begin{documentation} @@ -133,7 +133,7 @@ % \begin{macrocode} %<@@=pdf> %<*header> -\ProvidesExplPackage {l3pdfxform-beta} {2021-02-22} {0.95a} +\ProvidesExplPackage {l3pdfxform-beta} {2021-03-07} {0.95b} {command to create xforms (beta)---LaTeX PDF management testphase bundle} % % \end{macrocode} diff --git a/macros/latex/contrib/pdfmanagement-testphase/l3pdfxform.pdf b/macros/latex/contrib/pdfmanagement-testphase/l3pdfxform.pdf index a6faf38b59..4c345d4006 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/l3pdfxform.pdf and b/macros/latex/contrib/pdfmanagement-testphase/l3pdfxform.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.dtx b/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.dtx index f37514d936..53bb237c69 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.dtx @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-22} +% \date{Version 0.95b, released 2021-03-07} % % \maketitle % \begin{documentation} @@ -164,7 +164,7 @@ % \begin{macrocode} %<@@=pdfmanagement> %<*header> -\ProvidesExplPackage {ltdocinit} {2021-02-22} {0.95a} +\ProvidesExplPackage {ltdocinit} {2021-03-07} {0.95b} {Initialize document metadata} % % \end{macrocode} @@ -189,18 +189,19 @@ % \end{macrocode} % The wanted backend must be detected first, we read the init key and then % force the loading by either loading l3pdf (+ expl3) or only expl3. +% The backend contains now management command, so the boolean should true first. % \begin{macrocode} \keys_set_groups:nnn { document / metadata} {init}{ #1 } %should be loaded after the backend is set, and only if not in the kernel + \bool_gset_true:N \g_@@_active_bool \cs_if_free:NTF \pdf_uncompress: {\RequirePackage{l3pdf}}{\RequirePackage{expl3}} % \end{macrocode} -% Now we load the extra backend code and set the boolean to true +% Now we load the extra backend code % \begin{macrocode} \ExplSyntaxOn\makeatletter \file_input:n {l3backend-testphase-\c_sys_backend_str.def} \ExplSyntaxOff\makeatother - \bool_gset_true:N \g_@@_active_bool % \end{macrocode} % set the default language, process the rest of the keys, % and setup the generic driver @@ -341,7 +342,6 @@ \msg_warning:nnn{pdf}{unknown-standard}{#1} } ,pdfmanagement .bool_gset:N = \g_@@_active_bool - ,pdfmanagement .initial:n = {true} ,firstaidoff .clist_gset:N = \g_@@_firstaidoff_clist } % \end{macrocode} diff --git a/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.pdf b/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.pdf index d4f5b63ecb..99ee652c79 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.pdf and b/macros/latex/contrib/pdfmanagement-testphase/ltdocinit.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/pdflscape-ltx.sty b/macros/latex/contrib/pdfmanagement-testphase/pdflscape-ltx.sty index b3ade3f709..ef27c06cf1 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/pdflscape-ltx.sty +++ b/macros/latex/contrib/pdfmanagement-testphase/pdflscape-ltx.sty @@ -1,7 +1,7 @@ %% %% This is file `pdflscape-ltx.sty', %% -%% Version: 2021/02/22 v0.95a +%% Version: 2021/02/22 v0.95b %% %% Copyright (C) 2021 The LaTeX Project %% @@ -24,7 +24,7 @@ %% This work consists of the main source file pdflscape-ltx.sty %% \NeedsTeXFormat{LaTeX2e} -\ProvidesExplPackage {pdflscape-ltx}{2021/02/22}{v0.95a} +\ProvidesExplPackage {pdflscape-ltx}{2021/02/22}{v0.95b} {Display of landscape pages in PDF - adaption of pdflscape to the PDFmanagement bundle (testphase)} \RequirePackage{lscape} diff --git a/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-firstaid.dtx b/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-firstaid.dtx index 08fbf856db..dc33bf093c 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-firstaid.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-firstaid.dtx @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-22} +% \date{Version 0.95b, released 2021-03-07} % % \maketitle % \begin{documentation} @@ -67,11 +67,11 @@ % |firstaidoff={name1,name2,...}|. % \begin{macrocode} %<*package> -\ProvidesExplPackage {pdfmanagement-firstaid} {2021-02-22} {0.95a} +\ProvidesExplPackage {pdfmanagement-firstaid} {2021-03-07} {0.95b} {LaTeX PDF management testphase bundle / firstaid-patches} %<@@=pdfmanagement> -\clist_map_inline:nn {pgf,transparent,hyperxmp,pdflscape,xcolor,color} +\clist_map_inline:nn {pgf,transparent,hyperxmp,pdflscape,xcolor,color,beamer} { \bool_new:c { g_@@_firstaid_#1_bool } \bool_gset_true:c { g_@@_firstaid_#1_bool } @@ -86,6 +86,15 @@ \msg_new:nnn { pdfmanagement } { firstaid } { loading~pdfmanagement~firstaid~code~for~#1 } % \end{macrocode} +% \subsection{\pkg{beamer}} +% \pkg{beamer} makes use of the now unsupported syntax |linkbordercolor={.5 .5 .5}|. +% To avoid an error we define this color as a name. +% \begin{macrocode} +\bool_if:NT \g_@@_firstaid_beamer_bool + { + \color_set:nnn{.5~.5~.5}{rgb}{0.5,0.5,0.5} + } +% \end{macrocode} % \subsection{\pkg{color}} % % \pkg{color} is not incompatible, but the new \pkg{hyperref} driver makes use of diff --git a/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-firstaid.pdf b/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-firstaid.pdf index 3492a9b7af..92144a63e7 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-firstaid.pdf and b/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-firstaid.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.dtx b/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.dtx index 4b63544d17..7f37e132d7 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.dtx +++ b/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.dtx @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Version 0.95a, released 2021-02-22} +% \date{Version 0.95b, released 2021-03-07} % % \maketitle % \begin{documentation} @@ -274,6 +274,10 @@ % for external incompatible packages. This patches will disappear as soon as % the packages are natively compatible. It is loaded automatically. % +% \item[l3pdffield] Commands for form fields. Currently it only provides commands +% for checkboxes. It must be loaded explicitly as with +% |\usepackage{l3pdffield-testphase}|. +% % \end{description} % \section{Incompabilities} % @@ -380,7 +384,7 @@ % \begin{macrocode} %<@@=pdf> %<*package> -\ProvidesExplPackage {pdfmanagement-testphase} {2021-02-22} {0.95a} +\ProvidesExplPackage {pdfmanagement-testphase} {2021-03-07} {0.95b} {LaTeX PDF management testphase bundle} \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \IfFormatAtLeastTF{2020-10-01}{}{ @@ -408,7 +412,7 @@ % \begin{macrocode} %<*header> \ProvidesExplFile - {pdfmanagement-testphase.ltx}{2021-02-22}{0.95a} + {pdfmanagement-testphase.ltx}{2021-03-07}{0.95b} {PDF~management~code~(testphase)} % %<*package> diff --git a/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.ins b/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.ins index 6452b24c68..87ac62f1b0 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.ins +++ b/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.ins @@ -123,6 +123,14 @@ and all files in that bundle must be distributed together. % }% % } +\generate + {% + \file{l3pdffield-testphase.sty} + {% + \from{l3pdffield.dtx}{package} + }% + } + \generate { \file{l3backend-testphase-dvipdfmx.def} diff --git a/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.pdf b/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.pdf index d9c2da2862..c5021da118 100644 Binary files a/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.pdf and b/macros/latex/contrib/pdfmanagement-testphase/pdfmanagement-testphase.pdf differ diff --git a/macros/latex/contrib/pdfmanagement-testphase/transparent-ltx.sty b/macros/latex/contrib/pdfmanagement-testphase/transparent-ltx.sty index be7a252270..7fd747325d 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/transparent-ltx.sty +++ b/macros/latex/contrib/pdfmanagement-testphase/transparent-ltx.sty @@ -4,7 +4,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2020/10/01] \ProvidesExplPackage{transparent-ltx}% - {2021-02-22}{v0.95a}{Transparency with color stacks (replacement for transparent.sty from Heiko Oberdiek)}% + {2021-03-07}{v0.95b}{Transparency with color stacks (replacement for transparent.sty from Heiko Oberdiek)}% \RequirePackage{l3opacity} diff --git a/macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty b/macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty index c49a000fa2..5363a83077 100644 --- a/macros/latex/contrib/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty +++ b/macros/latex/contrib/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.95a patch xcolor for l3color] +\ProvidesPackage{xcolor-patches-tmp-ltx}[2021/02/22 v0.95b patch xcolor for l3color] \@ifundefined{color_set:nn}{\RequirePackage{l3color}}{} \ExplSyntaxOn -- cgit v1.2.3