summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pdfmanagement-testphase
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-23 22:38:24 +0000
committerKarl Berry <karl@freefriends.org>2021-02-23 22:38:24 +0000
commit96be5ed7ba5ce4406ca538c4b0d18edeec9d7aab (patch)
treef903bef02645eac80be0107658487813b3ebc6a7 /Master/texmf-dist/tex/latex/pdfmanagement-testphase
parent7389bb9fb813a0f5e8654431dacfcb81d1f116e4 (diff)
pdfmanagement-testphase (23feb21)
git-svn-id: svn://tug.org/texlive/trunk@57862 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pdfmanagement-testphase')
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty221
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def3348
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def144
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty139
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def377
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def194
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def152
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def388
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def406
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def377
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3ref-tmp.sty131
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty54
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty183
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty45
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty26
-rw-r--r--Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty98
16 files changed, 6283 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty
new file mode 100644
index 00000000000..60a55ad9c33
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/color-ltx.sty
@@ -0,0 +1,221 @@
+%%
+%% This is file `color.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% color.dtx (with options: `package')
+%%
+%% The source is maintained by the LaTeX Project team and bug
+%% reports for it can be opened at https://latex-project.org/bugs/
+%% (but please observe conditions on bug reports sent to that address!)
+%%
+%%
+%% color.dtx Copyright (C) 1994--1999 David Carlisle
+%% Copyright (C) 2005-2020 David Carlisle, LaTeX3 Project
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.3c or, at your option, any later version.
+%%
+%% This file has the LPPL maintenance status "maintained".
+%%
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesPackage{color-ltx}
+ [2021/02/22 v1.2d Standard LaTeX Color (patched for l3color) (DPC)]
+\edef\Gin@codes{%
+ \catcode`\noexpand\^^A\the\catcode`\^^A\relax
+ \catcode`\noexpand\"\the\catcode`\"\relax
+ \catcode`\noexpand\*\the\catcode`\*\relax
+ \catcode`\noexpand\!\the\catcode`\!\relax
+ \catcode`\noexpand\:\the\catcode`\:\relax}
+\catcode`\^^A=\catcode`\%
+\catcode`\"=12
+\catcode`\*=11
+\catcode`\!=12
+\catcode`\:=12
+\providecommand\Gin@driver{}
+\def\c@lor@error#1{%
+ \@latex@error{Undefined color #1}\@ehd}
+\DeclareOption{monochrome}{%
+ \def\c@lor@error#1{\PackageInfo{color}{Undefined color #1}}%
+ \AtEndOfPackage{%
+ \colors@false
+ \def\set@color{%
+ \c@lor@special\m@ne
+ {color push \current@color}\aftergroup\reset@color}%
+ \def\reset@color{\c@lor@special\m@ne{color pop}}%
+ \def\set@page@color{%
+ \c@lor@special\m@ne{background \current@color}}%
+ \def\define@color#1#2{%
+ \c@lor@special\m@ne{define #1 #2}}}}
+\DeclareOption{debugshow}{\catcode`\^^A=9 \let\GDebug\typeout}
+\newif\ifGin@setpagesize\Gin@setpagesizetrue
+\DeclareOption{setpagesize}{\Gin@setpagesizetrue}
+\DeclareOption{nosetpagesize}{\Gin@setpagesizefalse}
+\DeclareOption{dvips}{\def\Gin@driver{dvips.def}%
+ \def\c@lor@namefile{dvipsnam.def}}
+\DeclareOption{xdvi}{\ExecuteOptions{dvips,monochrome}}
+\DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}}
+\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfm.def}}
+\DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}}
+\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
+\DeclareOption{luatex}{\def\Gin@driver{luatex.def}}
+\DeclareOption{dvisvgm}{\def\Gin@driver{dvisvgm.def}}
+\DeclareOption{xetex}{\def\Gin@driver{xetex.def}}
+\DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}}
+\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}}
+\DeclareOption{emtex}{\def\Gin@driver{emtex.def}}
+\DeclareOption{dviwin}{\def\Gin@driver{dviwin.def}}
+\DeclareOption{oztex}{\ExecuteOptions{dvips}}
+\DeclareOption{textures}{\def\Gin@driver{textures.def}}
+\DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}}
+\DeclareOption{pctexwin}{\def\Gin@driver{pctexwin.def}}
+\DeclareOption{pctexhp}{\def\Gin@driver{pctexhp.def}}
+\DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}}
+\DeclareOption{truetex}{\def\Gin@driver{truetex.def}}
+\DeclareOption{tcidvi}{\def\Gin@driver{tcidvi.def}}
+\DeclareOption{vtex}{\def\Gin@driver{vtex.def}}
+\DeclareOption{dvipsnames}{\def\c@lor@namefile{dvipsnam.def}}
+\DeclareOption{nodvipsnames}{\let\c@lor@namefile\relax}
+\let\c@lor@usename\@gobble
+\DeclareOption{usenames}{%
+ \def\c@lor@usename#1{%
+ \expandafter\color@named\csname\string\color @#1\endcsname{#1}}}
+\DeclareRobustCommand\color{%
+ \@ifnextchar[\@undeclaredcolor\@declaredcolor}
+\def\@undeclaredcolor[#1]#2{%
+ \@ifundefined{color@#1}%
+ {\c@lor@error{model `#1'}}%
+ {\csname color@#1\endcsname\current@color{#2}%
+ \set@color}%
+ \ignorespaces}
+\def\@declaredcolor#1{%
+ \@ifundefined{\string\color @#1}%
+ {\c@lor@error{`#1'}}%
+ {\expandafter\let\expandafter\current@color
+ \csname\string\color @#1\endcsname
+ \set@color}%
+ \ignorespaces}
+\protected\def\textcolor#1#{\@textcolor{#1}}
+\def\@textcolor#1#2#3{\protect\leavevmode{\color#1{#2}#3}}
+\protected\def\pagecolor{%
+ \begingroup
+ \let\ignorespaces\endgroup
+ \let\set@color\set@page@color
+ \color}
+\protected\def\nopagecolor{%
+ \@ifundefined{no@page@color}{%
+ \PackageInfo{color}{\string\nopagecolor\space is not supported}%
+ }{%
+ \no@page@color
+ }%
+}
+\protected\def\definecolor#1#2#3{%
+ \@ifundefined{color@#2}%
+ {\c@lor@error{model `#2'}}%
+ {\@ifundefined{\string\color @#1}{}%
+ {\PackageInfo{color}{Redefining color #1}}%
+ \csname color@#2\expandafter\endcsname
+ \csname\string\color @#1\endcsname{#3}}%
+ \@expl@color@set@@nnn{#1}{#2}{#3}%
+ }
+\protected\def\DefineNamedColor#1#2#3#4{%
+ \@ifundefined{define@color@#1}%
+ {\c@lor@error{model `#1'}}%
+ {\@ifundefined{color@#3}%
+ {\c@lor@error{model `#3'}}%
+ {\@ifundefined{col@#2}{}%
+ {\PackageInfo{color}{Redefining color #2 in named color model}}%
+ \csname color@#3\endcsname\@tempa{#4}%
+ \@expl@color@set@@nnn{#2}{#3}{#4}%
+ \csname define@color@#1\endcsname{#2}\@tempa
+ \c@lor@usename{#2}}}}
+\@onlypreamble\DefineNamedColor
+\protected\def\@expl@color@set@@nnn#1#2#3{}
+\ifdefined\ExplSyntaxOn
+ \ExplSyntaxOn
+ \cs_gset_protected:Npn \@expl@color@set@@nnn #1 #2 #3
+ {
+ \cs_if_exist:NT \color_set:nnn
+ { \cs_if_exist:cTF { __color_parse_model_ #2 :w }
+ {
+ \color_set:nnn {#1}{#2}{#3}
+ }
+ { %for dvi mode
+ \tl_if_eq:nnT{#2}{named}
+ {
+ \color_set:nn{#1}{#3}
+ }
+ }
+ }
+ }
+ \ExplSyntaxOff
+\fi
+\newif\ifcolors@
+\colors@true
+\def\c@lor@special#1#2{%
+ \edef\@tempa{\write#1{#2}}\@tempa}
+\InputIfFileExists{color.cfg}{}{}
+\ProcessOptions
+\if!\Gin@driver!
+ \PackageError{color}
+ {No driver specified}
+ {You should make a default driver option in a file \MessageBreak
+ color.cfg\MessageBreak
+ eg: \protect\ExecuteOptions{dvips}%
+ }
+\else
+ \PackageInfo{color}{Driver file: \Gin@driver}
+ \@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{}
+\fi
+\@ifundefined{c@lor@namefile}{}{\input{\c@lor@namefile}}
+\protected\def\normalcolor{\let\current@color\default@color\set@color}
+\AtBeginDocument{\let\default@color\current@color}
+\def\color@block#1#2#3{%
+ {\set@color\rlap{\ifcolors@\vrule\@width#1\@height#2\@depth#3\fi}}}
+\protected\def\colorbox#1#{\color@box{#1}}
+\def\color@box#1#2{\color@b@x\relax{\color#1{#2}}}
+\protected\def\fcolorbox#1#{\color@fbox{#1}}
+\def\color@fbox#1#2#3{%
+ \color@b@x{\fboxsep\z@\color#1{#2}\fbox}{\color#1{#3}}}
+
+\long\def\color@b@x#1#2#3{%
+ \leavevmode
+ \setbox\z@\hbox{\kern\fboxsep{\set@color#3}\kern\fboxsep}%
+ \dimen@\ht\z@\advance\dimen@\fboxsep\ht\z@\dimen@
+ \dimen@\dp\z@\advance\dimen@\fboxsep\dp\z@\dimen@
+ {#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}%
+ \box\z@}}}
+\def\color@setgroup{\begingroup\set@color}
+\let\color@begingroup\begingroup
+\def\color@endgroup{\endgraf\endgroup}
+\def\color@hbox{\hbox\bgroup\color@begingroup}
+\def\color@vbox{\vbox\bgroup\color@begingroup}
+\def\color@endbox{\color@endgroup\egroup}
+\ifx\color@gray\@undefined
+ \ifx\color@rgb\@undefined
+ \else
+ \definecolor{black}{rgb}{0,0,0}
+ \definecolor{white}{rgb}{1,1,1}
+ \fi
+\else
+ \definecolor{black}{gray}{0}
+ \definecolor{white}{gray}{1}
+\fi
+\ifx\color@rgb\@undefined\else
+ \definecolor{red}{rgb}{1,0,0}
+ \definecolor{green}{rgb}{0,1,0}
+ \definecolor{blue}{rgb}{0,0,1}
+\fi
+\ifx\color@cmyk\@undefined\else
+ \definecolor{cyan}{cmyk}{1,0,0,0}
+ \definecolor{magenta}{cmyk}{0,1,0,0}
+ \definecolor{yellow}{cmyk}{0,0,1,0}
+\fi
+\Gin@codes
+\let\Gin@codes\relax
+\endinput
+%%
+%% End of file `color.sty'.
diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def
new file mode 100644
index 00000000000..06cb3a8c5db
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def
@@ -0,0 +1,3348 @@
+%%
+%% This is file `hgeneric-testphase.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% hyperref-generic.dtx (with options: `package')
+%%
+%% Copyright (C) 2019-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:
+%%
+%% https://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.
+%%
+%% File: hyperref-generic.dtx
+\ProvidesFile{hgeneric-testphase.def}
+ [2021/02/22 v0.95a %
+ generic Hyperref driver for the LaTeX PDF management testphase bundle]
+
+\RequirePackage{etoolbox} %why?
+\ExplSyntaxOn
+\file_input:n {hyperref-colorschemes.def}
+\ExplSyntaxOff
+\ExplSyntaxOn
+\prop_gput:Nnn \g_msg_module_name_prop { hyp }{ hyperref }
+\msg_new:nnnn
+ { hyp }
+ { missing-resource-management }
+ { The~PDF~resource~management~is~required~for~this~hyperref~driver! }
+ {
+ Activate~it~with \\
+ \tl_to_str:n{\RequirePackage{pdfmanagement-testphase}}\\
+ \tl_to_str:n{\DeclareDocumentMetadata{<options>}}\\
+ before~\tl_to_str:n{\documentclass}
+ }
+\msg_new:nnnn
+ { hyp }
+ { pdfversion-disabled }
+ {
+ This~hyperref~driver~ignores~the~pdfversion~key!\\
+ Set~the~pdfversion~in~\token_to_str:N \DeclareDocumentMetadata
+ }
+ {
+ For example:\\
+ \tl_to_str:n
+ {
+ \DeclareDocumentMetadata { pdfversion=1.7 }
+ }
+ }
+\msg_new:nnn
+ { hyp }
+ { key-dropped }
+ {
+ This~hyperref~driver~ignores~the~key~#1!\\
+ Please~check~the~documentation.
+ }
+\msg_new:nnn
+ { hyp }
+ { pdfa-no-push-button }
+ { PDF/A:~Push~button~with~JavaScript~is~prohibited }
+
+\msg_new:nnn
+ { hyp }
+ { pdfa-no-reset-button }
+ { PDF/A:~Reset~action~is~prohibited }
+\msg_new:nnn
+ { hyp }
+ { pdfa-no-named-action }
+ { PDF/A:~Named~action~#1~is~prohibited }
+\msg_new:nnn
+ { hyp }
+ { empty-destination-name }
+ {
+ Empty~destination~name,\\
+ using~`#1'
+ }
+\msg_new:nnn
+ { hyp }
+ { invalid-destination-value }
+ {
+ Invalid~value~`#1'~of~`#2' \\
+ is~replaced~by~`Fit'~\msg_line_context:.
+ }
+\msg_new:nnn
+ { hyp }
+ { ignore-deprecated-or-unknown-option-in-pdf-version }
+ {
+ Option~`#1'~is~unknown~or~deprecated~in\\
+ pdf~version~#2.~Ignored.
+ }
+\msg_new:nnn
+ { hyp }
+ { ignore-deprecated-or-unknown-value-in-pdf-version }
+ {
+ Value~`#1'~is~unknown~or~deprecated~in\\
+ pdf~version~#2.~Ignored.
+ }
+\msg_new:nnn
+ { hyp }
+ { replace-deprecated-or-unknown-value-in-pdf-version }
+ {
+ Value~`#1'~is~unknown~or~deprecated~in\\
+ pdf~version~#2. Value~`#3'~is used instead.
+ }
+\msg_new:nnn
+ { hyp }
+ { unknown-key }
+ {
+ unknown~key~#2~of~module~’#1’~set~to~’#3’.
+ }
+\msg_new:nnn
+ { hyp }
+ { unknown-key-to-Hyp }
+ {
+ ignored~in~family~Hyp~unknown~key~#1.
+ }
+\cs_new:Npn \__hyp_clist_display:n #1 {*~#1\\}
+\msg_new:nnn
+ { hyp }
+ { unknown-choice }
+ {
+ Value~'#3'~is~invalid~for~key~'#1'.\\
+ The~key~accepts~only~the~choices\\
+ \clist_map_function:nN { #2 }\__hyp_clist_display:n
+ }
+
+\msg_new:nnn
+ { hyp }
+ { unknown-choice+empty }
+ {
+ Value~'#3'~is~invalid~for~key~'#1'.\\
+ The~key~accepts~only~the~choices\\
+ \clist_map_function:nN { #2 }\__hyp_clist_display:n
+ An~empty~value~removes~the~setting.
+ }
+
+\msg_new:nnn
+ { hyp }
+ { no-bool }
+ {
+ Value~'#2'~is~invalid~for~key~'#1'.\\
+ The~key~accepts~only~the~choices\\
+ *~true\\
+ *~false \\
+ *~and~an~empty~value~which~removes~the~setting.\\
+ No~value~is~equivalent~to~using~`true`.
+ }
+\cs_generate_variant:Nn\pdf_destination:nn {nf}
+\chardef\Hy@VersionChecked=1 %don't check the version!
+\cs_set_eq:NN \hypercalcbp \dim_to_decimal_in_bp:n
+\providecommand\@pdfborder{}
+\providecommand\@pdfborderstyle{}
+\newcommand\OBJ@OCG@view {} % needed in hyperref
+\def\Hy@numberline#1{#1\c_space_tl} %needed by bookmark
+\HyPsd@LoadUnicode
+\Hy@unicodetrue
+\let\HyPsd@pdfencoding\HyPsd@pdfencoding@unicode
+\Hy@DisableOption{unicode}
+\cs_set_eq:NN \Hy@pdfminorversion \pdf_version_minor:
+\cs_set_eq:NN \Hy@pdfmajorversion \pdf_version_major:
+\legacy_if:nT { Hy@setpdfversion }
+ {
+ \msg_warning:nn { hyp }{ pdfversion-disabled }
+ }
+\Hy@DisableOption{pdfversion}
+\RenewDocumentCommand \Acrobatmenu { m m }
+ {
+ \hyper@linknamed {#1} {#2}
+ }
+\cs_set_protected:Npn \hypersetup #1
+ {
+ %\kvsetkeys{Hyp} {#1}
+ \keys_set:nn { hyp / setup }{ #1 }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-key }
+ { hyp~/~setup }{ \l_keys_key_str } { #1 }
+ }
+ }
+\cs_new_protected:Npn \__hyp_store_metadata:nn #1 #2 %#1 key, #2 value.
+ {
+ %\tl_set:cn {@#1}{#2}
+ \AddToDocumentProperties[hyperref]{#1}{#2}
+ }
+\cs_generate_variant:Nn \__hyp_store_metadata:nn {xn,nx,xx}
+\hook_new:n{hyp/link/cite}
+\color_set:nnn {hyp/color/cite}{HTML}{2E7E2A}
+\color_set:nn {hyp/color/citeborder}{hyp/color/cite!60!white}
+\keys_define:nn { hyp / setup }
+ {
+ ,citecolor .code:n = {\__hyp_color_set:nn {hyp/color/cite}{#1}}
+ ,citebordercolor
+ .code:n = {\__hyp_color_set:nn {hyp/color/citeborder}{#1}}
+ }
+\hook_gput_code:nnn { hyp/link/cite }{hyp/cite}
+ {
+ \keys_set:nn { hyp / setup }
+ {
+ ,linkbordercolor= hyp/color/citeborder
+ ,linkcolor = hyp/color/cite
+ }
+ }
+\bool_lazy_and:nnF
+ { \cs_if_exist_p:N \pdfmanagement_if_active_p: }{ \pdfmanagement_if_active_p: }
+ { \msg_error:nn { hyp}{ missing-resource-management } }
+\legacy_if:nT { Hy@bookmarks }
+ {
+ \AddToHook{begindocument/before}[hyperref/bookmark]{\RequirePackage{bookmark}}
+ }
+\legacy_if:nT {Hy@draft}
+ {
+ \PassOptionsToPackage{draft}{bookmark}
+ }
+\cs_new_protected:Npn \__hyp_ref_label:nn #1 #2 %label/attributes
+ {
+ \@bsphack
+ \ref_label:nn{#1}{#2}
+ \@esphack
+ }
+\cs_generate_variant:Nn \__hyp_ref_label:nn {en}
+\prg_new_eq_conditional:NNn \__hyp_ref_if_exist:nn \ref_if_exist:nn { p , T , F, TF }
+\prg_generate_conditional_variant:Nnn \__hyp_ref_if_exist:nn {en} { p , T , F, TF }
+\cs_new_protected:Npn \__hyp_ref_check:nn #1 #2 %label/attribute
+ {
+ \__hyp_ref_if_exist:nnF {#1}{#2}
+ {
+ \protect\G@refundefinedtrue
+ \@latex@warning
+ {
+ Reference~`\tl_to_str:n {#1}'~with~attribute~`\tl_to_str:n {#2}'~
+ on~page~\thepage~\space undefined
+ }
+ }
+ }
+\cs_generate_variant:Nn \__hyp_ref_check:nn {en}
+\cs_new:Npn \__hyp_ref_value:nn #1 #2
+ {
+ \ref_value:nn{#1}{#2}
+ }
+\cs_generate_variant:Nn \__hyp_ref_value:nn {en}
+\box_new:N \l__hyp_tmpa_box
+\tl_new:N \l__hyp_tmpa_tl
+\seq_new:N \l__hyp_tmpa_seq
+\int_new:N \l__hyp_tmpa_int
+\str_new:N \l__hyp_tmpa_str
+\tl_new:N \l__hyp_dest_name_tmpa_tl
+\tl_new:N \l__hyp_uri_tmpa_tl
+\tl_new:N \l__hyp_filename_tmpa_tl
+\tl_new:N \l__hyp_para_tmpa_tl
+\str_new:N \l__hyp_text_tmpa_str
+\str_new:N \g__hyp_text_tmpa_str
+\tl_const:Nn \c__hyp_dest_undefined_tl {UNDEFINED}
+\seq_const_from_clist:Nn \c__hyp_annot_types_seq
+ {url,link,file,menu,run}
+\prop_const_from_keyval:Nn \c__hyp_map_annot_hyp_prop
+ {
+ URI = url,
+ GoTo = link,
+ GoToR = file,
+ Named = menu,
+ Launch= run
+ }
+\prop_const_from_keyval:Nn \c__hyp_map_hyp_annot_prop
+ {
+ url = URI,
+ link = GoTo,
+ file = GoToR,
+ menu = Named,
+ run = Launch
+ }
+
+\tl_new:N \g__hyp_dest_pdfstartpage_tl
+\tl_new:N \g__hyp_dest_pdfstartview_tl
+\tl_new:N \l__hyp_dest_pdfremotestartview_tl
+\tl_new:N \l__hyp_text_enc_uri_print_tl
+\tl_new:N \l__hyp_text_enc_info_print_tl
+\tl_new:N \l__hyp_text_enc_dest_tl
+\tl_new:N \l__hyp_text_enc_dest_print_tl
+\tl_new:N \l__hyp_text_enc_file_print_tl
+\tl_new:N \l__hyp_text_enc_para_print_tl
+
+\tl_set:Nn \l__hyp_text_enc_uri_print_tl {utf8/URI}
+\tl_set:Nn \l__hyp_text_enc_info_print_tl {utf16/hex}
+\tl_set:Nn \l__hyp_text_enc_dest_tl {utf8/string-raw}
+\tl_set:Nn \l__hyp_text_enc_dest_print_tl {utf8/string}
+\tl_set:Nn \l__hyp_text_enc_file_print_tl {utf8/string}
+\tl_set:Nn \l__hyp_text_enc_para_print_tl {utf8/string}
+\tl_new:N \l__hyp_dest_pdfview_tl
+\str_new:N \g__hyp_bordercolormodel_str
+\seq_map_inline:Nn \c__hyp_annot_types_seq
+ {
+ \bool_new:c {l_hyp_annot_color#1_bool}
+ }
+\seq_map_inline:Nn \c__hyp_annot_types_seq
+ {
+ \bool_new:c {l_hyp_annot_ocgcolor#1_bool}
+ }
+\seq_map_inline:Nn \c_pdfannot_link_types_seq
+ {
+ \bool_new:c {l__hyp_annot_#1_bool}
+ \bool_set_true:c {l__hyp_annot_#1_bool}
+ }
+\box_new:N \l__hyp_dest_box
+
+\regex_const:Nn \c__hyp_dest_startview_regex
+ {
+ \A\ *
+ (?:
+ (?:XYZ (?:\ +(?:(?:\d+|\d*\.\d+)|null)){3}\ )
+ |
+ (?:Fit\b|FitB\b)
+ |
+ (?:(?:FitH|FitV|FitBH|FitBV)(?:\ +(?:\d+|\d*\.\d+)|\ +null){1})
+ |
+ (?:FitR (?:\ +\d+|\ +\d*\.\d+){4}\ )
+ )
+ }
+\pdfdict_new:n {l__hyp_page/Trans}
+\pdfdict_put:nnn {l__hyp_page/Trans}{Type}{/Trans}
+
+\hook_new:n {hyp/text/pdfstring}
+\cs_new_protected:Npn \__hyp_text_purify:nN #1 #2 %#1 input, #2 str command
+ {
+ \str_set:Nx #2 {\text_purify:n { #1 } }
+ }
+\cs_new_protected:Npn \__hyp_text_cleanup:N #1
+ {
+
+ }
+\cs_new_protected:Npn \__hyp_text_string_from_unicode:nN #1 #2
+ {
+ \pdf_string_from_unicode:nVN { #1 } #2 #2
+ }
+\cs_new_protected:Npn \__hyp_text_pdfstring:nnN #1 #2 #3
+ {
+ \group_begin:
+ \Hy@pdfstringtrue
+ \hook_use:n {hyp/text/pdfstring}
+ \__hyp_text_purify:nN { #1 } \l__hyp_text_tmpa_str
+ \__hyp_text_cleanup:N \l__hyp_text_tmpa_str
+ \__hyp_text_string_from_unicode:nN { #2 } \l__hyp_text_tmpa_str
+ \str_gset_eq:NN \g__hyp_text_tmpa_str\l__hyp_text_tmpa_str
+ \group_end:
+ \str_set_eq:NN #3 \g__hyp_text_tmpa_str
+ }
+\cs_generate_variant:Nn \__hyp_text_pdfstring:nnN {xnN,onN,xoN,ooN,noN}
+\cs_new_protected:Npn\Hy@pstringdef #1 #2
+ { \__hyp_text_pdfstring:xnN {#2} {utf8/string-raw}#1 }
+\cs_new_protected:Npn \__hyp_text_pdfstring_info:nN #1 #2
+ {
+ \__hyp_text_pdfstring:noN { #1 }{ \l__hyp_text_enc_info_print_tl } #2
+ }
+\cs_new_protected:Npn\__hyp_PageLabels_gpush:
+ {
+ \pdfmanagement_add:nnx {Catalog} {PageLabels}{<</Nums[\HyPL@Labels]>>}
+ }
+
+\def\Hy@PutCatalog #1 {}
+
+\legacy_if:nT { Hy@pdfpagelabels }
+ {
+ \cs_set_protected:Npn \HyPL@StorePageLabel #1
+ {
+ \tl_gput_right:Nx \HyPL@Labels { \the\Hy@abspage<<#1>> }
+ \__hyp_PageLabels_gpush:
+ }
+ }
+\Hy@WrapperDef \__hyp_destination:nn #1 #2
+ {
+ \mode_if_horizontal:T { \@savsf\spacefactor }
+ \Hy@SaveLastskip %defined in hyperref
+ \Hy@VerboseAnchor{#1} %defined in hyperref, for debugging
+ \__hyp_text_pdfstring:xoN
+ { \HyperDestNameFilter{#1} }
+ { \l__hyp_text_enc_dest_tl }
+ \l__hyp_tmpa_tl
+ \str_if_eq:nnTF {#2} {fitrbox}
+ {
+ \exp_args:NV
+ \pdf_destination:nnnn \l__hyp_tmpa_tl
+ { \box_wd:N \l__hyp_dest_box }
+ { \box_ht:N \l__hyp_dest_box }
+ { \box_dp:N \l__hyp_dest_box }
+ }
+ {
+ \exp_args:NV
+ \pdf_destination:nf
+ { \l__hyp_tmpa_tl }
+ { #2 }
+ }
+ \Hy@RestoreLastskip %defined in hyperref
+ \mode_if_horizontal:T { \spacefactor\@savsf }
+ }
+\cs_new_protected:Npn \hyper@anchor #1
+ {
+ \exp_args:NnV
+ \__hyp_destination:nn {#1} \l__hyp_dest_pdfview_tl
+ }
+
+\cs_new_protected:Npn \hyper@anchorstart #1
+ {
+ \Hy@activeanchortrue
+ \exp_args:NnV
+ \__hyp_destination:nn {#1} \l__hyp_dest_pdfview_tl
+ }
+
+\cs_new_protected:Npn \hyper@anchorend
+ {
+ \Hy@activeanchorfalse
+ }
+\cs_new_protected:Npn \__hyp_link_goto_begin:nw #1
+ {
+ \mode_leave_vertical:
+ \protected@edef \l__hyp_dest_name_tmpa_tl { #1 }
+ \tl_if_empty:NTF \l__hyp_dest_name_tmpa_tl
+ {
+ \msg_warning:nnx
+ { hyp }
+ { empty-destination-name }
+ { \c__hyp_dest_undefined_tl }
+ \tl_set_eq:NN \l__hyp_dest_name_tmpa_tl \c__hyp_dest_undefined_tl
+ }
+ {
+ \__hyp_text_pdfstring:xoN
+ { \exp_args:No \HyperDestNameFilter { \l__hyp_dest_name_tmpa_tl } }
+ { \l__hyp_text_enc_dest_tl }
+ \l__hyp_dest_name_tmpa_tl
+ }
+ \exp_args:No
+ \pdfannot_link_goto_begin:nw { \l__hyp_dest_name_tmpa_tl }
+ }
+
+\cs_new_protected:Npn \__hyp_link_goto_end:
+ {
+ \pdfannot_link_goto_end:
+ }
+
+
+\cs_new_protected:Npn \hyper@link #1 #2 #3 %#1 context, #2=destination name, #3 content
+ {
+ \bool_if:NTF \l__hyp_annot_GoTo_bool
+ {
+ \Hy@VerboseLinkStart{#1}{#2}
+ \group_begin:
+ \hook_use:n {hyp/link/#1}
+ \__hyp_link_goto_begin:nw {#2}#3\Hy@xspace@end
+ \__hyp_link_goto_end:
+ \group_end:
+ \Hy@VerboseLinkStop
+ }{#3}
+ }
+
+\cs_new_protected:Npn \hyper@linkstart #1 #2 %#1 context, #2=destination name
+ {
+ \bool_if:NT \l__hyp_annot_GoTo_bool
+ {
+ \Hy@VerboseLinkStart{#1}{#2}% only for debug
+ \group_begin:
+ \hook_use:n {hyp/link/#1}
+ \__hyp_link_goto_begin:nw {#2}
+ }
+ }
+
+\cs_new_protected:Npn \hyper@linkend
+ {
+ \bool_if:NT \l__hyp_annot_GoTo_bool
+ {
+ \__hyp_link_goto_end:
+ \group_end:
+ \Hy@VerboseLinkStop
+ }
+ }
+\pdfdict_new:n {l_hyp/annot/A/URI}
+\pdfdict_put:nnn {l_hyp/annot/A/URI}{Type}{/Action}
+\pdfdict_put:nnn {l_hyp/annot/A/URI}{S}{/URI}
+
+\cs_new_protected:Npn \hyper@linkurl #1 #2 %#1:link text #2: URI,
+ {
+ \bool_if:NTF \l__hyp_annot_URI_bool
+ {
+ \group_begin:
+ \__hyp_text_pdfstring:xoN
+ { #2}
+ { \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
+ {
+ \str_remove_once:Nn \Hy@href@nextactionraw {/Next}
+ \pdfdict_put:nno{l_hyp/annot/A/Next}{\Hy@href@nextactionraw}
+ }
+ \cs_set_eq:NN \# \c_hash_str
+ \cs_set_eq:NN \% \c_percent_str
+ \Hy@safe@activestrue
+ \mode_leave_vertical:
+ \pdfannot_link:nxn { URI }
+ {
+ /A
+ <<
+ \pdfdict_use:n {l_hyp/annot/A/URI}
+ >>
+ }
+ {
+ #1
+ \Hy@xspace@end
+ \Hy@VerboseLinkStop %where is the start??
+ }
+ \group_end:
+ }
+ {#1}
+ }
+
+\pdfdict_new:n {l_hyp/annot/A/GoToR}
+\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__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}
+ \__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]}
+ }
+ {
+ \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_link:nxn %expansion??
+ { GoToR }
+ {
+ /A<<
+ \pdfdict_use:n {l_hyp/annot/A/GoToR}
+ >>
+ }
+ {
+ #1\Hy@xspace@end
+ \Hy@VerboseLinkStop %where is the start??
+ }
+ \group_end:
+ }
+ {#1}
+ }
+\pdfdict_new:n {l_hyp/annot/A/Launch}
+\pdfdict_put:nnn {l_hyp/annot/A/Launch}{Type}{/Action}
+\pdfdict_put:nnn {l_hyp/annot/A/Launch}{S}{/Launch}
+
+\cs_new_protected:Npn \hyper@linklaunch #1 #2 #3 % filename, link text, Parameters
+ {
+ \bool_if:NTF \l__hyp_annot_Launch_bool
+ {
+ \group_begin:
+ \__hyp_text_pdfstring:nnN
+ { #1 }
+ { \l__hyp_text_enc_file_print_tl }
+ \l__hyp_filename_tmpa_tl
+ \pdfdict_put:nno {l_hyp/annot/A/Launch}{F}{\l__hyp_filename_tmpa_tl}
+ \__hyp_text_pdfstring:noN
+ { #3 }
+ { \l__hyp_text_enc_para_print_tl }
+ \l__hyp_para_tmpa_tl
+ \bool_if:nTF
+ {
+ \str_if_eq_p:Vn \l__hyp_para_tmpa_tl {()}
+ ||
+ \pdf_version_compare_p:Nn > {1.9}
+ }
+ {
+ \pdfdict_remove:nn {l_hyp/annot/A/Launch}{Win}
+ }
+ {
+ \pdfdict_put:nnx {l_hyp/annot/A/Launch}{Win}
+ {<</P \l__hyp_para_tmpa_tl /F \l__hyp_filename_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_link:nxn
+ { Launch }
+ {
+ /A
+ <<
+ \pdfdict_use:n {l_hyp/annot/A/Launch}
+ >>
+ }
+ {
+ #2\Hy@xspace@end
+ \Hy@VerboseLinkStop %where is the start??
+ }
+ \group_end:
+ }
+ {#2}
+ }
+\use:x
+ { % filename, anchor text, linkname
+ \cs_set_protected:Npn \exp_not:N \@hyper@launch run \c_colon_str ##1 \exp_not:N \\ ##2 ##3
+ }
+ {
+ \hyper@linklaunch {#1}{#2}{#3}
+ }
+\pdfdict_new:n {l_hyp/annot/A/Named}
+\pdfdict_put:nnn {l_hyp/annot/A/Named}{Type}{/Action}
+\pdfdict_put:nnn {l_hyp/annot/A/Named}{S}{/Named}
+
+\cs_new_protected:Npn \hyper@linknamed #1 #2 %#1 action, #2 link text
+ {
+ \bool_if:NTF \l__hyp_annot_Named_bool
+ {
+ \group_begin:
+ \pdfmeta_standard_verify:nnTF {named_actions}{#1}
+ {
+ \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_link:nxn { Named }
+ {
+ /A
+ <<
+ \pdfdict_use:n { l_hyp/annot/A/Named }
+ >>
+ }
+ {
+ #2
+ \Hy@xspace@end
+ \Hy@VerboseLinkStop
+ }
+ }
+ {
+ \msg_warning:nnn { hyp } { pdfa-no-named-action }{#1}
+ #2
+ }
+ \group_end:
+ }
+ {#2}
+ }
+
+\cs_new_protected:Npn \__hyp_color_export:nnN #1 #2 #3
+ {
+ \tl_if_head_eq_charcode:nNTF {#1}[ %]
+ {
+ \__hyp_colormodel_export:wnnN #1 {#2} #3
+ }
+ {
+ \color_export:nnN {#1} {#2} #3
+ }
+ }
+
+\cs_new_protected:Npn \__hyp_colormodel_export:wnnN [#1] #2 #3 #4
+ {
+ \color_export:nnnN {#1}{#2}{#3}#4
+ }
+
+\cs_generate_variant:Nn \__hyp_color_export:nnN {xVN}
+\cs_new_protected:Npn \__hyp_color_select:n #1
+ {
+ \tl_if_head_eq_charcode:nNTF {#1}[ %]
+ {
+ \__hyp_colormodel_select_aux:wn #1
+ }
+ {
+ \color_select:n {#1}
+ }
+ }
+
+\cs_new_protected:Npn \__hyp_colormodel_select_aux:wn [#1] #2
+ {
+ \color_select:nn {#1}{#2}
+ }
+
+\cs_generate_variant:Nn \__hyp_color_select:n {e}
+\cs_new_protected:Npn \__hyp_color_set:nn #1 #2
+ {
+ \tl_if_head_eq_charcode:nNTF {#2}[ %]
+ {
+ \__hyp_colormodel_set_aux:nwn { #1 } #2
+ }
+ {
+ \color_set:nn {#1} {#2}
+ }
+ }
+
+\cs_new_protected:Npn \__hyp_colormodel_set_aux:nwn #1 [#2] #3
+ {
+ \color_set:nnn {#1}{#2}{#3}
+ }
+
+\cs_generate_variant:Nn \__hyp_color_set:nn {ne}
+\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \hook_gput_code:nnn
+ {pdfannot/link/#2/begin}
+ {hyp/color}
+ {
+ \bool_if:cT { l_hyp_annot_color#1_bool }
+ {
+ \group_begin:
+ \color_select:n { hyp/color/#1}
+ }
+ }
+ \hook_gput_code:nnn
+ {pdfannot/link/#2/end}
+ {hyp/color}
+ {
+ \bool_if:cT { l_hyp_annot_color#1_bool }
+ {
+ \group_end:
+ }
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ ,colorlinks .meta:n =
+ {
+ ,pdfborder={0~0~0}
+ ,pdfborderstyle=
+ ,colorurl =#1
+ ,colorlink =#1
+ ,colorrun =#1
+ ,colormenu =#1
+ ,colorfile =#1
+ }
+ ,colorlinks .default:n = {true}
+ }
+\seq_map_inline:Nn \c__hyp_annot_types_seq
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ ,color#1 .bool_set:c = { l_hyp_annot_color#1_bool }
+ ,#1color .code:n = { \__hyp_color_set:ne {hyp/color/#1}{##1} }
+ }
+ }
+
+\keys_define:nn { hyp / setup }
+ {
+ ,allcolors .meta:n =
+ {
+ ,urlcolor=#1
+ ,linkcolor=#1
+ ,runcolor=#1
+ ,filecolor=#1
+ ,menucolor=#1
+ }
+ ,allcolors .value_required:n = true
+ }
+\keys_define:nn { hyp / setup }
+ {
+ ,bordercolormodel .choices:nn =
+ {rgb,cmyk}
+ { \str_gset:Nn \g__hyp_bordercolormodel_str {space-sep-#1}}
+ ,bordercolormodel .initial:n ={rgb}
+ }
+\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ #1bordercolor .code:n =
+ {
+ \tl_if_empty:nTF { ##1 }
+ {
+ \pdfannot_dict_remove:nn
+ {link/#2}
+ { C }
+ }
+ {
+ \__hyp_color_export:xVN {##1}\g__hyp_bordercolormodel_str \l__hyp_tmpa_tl
+ \pdfannot_dict_put:nnx
+ {link/#2}
+ { C }
+ { [\l__hyp_tmpa_tl] }
+ }
+ }
+ }
+ }
+
+\keys_define:nn { hyp / setup }
+ {
+ ,allbordercolors .meta:n =
+ {
+ ,linkbordercolor=#1
+ ,urlbordercolor =#1
+ ,filebordercolor=#1
+ ,menubordercolor=#1
+ ,runbordercolor =#1
+ }
+ ,allbordercolors .value_required:n = true
+ }
+
+\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ #1border .code:n =
+ {
+ \tl_if_empty:nTF { ##1 }
+ {
+ \pdfannot_dict_remove:nn
+ {link/#2}
+ { Border }
+ }
+ {
+ \pdfannot_dict_put:nnn
+ {link/#2}
+ { Border }
+ { [##1] }
+ }
+ }
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ ,pdfborder .code:n =
+ {
+ \tl_if_empty:nTF { #1 }
+ {
+ \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \pdfannot_dict_remove:nn
+ {link/##2}
+ { Border }
+ }
+ }
+ {
+ \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \pdfannot_dict_put:nnn
+ {link/##2}
+ { Border }
+ { [#1] }
+ }
+ }
+ }
+ ,pdfborder .initial:n = {0~0~1},
+ }
+\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ #1borderstyle .code:n =
+ {
+ \tl_if_empty:nTF { ##1 }
+ {
+ \pdfannot_dict_remove:nn
+ {link/#2}
+ { BS }
+ }
+ {
+ \pdfannot_dict_put:nnn
+ {link/#2}
+ { BS }
+ { <<##1>> }
+ }
+ }
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ ,pdfborderstyle .code:n =
+ {
+ \tl_if_empty:nTF { #1 }
+ {
+ \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \pdfannot_dict_remove:nn
+ {link/##2}
+ { BS }
+ }
+ }
+ {
+ \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \pdfannot_dict_put:nnn
+ {link/##2}
+ { BS }
+ { <<#1>> }
+ }
+ }
+ }
+ ,pdfborderstyle .initial:n = {},
+ }
+\cs_new_protected:Npn \__hyp_ocg_init:
+ {
+ \pdf_object_new:nn { l__hyp_ocg_view_dict_obj } { dict }
+ \pdf_object_new:nn { l__hyp_ocg_print_dict_obj } { dict }
+ \pdf_object_new:nn { l__hyp_ocg_config_dict_obj } { dict }
+ \pdf_object_new:nn { l__hyp_ocg_ref_array_obj } { array }
+ \pdf_object_write:nx { l__hyp_ocg_ref_array_obj }
+ {
+ \pdf_object_ref:n { l__hyp_ocg_view_dict_obj }
+ \c_space_tl
+ \pdf_object_ref:n { l__hyp_ocg_print_dict_obj }
+ }
+ \pdf_object_write:nn { l__hyp_ocg_view_dict_obj }
+ {
+ /Type/OCG
+ /Name(View)
+ /Usage
+ <<
+ /Print <</PrintState/OFF>>~
+ /View <</ViewState/ON >>~
+ >>
+ }
+ \pdf_object_write:nn { l__hyp_ocg_print_dict_obj }
+ {
+ /Type/OCG
+ /Name(Print)
+ /Usage
+ <<
+ /Print <</PrintState/ON>>~
+ /View <</ViewState/OFF>>~
+ >>
+ }
+ \pdfmanagement_add:nnx { Catalog / OCProperties }{OCGs }{ \pdf_object_ref:n {l__hyp_ocg_view_dict_obj} }
+ \pdfmanagement_add:nnx { Catalog / OCProperties }{OCGs }{ \pdf_object_ref:n {l__hyp_ocg_print_dict_obj} }
+ \pdf_object_write:nx { l__hyp_ocg_config_dict_obj }
+ {
+ /OFF[\pdf_object_ref:n { l__hyp_ocg_print_dict_obj }]
+ /AS[
+ <<
+ /Event/View
+ /OCGs\c_space_tl \pdf_object_ref:n { l__hyp_ocg_ref_array_obj }
+ /Category[/View]
+ >>
+ <<
+ /Event/Print
+ /OCGs\c_space_tl \pdf_object_ref:n { l__hyp_ocg_ref_array_obj }
+ /Category[/Print]
+ >>
+ <<
+ /Event/Export
+ /OCGs\c_space_tl \pdf_object_ref:n { l__hyp_ocg_ref_array_obj }
+ /Category[/Print]
+ >>
+ ]
+ }
+ \pdfmanagement_add:nnx { Catalog / OCProperties }{ D }{ \pdf_object_ref:n { l__hyp_ocg_config_dict_obj} }
+ \cs_gset:Npn \__hyp_ocg_init: {}
+ }
+\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \hook_gput_code:nnn
+ {pdfannot/link/#2/begin}
+ {hyp/ocg}
+ {
+ \bool_if:cT { l_hyp_annot_ocgcolor#1_bool }
+ {
+ \__hyp_ocg_init:
+ \group_begin:
+ \hbox_set:Nw \l__hyp_tmpa_box
+ }
+ }
+ \hook_gput_code:nnn
+ {pdfannot/link/#2/end}
+ {hyp/ocg}
+ {
+ \bool_if:cT { l_hyp_annot_ocgcolor#1_bool }
+ {
+ \hbox_set_end:
+ \mbox
+ {
+ \pdf_bdcobject:nn {OC}{l__hyp_ocg_print_dict_obj}
+ \hbox_overlap_right:n { \box_use:N \l__hyp_tmpa_box }
+ \pdf_emc:
+ \pdf_bdcobject:nn {OC}{l__hyp_ocg_view_dict_obj}
+ \group_begin:
+ \color_select:n { hyp/color/#1 }
+ \box_use_drop:N \l__hyp_tmpa_box
+ \group_end:
+ \pdf_emc:
+ }
+ \group_end:
+ }
+ }
+ }
+\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: }
+ }
+ }
+ }
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ ,_ocgcolorlinks .meta:n =
+ {
+ ocgcolorlink=#1,
+ ocgcolorurl=#1,
+ ocgcolorfile=#1,
+ ocgcolorrun=#1,
+ ocgcolormenu=#1
+ }
+ ,_ocgcolorlinks .default:n = true
+ }
+ }
+
+\keys_define:nn { hyp / setup }
+ {
+ ,ocgcolorlinks .choice:
+ ,ocgcolorlinks / true .meta:n =
+ {
+ pdfborder ={0~0~0},
+ pdfborderstyle ={},
+ colorlinks = false,
+ _ocgcolorlinks = true
+ }
+ ,ocgcolorlinks / false .meta:n =
+ {
+ _ocgcolorlinks = false
+ }
+ ,ocgcolorlinks .default:n = {true}
+ }
+
+\seq_map_inline:Nn \c__hyp_annot_types_seq
+ {
+ \pdf_version_compare:NnTF < {1.5}
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ ,ocgcolor#1 .code:n=
+ {
+ \msg_warning:nnxx
+ { hyp }
+ { ignore-deprecated-or-unknown-option-in-pdf-version }
+ { ocgcolor#1 }
+ { \pdf_version_major:.\pdf_version_minor: }
+ }
+ }
+ }
+ {
+ \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
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ ,#1highlight .choices:nn =
+ { /I, /N, /O, /P}
+ {
+ \pdfannot_dict_put:nnn
+ {link/#2}
+ { H }
+ { ##1 }
+
+ }
+ ,#1highlight / .code:n =
+ {
+ \pdfannot_dict_remove:nn
+ {link/#2}
+ { H }
+
+ }
+ ,#1highlight / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfhighlight }
+ { /I~(inverse), /N~(no effect), /O~(outline), /P~(inset) }
+ { \exp_not:n {##1} }
+ }
+ }
+ }
+
+\keys_define:nn { hyp / setup }
+ {
+ ,pdfhighlight .choices:nn =
+ { /I, /N, /O, /P}
+ {
+ \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \pdfannot_dict_put:nnn
+ {link/####2}
+ { H }
+ { #1 }
+ }
+ }
+ ,pdfhighlight / .code:n =
+ {
+ \prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \pdfannot_dict_remove:nn
+ {link/##2}
+ { H }
+ }
+ }
+ ,pdfhighlight .initial:n = {/I},
+ ,pdfhighlight / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfhighlight }
+ { /I~(inverse), /N~(no effect), /O~(outline), /P~(inset) }
+ { \exp_not:n {#1} }
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ hidelinks .meta:n =
+ {
+ ,colorlinks = false
+ ,ocgcolorlinks = false
+ ,pdfborder = { 0~0~0 }
+ ,pdfborderstyle=
+ }
+ }
+
+\seq_map_inline:Nn \c__hyp_annot_types_seq
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ hide#1 .meta:n =
+ {
+ ,color#1 = false
+ ,ocgcolor#1 = false
+ ,#1border = { 0~0~0 }
+ ,#1borderstyle =
+ }
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ colorscheme .code:n =
+ {
+ \prop_map_inline:cn { c__hyp_colorscheme_#1_prop }
+ {
+ \keys_set:nn { hyp /setup }
+ {
+ ##1 = ##2
+ }
+ }
+ }
+ }
+\keys_set:nn { hyp / setup } {colorscheme=phelype}
+\keys_define:nn { hyp / setup }
+ {
+ ,unicode .code:n = {}
+ ,pdfencoding .code:n = {}
+ ,pdfversion .code:n =
+ {
+ \msg_warning:nn { hyp }{ pdfversion-disabled }
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ ,verbose .choice:
+ ,verbose / true .code:n = { \Hy@verbosetrue}
+ ,verbose / false .code:n = { \Hy@verbosefalse}
+ ,verbose .default:n = {true}
+ ,debug .meta:n = {verbose=#1}
+ ,debug .default:n = {true}
+ }
+\keys_define:nn { hyp / setup }
+ {
+ ,draft .code:n =
+ {
+ \Hy@drafttrue
+ \PassOptionsToPackage{draft}{bookmark}
+ }
+ ,final .code:n =
+ {
+ \Hy@finaltrue
+ \PassOptionsToPackage{final}{bookmark}
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ ,extension .tl_set:N = \XR@ext
+ ,extension .initial:n= pdf
+ ,hypertexnames .choice:
+ ,hypertexnames / true .code:n = { \Hy@hypertexnamestrue}
+ ,hypertexnames / false .code:n = { \Hy@hypertexnamesfalse}
+ ,hypertexnames .default:n = {true}
+ ,linkfileprefix .tl_set:N = \Hy@linkfileprefix
+ ,localanchorname .choice:
+ ,localanchorname / true .code:n = { \Hy@localanchornametrue }
+ ,localanchorname / false .code:n = { \Hy@localanchornamefalse }
+ ,localanchorname .default:n = {true}
+ ,naturalnames .choice:
+ ,naturalnames / true .code:n = { \Hy@naturalnamestrue}
+ ,naturalnames / false .code:n = { \Hy@naturalnamesfalse}
+ ,naturalnames .default:n = {true}
+ ,pageanchor .choice:
+ ,pageanchor / true .code:n = { \Hy@pageanchortrue}
+ ,pageanchor / false .code:n = { \Hy@pageanchorfalse}
+ ,pageanchor .default:n = {true}
+ ,plainpages .choice:
+ ,plainpages / true .code:n = { \Hy@plainpagestrue}
+ ,plainpages / false .code:n = { \Hy@plainpagesfalse}
+ ,plainpages .default:n = {true}
+ }
+
+\keys_define:nn { hyp / setup }
+ {
+ ,linktoc .choices:nn = { none, section, all, page }
+ {
+ \cs_set_eq:Nc \Hy@linktoc { Hy@linktoc@#1 }
+ }
+ ,linktoc / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice }
+ { linktoc }
+ { none, section, all, page }
+ { \exp_not:n {#1} }
+ }
+ ,linktocpage .choice:
+ ,linktocpage / true .meta:n = {linktoc=page}
+ ,linktocpage / false .meta:n = {linktoc=section}
+ ,linktocpage .default:n = true
+ }
+
+\prop_map_inline:Nn \c__hyp_map_hyp_annot_prop
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ ,#1 .bool_set:c = {l__hyp_annot_#2_bool}
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ ,baseurl .code:n =
+ {
+ \__hyp_text_pdfstring:ooN { #1 } {\l__hyp_text_enc_uri_print_tl} \l__hyp_tmpa_tl
+ \tl_if_empty:NTF \l__hyp_tmpa_tl
+ {
+ \pdfmanagement_remove:nn {Catalog} { URI }
+ }
+ {
+ \pdfmanagement_add:nnx {Catalog} { URI }{ <</Base \l__hyp_tmpa_tl>> }
+ }
+ }
+ %only false does something ...
+ ,bookmarks .choice:
+ ,bookmarks / false .code:n = {\RemoveFromHook {begindocument/before}[hyperref/bookmark]}
+ ,bookmarks / true .code:n = {}
+ ,bookmarks .default:n = {true}
+ ,bookmarksnumbered .choice:
+ ,bookmarksnumbered / false .code:n = { \Hy@bookmarksnumberedfalse }
+ ,bookmarksnumbered / true .code:n = { \Hy@bookmarksnumberedtrue }
+ ,bookmarksnumbered .default:n = {true}
+ ,bookmarksopen .choice:
+ ,bookmarksopen / false .code:n = { \Hy@bookmarksopenfalse }
+ ,bookmarksopen / true .code:n = { \Hy@bookmarksopentrue }
+ ,bookmarksopen .default:n = {true}
+ ,bookmarksopenlevel .tl_set:N = \@bookmarksopenlevel
+ ,bookmarkstype .tl_set:N = \Hy@bookmarkstype
+ ,pdfcenterwindow .choice:
+ ,pdfcenterwindow / false .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences }{ CenterWindow }
+ }
+ ,pdfcenterwindow / true .code:n =
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { CenterWindow }{ true }
+ }
+ ,pdfcenterwindow / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences }{ CenterWindow }
+ }
+ ,pdfcenterwindow / unknown .code:n =
+ {
+ \msg_warning:nnxx { hyp } { no-bool }
+ { pdfcenterwindow }
+ { \exp_not:n {#1} }
+ }
+ ,pdfcenterwindow .default:n = true
+ ,pdfdirection .choice:
+ ,pdfdirection / L2R .code:n =
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { Direction }{ /L2R }
+ }
+ ,pdfdirection / R2L .code:n =
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { Direction }{ /R2L }
+ }
+ ,pdfdirection / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { Direction }
+ }
+ ,pdfdirection / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfdirection }
+ { L2R , R2L }
+ { \exp_not:n {#1} }
+ }
+ ,pdfdisplaydoctitle .choice:
+ ,pdfdisplaydoctitle / false .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { DisplayDocTitle }
+ }
+ ,pdfdisplaydoctitle / true .code:n =
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { DisplayDocTitle } { true }
+ }
+ ,pdfdisplaydoctitle .default:n = true
+ ,pdfduplex .choices:nn =
+ {Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge}
+ {
+ \pdf_version_compare:NnTF > {1.6}
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences }
+ { PrintDuplex } { /#1 }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-option-in-pdf-version}
+ {pdfduplex}
+ {\pdf_version:}
+ }
+ }%
+ ,pdfduplex / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { PrintDuplex }
+ }
+ ,pdfduplex / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfduplex }
+ { Simplex, DuplexFlipShortEdge, DuplexFlipLongEdge }
+ { \exp_not:n {#1} }
+ }
+ ,pdffitwindow .choice:
+ ,pdffitwindow / false .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { FitWindow }
+ }
+ ,pdffitwindow / true .code:n =
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { FitWindow } { true }
+ }
+ ,pdffitwindow / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { FitWindow }
+ }
+ ,pdffitwindow .default:n = true
+ ,pdffitwindow / unknown .code:n =
+ {
+ \msg_warning:nnxx { hyp } { no-bool }
+ { pdffitwindow }
+ { \exp_not:n {#1} }
+ }
+ ,pdflinkmargin .code:n = { \pdfannot_link_margin:n { #1 } }
+ ,pdflinkmargin .initial:n = {1pt}
+ ,pdfmenubar .choice:
+ ,pdfmenubar / true .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { HideMenubar }
+ }
+ ,pdfmenubar / false .code:n =
+ {
+ \pdfmanagement_add:nn {Catalog / ViewerPreferences }
+ { HideMenubar } { true }
+ }
+ ,pdfmenubar / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { HideMenubar }
+ }
+ ,pdfmenubar .default:n = true
+ ,pdfmenubar / unknown .code:n =
+ {
+ \msg_warning:nnxx { hyp } { no-bool }
+ { pdfmenubar }
+ { \exp_not:n {#1} }
+ }
+ ,pdfnewwindow .choice:
+ ,pdfnewwindow / true .code:n =
+ {
+ \pdfdict_put:nnn {l_hyp/annot/A/GoToR}{/NewWindow}{true}
+ \pdfdict_put:nnn {l_hyp/annot/A/Launch}{/NewWindow}{true}
+ }
+ ,pdfnewwindow / false .code:n =
+ {
+ \pdfdict_put:nnn {l_hyp/annot/A/GoToR}{/NewWindow}{false}
+ \pdfdict_put:nnn {l_hyp/annot/A/Launch}{/NewWindow}{false}
+ }
+ ,pdfnewwindow / .code:n =
+ {
+ \pdfdict_remove:nn {l_hyp/annot/A/GoToR}{/NewWindow}
+ \pdfdict_remove:nn {l_hyp/annot/A/Launch}{/NewWindow}
+ }
+ ,pdfnonfullscreenpagemode .choices:nn =
+ { UseNone, UseOutlines, UseThumbs, FullScreen, UseOC } %pdf 1.5
+ {
+ \pdfmanagement_add:nnx {Catalog / ViewerPreferences }
+ { NonFullScreenPageMode} {/#1}
+ }
+ ,pdfnonfullscreenpagemode / UseAttachments .code:n =
+ {
+ \pdf_version_compare:NnTF < {1.6}
+ {
+ %message
+ }
+ {
+ \pdfmanagement_add:nnx {Catalog / ViewerPreferences }
+ {NonFullScreenPageMode}{/UseAttachments}
+ }
+ }
+ ,pdfnonfullscreenpagemode / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { NonFullScreenPageMode }
+ }
+ ,pdfnonfullscreenpagemode / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfnonfullscreenpagemode }
+ { UseNone, UseOutlines, UseThumbs, FullScreen, UseOC, UseAttachments (PDF 1.6) }
+ { \exp_not:n {#1} }
+ }
+ ,pdfnumcopies .code:n =
+ {
+ \pdf_version_compare:NnTF > {1.6}
+ {
+ \tl_if_empty:nTF {#1}
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { NumCopies }
+ }
+ {
+ \pdfmanagement_add:nnx {Catalog / ViewerPreferences }
+ {NumCopies}{#1}
+ }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-option-in-pdf-version}
+ {pdfnumcopies}
+ {\pdf_version:}
+ }
+ }
+ ,pdfpagelayout .choices:nn =
+ { SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, TwoPageLeft, TwoPageRight}
+ { \pdfmanagement_add:nnx {Catalog} { PageLayout }{ /#1 } }
+ ,pdfpagelayout / .code:n =
+ { \pdfmanagement_remove:nn {Catalog} { PageLayout } }
+ ,pdfpagelayout / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfpagelayout }
+ { SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, TwoPageLeft, TwoPageRight }
+ { \exp_not:n {#1} }
+ }
+ ,pdfpagemode .choices:nn =
+ { UseNone, UseOutlines, UseThumbs, FullScreen, UseOC } %pdf 1.5
+ { \pdfmanagement_add:nnx {Catalog} { PageMode }{ /#1 } }
+ ,pdfpagemode / UseAttachments .code:n =
+ {
+ \pdf_version_compare:NnTF > {1.5}
+ {
+ \pdfmanagement_add:nnx {Catalog} { PageMode }{ /UseAttachments }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-value-in-pdf-version}
+ {UseAttachments}
+ {\pdf_version:}
+ }
+ }
+ ,pdfpagemode .initial:n = { UseOutlines } %for now ...
+ ,pdfpagemode / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfpagemode }
+ { UseNone, UseOutlines, UseThumbs, FullScreen, UseOC, UseAttachments (PDF 1.6) }
+ { \exp_not:n {#1} }
+ }
+ ,pdfpagescrop .code:n =
+ {
+ \tl_if_empty:nTF %or blank?
+ {
+ \pdfmanagement_remove:nn {Pages} { CropBox }
+ }
+ {
+ \pdfmanagement_add:nnx {Pages} { CropBox } { [#1] }
+ }
+ }
+ ,pdfpicktraybypdfsize .choice:
+ ,pdfpicktraybypdfsize / true .code:n =
+ {
+ \pdf_version_compare:NnTF > {1.6}
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences }
+ { PickTrayByPDFSize } { true }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-option-in-pdf-version}
+ {pdfpicktraybypdfsize}
+ {\pdf_version:}
+ }
+ }
+ ,pdfpicktraybypdfsize / false .code:n =
+ {
+ \pdf_version_compare:NnTF > {1.6}
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences }
+ { PickTrayByPDFSize } { false }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-option-in-pdf-version}
+ {pdfpicktraybypdfsize}
+ {\pdf_version:}
+ }
+ }
+ ,pdfpicktraybypdfsize / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { PickTrayByPDFSize }
+ }
+ ,pdfpicktraybypdfsize / unknown .code:n =
+ {
+ \msg_warning:nnxx { hyp } { no-bool }
+ { picktraybypdfsize }
+ { \exp_not:n {#1} }
+ }
+ ,pdfprintarea .choices:nn =
+ { MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
+ {
+ \pdf_version_compare:NnTF < {2.0}
+ {
+ \pdfmanagement_add:nnx {Catalog / ViewerPreferences }
+ { PrintArea } { /#1 }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-option-in-pdf-version}
+ {pdfprintarea}
+ {\pdf_version:}
+ }
+ }%
+ ,pdfprintarea / .code:n =
+ { \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { PrintArea } }
+ ,pdfprintarea / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfprintarea }
+ { MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
+ { \exp_not:n {#1} }
+ }
+ ,pdfprintclip .choices:nn =
+ { MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
+ {
+ \pdf_version_compare:NnTF < {2.0}
+ {
+ \pdfmanagement_add:nnx {Catalog / ViewerPreferences }
+ { PrintClip } { /#1 }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-option-in-pdf-version}
+ {pdfprintclip}
+ {\pdf_version:}
+ }
+ }%
+ ,pdfprintclip / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { PrintClip }
+ }
+ ,pdfprintclip / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfprintclip }
+ { MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
+ { \exp_not:n {#1} }
+ }
+ ,pdfprintpagerange .code:n =
+ {
+ \pdf_version_compare:NnTF > {1.6}
+ {
+ \tl_if_empty:nTF { #1}
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences }
+ { PrintPageRange }
+ }
+ {
+ \pdfmanagement_add:nnx {Catalog / ViewerPreferences }
+ {PrintPageRange}{[#1]}
+ }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-option-in-pdf-version}
+ {pdfprintpagerange}
+ {\pdf_version:}
+ }
+ }
+ ,pdfprintscaling .choices:nn =
+ { None, AppDefault }
+ {
+ \pdf_version_compare:NnTF > {1.5}
+ {
+ \pdfmanagement_add:nnx {Catalog / ViewerPreferences }
+ { PrintScaling } { /#1 }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-option-in-pdf-version}
+ {pdfprintscaling}
+ {\pdf_version:}
+ }
+ }%
+ ,pdfprintscaling / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } {PrintScaling }
+ }
+ ,pdfprintscaling / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfprintarea }
+ { None, AppDefault }
+ { \exp_not:n {#1} }
+ }
+ ,pdfremotestartview .code:n =
+ {
+ \tl_set:Nx \l__hyp_tmpa_tl {#1~null~null~null~}
+ \exp_args:NNV
+ \regex_extract_once:NnNTF \c__hyp_dest_startview_regex \l__hyp_tmpa_tl \l__hyp_tmpa_seq
+ {
+ \tl_set:Nx \l__hyp_dest_pdfremotestartview_tl {\seq_item:Nn \l__hyp_tmpa_seq {1}}
+ }
+ {
+ \msg_warning:nnnn {hyp}{invalid-destination-value}{#1}{pdfremotestartview}
+ \tl_set:Nn \l__hyp_dest_pdfremotestartview_tl {Fit}
+ }
+ }
+ ,pdfremotestartview .initial:n = {Fit}
+ % pdfstartpage is special as it shares code with pdfstartview
+ ,pdfstartpage .code:n =
+ {
+ \tl_gset:Nx \g__hyp_dest_pdfstartpage_tl { #1 }
+ \bool_if:nTF
+ { \tl_if_empty_p:N \g__hyp_dest_pdfstartpage_tl || \tl_if_empty_p:N \g__hyp_dest_pdfstartview_tl }
+ {
+ \pdfmanagement_remove:nn {Catalog} { OpenAction }
+ }
+ {
+ \pdfmanagement_add:nnx {Catalog} { OpenAction }
+ {
+ [\pdf_pageobject_ref:n {\g__hyp_dest_pdfstartpage_tl}~/\g__hyp_dest_pdfstartview_tl]
+ }
+ }
+ }
+ ,pdfstartpage .initial:n =1
+ ,pdfstartview .code:n =
+ {
+ \tl_set:Nx \l__hyp_tmpa_tl {#1~null~null~null~}
+ \exp_args:NNV
+ \regex_extract_once:NnNTF \c__hyp_dest_startview_regex \l__hyp_tmpa_tl \l__hyp_tmpa_seq
+ {
+ \tl_gset:Nx \g__hyp_dest_pdfstartview_tl {\seq_item:Nn \l__hyp_tmpa_seq {1}}
+ }
+ {
+ \msg_warning:nnnn {hyp}{invalid-destination-value}{#1}{pdfstartview}
+ \tl_gset:Nn \g__hyp_dest_pdfstartview_tl {Fit}
+ }
+ \bool_if:nTF
+ { \tl_if_empty_p:N \g__hyp_dest_pdfstartpage_tl || \tl_if_empty_p:N \g__hyp_dest_pdfstartview_tl }
+ {
+ \pdfmanagement_remove:nn {Catalog} { OpenAction }
+ }
+ {
+ \pdfmanagement_add:nnx {Catalog} { OpenAction }
+ {
+ [\pdf_pageobject_ref:n {\g__hyp_dest_pdfstartpage_tl}~/\g__hyp_dest_pdfstartview_tl]
+ }
+ }
+ }
+ ,pdfstartview .initial:n = Fit
+ ,pdftoolbar .choice:
+ ,pdftoolbar / true .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { HideToolbar }
+ }
+ ,pdftoolbar / false .code:n =
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences }
+ { HideToolbar } { true }
+ }
+ ,pdftoolbar / true .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { HideToolbar }
+ }
+ ,pdftoolbar .default:n = true
+ ,pdftoolbar / unknown .code:n =
+ {
+ \msg_warning:nnxx { hyp } { no-bool }
+ { pdftoolbar }
+ { \exp_not:n {#1} }
+ }
+ % pdfview see below.
+ ,pdfviewarea .choices:nn =
+ { MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
+ {
+ \pdf_version_compare:NnTF < {2.0}
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences }
+ { ViewArea } { /#1 }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-option-in-pdf-version}
+ {pdfviewarea}
+ {\pdf_version:}
+ }
+ }%
+ ,pdfviewarea / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { ViewArea }
+ }
+ ,pdfviewarea / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfviewarea }
+ { MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
+ { \exp_not:n {#1} }
+ }
+ ,pdfviewclip .choices:nn =
+ { MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
+ {
+ \pdf_version_compare:NnTF < {2.0}
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences }
+ { ViewClip } { /#1 }
+ }
+ {
+ \msg_warning:nnxx
+ {hyp}
+ {ignore-deprecated-or-unknown-option-in-pdf-version}
+ {pdfviewclip}
+ {\pdf_version:}
+ }
+ }%
+ ,pdfviewclip / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { ViewClip }
+ }
+ ,pdfviewclip / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice+empty }
+ { pdfviewclip }
+ { MediaBox, CropBox, BleedBox, TrimBox, ArtBox }
+ { \exp_not:n {#1} }
+ }
+ ,pdfwindowui .choice:
+ ,pdfwindowui / true .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } { HideWindowUI }
+ }
+ ,pdfwindowui / false .code:n =
+ {
+ \pdfmanagement_add:nnn {Catalog / ViewerPreferences }
+ { HideWindowUI } { true }
+ }
+ ,pdfwindowui / .code:n =
+ {
+ \pdfmanagement_remove:nn {Catalog / ViewerPreferences } {HideWindowUI }
+ }
+ ,pdfwindowui / unknown .code:n =
+ {
+ \msg_warning:nnxx { hyp } { no-bool }
+ { pdfwindowui }
+ { \exp_not:n {#1} }
+ }
+ ,pdfwindowui .default:n = true
+ }
+\keys_define:nn { hyp / setup }
+ {
+ ,pdfview .code:n =
+ {
+ \seq_set_split:Nnn \l__hyp_tmpa_seq {~}{#1}
+ \str_case_e:nnF { \str_lowercase:f{ \seq_item:Nn \l__hyp_tmpa_seq {1} } }
+ {
+ { xyz }
+ {
+ \int_compare:nNnTF {\seq_count:N \l__hyp_tmpa_seq } > { 1 }
+ {
+ \seq_get_right:NN \l__hyp_tmpa_seq \l__hyp_tmpa_tl
+ \tl_if_eq:NnTF \l__hyp_tmpa_tl {null}
+ {
+ \tl_set:Nn \l__hyp_dest_pdfview_tl {xyz}
+ }
+ {
+ \tl_set:Nx \l__hyp_dest_pdfview_tl
+ {
+ \fp_eval:n { \l__hyp_tmpa_tl * 100 }
+ }
+ }
+ }
+ {
+ \tl_set:Nn \l__hyp_dest_pdfview_tl {xyz}
+ }
+ }
+ { fit } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fit} }
+ { fitb } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fitb} }
+ { fitbh } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fitbh}}
+ { fitbv } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fitbv}}
+ { fith } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fith} }
+ { fitv } { \tl_set:Nn \l__hyp_dest_pdfview_tl {fitv} }
+ { fitr }
+ {
+ \int_compare:nNnTF {\seq_count:N \l__hyp_tmpa_seq } = {1}
+ {
+ \tl_set:Nn \l__hyp_dest_pdfview_tl {fitr}
+ }
+ {
+ %ensure 4 values ...
+ \tl_set:Nn \l__hyp_dest_pdfview_tl {fitrbox}
+ \seq_put_right:Nn \l__hyp_tmpa_seq {0}
+ \seq_put_right:Nn \l__hyp_tmpa_seq {0}
+ \seq_put_right:Nn \l__hyp_tmpa_seq {0}
+ \hbox_set_to_wd:Nnn \l__hyp_dest_box
+ {
+ \fp_eval:n
+ {
+ round
+ (
+ abs
+ (
+ \seq_item:Nn\l__hyp_tmpa_seq{4}
+ -
+ (\seq_item:Nn\l__hyp_tmpa_seq{2})
+ ),
+ 3
+ )
+ }bp
+ }{}
+ \box_set_dp:Nn \l__hyp_dest_box
+ {
+ \fp_eval:n
+ {
+ round(0 - (\seq_item:Nn\l__hyp_tmpa_seq{3}),3)
+ }bp
+ }
+ \box_set_ht:Nn \l__hyp_dest_box
+ {
+ \seq_item:Nn\l__hyp_tmpa_seq{5}bp
+ }
+ }
+ }
+ }
+ {
+ \msg_warning:nnnn {hyp}{invalid-destination-value}{#1}{pdfview}
+ \tl_set:Nn \l__hyp_dest_pdfview_tl {fit}
+ }
+ }
+ ,pdfview .initial:n = {xyz}
+ }
+\keys_define:nn { hyp / setup }
+ {
+ ,pdflang .code:n =
+ {
+ \tl_if_empty:nTF { #1 }
+ {
+ \pdfmanagement_remove:nn {Catalog} { Lang }
+ }
+ {
+ \pdfmanagement_add:nnx {Catalog} { Lang } { (#1) }
+ }
+ \__hyp_store_metadata:nn {pdflang}{#1}
+ }
+ }
+\cs_new_protected:Npn \__hyp_setup_info_key:nn #1 #2
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ pdf#1 .code:n =
+ {
+ \tl_if_blank:nTF {##1}
+ {
+ \pdfmanagement_remove:nn {Info}{#2}
+ }
+ {
+ \__hyp_text_pdfstring_info:nN {##1}\l__hyp_tmpa_str
+ \str_if_eq:VnF\l__hyp_tmpa_str{<FEFF>}
+ {
+ \pdfmanagement_add:nnx {Info}{#2}{\l__hyp_tmpa_str}
+ }
+ }
+ \__hyp_store_metadata:nn {pdf#1}{##1}
+ }
+ }
+ \keys_define:nn { hyp / info }
+ {
+ #2 .code:n =
+ {
+ \tl_if_blank:nTF {##1}
+ {
+ \pdfmanagement_remove:nn {Info}{#2}
+ }
+ {
+ \__hyp_text_pdfstring_info:nN {##1}\l__hyp_tmpa_str
+ \str_if_eq:VnF\l__hyp_tmpa_str{<FEFF>}
+ {
+ \pdfmanagement_add:nnx {Info}{#2}{\l__hyp_tmpa_str}
+ }
+ }
+ \exp_args:Nx \__hyp_store_metadata:nn {pdf\str_lowercase:n{#1}}{##1}
+ }
+ ,unknown .code:n =
+ {
+ \__hyp_text_pdfstring_info:nN {##1}\l__hyp_tmpa_str
+ \str_if_eq:VnF\l__hyp_tmpa_str{<FEFF>}
+ {
+ \exp_args:Nno
+ \pdfmanagement_add:nnx {Info}
+ { \l_keys_key_str } {\l__hyp_tmpa_str}
+ }
+ }
+ }
+ }
+\__hyp_setup_info_key:nn {author} {Author}
+\__hyp_setup_info_key:nn {title} {Title}
+\__hyp_setup_info_key:nn {producer} {Producer}
+\__hyp_setup_info_key:nn {creator} {Creator}
+\__hyp_setup_info_key:nn {subject} {Subject}
+\__hyp_setup_info_key:nn {keywords} {Keywords}
+\cs_new_protected:Npn \__hyp_setup_info_date_key:nn #1 #2
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ pdf#1 .code:n =
+ {
+ \tl_if_blank:nTF {##1}
+ {
+ \pdfmanagement_remove:nn {Info}{#2}
+ }
+ {
+ \pdfmanagement_add:nnx {Info}{#2}{(\tl_to_str:n {##1})}
+ }
+ \__hyp_store_metadata:nn {pdf#1}{##1}
+ }
+ }
+ \keys_define:nn { hyp / info }
+ {
+ #2 .code:n =
+ {
+ \tl_if_blank:nTF {##1}
+ {
+ \pdfmanagement_remove:nn {Info}{#2}
+ }
+ {
+ \pdfmanagement_add:nnx {Info}{#2}{(\tl_to_str:n {##1})}
+ }
+ \exp_args:Nx \__hyp_store_metadata:nn {pdf\str_lowercase:n{#1}}{##1}
+ }
+ }
+ }
+
+\__hyp_setup_info_date_key:nn {creationdate} {CreationDate}
+\__hyp_setup_info_date_key:nn {moddate} {ModDate}
+\keys_define:nn { hyp / setup }
+ {
+ ,pdftrapped .code:n =
+ {
+ \exp_args:Nne
+ \keys_set:nn { hyp / setup } { _pdftrapped = \str_uppercase:n { #1 } }
+ }
+ ,_pdftrapped .choices:nn = {TRUE,FALSE,UNKNOWN}
+ {
+ \pdfmanagement_add:nnx {Info}{Trapped}
+ {/
+ \str_uppercase:f { \str_head:n { #1 } }
+ \str_lowercase:f { \str_tail:n { #1 } }
+ }
+ \__hyp_store_metadata:nx {pdftrapped}
+ {
+ \str_uppercase:f { \str_head:n { #1 } }
+ \str_lowercase:f { \str_tail:n { #1 } }
+ }
+ }
+ ,_pdftrapped / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice }
+ { pdftrapped }
+ { true~(case~insensitive), false~(case~insensitive), unknown~(case~insensitive) }
+ { \exp_not:n {#1} }
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ pdfinfo .code:n =
+ {
+ \keys_set:nn { hyp / info } { #1 }
+ }
+ }
+\keys_set:nn { hyp / setup} {pdfcreator = LaTeX~with~hyperref}
+\keys_set:nn { hyp / setup} {pdfauthor = }
+\keys_set:nn { hyp / setup} {pdftitle = }
+\keys_set:nn { hyp / setup} {pdfsubject = }
+\clist_map_inline:nn
+ {
+ ,pdfcopyright
+ ,pdftype
+ ,pdflicenseurl
+ ,pdfauthortitle
+ ,pdfcaptionwriter
+ ,pdfmetalang
+ ,pdfapart
+ ,pdfaconformance
+ ,pdfuapart
+ ,pdfxstandard
+ ,pdfsource
+ ,pdfdocumentid
+ ,pdfinstanceid
+ ,pdfversionid
+ ,pdfrendition
+ ,pdfpublication
+ ,pdfpubtype
+ ,pdfbytes
+ ,pdfnumpages
+ ,pdfissn
+ ,pdfeissn
+ ,pdfisbn
+ ,pdfbookedition
+ ,pdfpublisher
+ ,pdfvolumenum
+ ,pdfissuenum
+ ,pdfpagerange
+ ,pdfdoi
+ ,pdfurl
+ ,pdfidentifier
+ ,pdfsubtitle
+ ,pdfpubstatus
+ ,pdfcontactaddress
+ ,pdfcontactcity
+ ,pdfcontactregion
+ ,pdfcontactpostcode
+ ,pdfcontactcountry
+ ,pdfcontactphone
+ ,pdfcontactemail
+ ,pdfcontacturl
+ ,pdfdate
+ }
+ {
+ \keys_define:nn { hyp / setup }
+ {
+ #1 .code:n= { \__hyp_store_metadata:nn {#1}{##1}}
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ pdfpageduration .code:n =
+ {
+ \tl_if_blank:nTF { #1 }
+ {
+ \pdfmanagement_remove:nn {Page}{Dur}
+ }
+ {
+ \pdfmanagement_add:nnn {Page}{Dur}{#1}
+ }
+ }
+ }
+\keys_define:nn { hyp / setup }
+ {
+ pdfpagetransition .code:n =
+ {
+ \tl_if_blank:nTF {#1}
+ {
+ \pdfmanagement_remove:nn {Page}{Trans}
+ }
+ {
+ \group_begin:
+ \keys_set:nn { hyp / trans }{style=R,#1}
+ \pdf_object_unnamed_write:nx { dict }
+ {
+ \pdfdict_use:n {l__hyp_page/Trans}
+ }
+ \pdfmanagement_add:nnx {Page}{Trans}{\pdf_object_ref_last:}
+ \group_end:
+ }
+ }
+ }
+\keys_define:nn { hyp / trans }
+ {
+ ,style .choices:nn =
+ {Split,Blinds,Box,Wipe,Dissolve,Glitter,R,Fly,Push,Cover,Uncover,Fade}
+ { \pdfdict_put:nnn {l__hyp_page/Trans}{ S }{/#1} }
+ ,style / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice }
+ { trans / style }
+ { Split,Blinds,Box,Wipe,Dissolve,Glitter,R,Fly,Push,Cover,Uncover,Fade }
+ { \exp_not:n {#1} }
+ }
+ ,duration .code:n =
+ {
+ \pdfdict_put:nnn {l__hyp_page/Trans}{ D }{#1}
+ }
+ ,direction .choices:nn =
+ {H,V}
+ { \pdfdict_put:nnn {l__hyp_page/Trans}{ S }{/#1} }
+ ,direction .choices:nn =
+ {0,90,180,270,315}
+ { \pdfdict_put:nnn {l__hyp_page/Trans}{ DI }{ #1 } }
+ ,direction / None .code:n =
+ { \pdfdict_put:nnn {l__hyp_page/Trans}{ DI }{ /None } }
+ ,direction / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice }
+ { trans / direction }
+ {
+ H~(horizontal,~only~Split,~Blinds),
+ V~(vertical,~only~Split,~Blinds),
+ 0~(left~to~right,~only~Wipe,~Glitter,~Fly,~Cover,~Uncover,~Push),
+ 90~(bottom~to~top,~only~Wipe),
+ 180~(right~to~left,~only~Wipe),
+ 270~(top~to~bottom,~only~Wipe,~Glitter,~Fly,~Cover,~Uncover,~Push),
+ 315~(top~left~to~bottom,~only~Glitter),
+ None~(only~Fly)
+ }
+ { \exp_not:n {#1} }
+ }
+ ,motion .choices:nn =
+ {I,O}
+ { \pdfdict_put:nnn {l__hyp_page/Trans}{ M }{/#1} }
+ ,motion / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice }
+ { trans / motion }
+ { I~(inwards) , O~(outwards) }
+ { \exp_not:n {#1} }
+ }
+ ,scale .code:n =
+ { \pdfdict_put:nnn { l__hyp_page/Trans }{ SS }{ #1 } }
+ ,opaque .choices:nn = {true,false}
+ { \pdfdict_put:nnn { l__hyp_page/Trans }{ B } { #1} }
+ ,opaque / unknown .code:n =
+ {
+ \msg_warning:nnxxx { hyp } { unknown-choice }
+ { trans / B }
+ { true~(opaque~back,~only~Fly), false~(opaque~back,~only~Fly) }
+ { \exp_not:n {#1} }
+ }
+ % try to set unknown keys as style
+ ,unknown .code:n =
+ {
+ % warning ...
+ \exp_args:Nnx\keys_set:nn {hyp/trans}{ style=\l_keys_key_str }
+ }
+ }
+\keys_set_known:nv{hyp/setup}{opt@hyperref.sty}
+%% Form field code
+\NewDocumentCommand \MakeFieldObject { m m }
+ {
+ \pdfxform_new:nnn { #2 }{} { #1 }
+ }
+
+\prop_new:N \g__hyp_AcroForm_CoFields_prop
+\prop_new:N \g__hyp_AcroForm_Fields_prop
+
+\let\HyField@afields\ltx@empty
+\let\HyField@cofields\ltx@empty
+%% UF test for old pdftex removed
+\def\HyField@AfterAuxOpen{\Hy@AtBeginDocument}%
+
+\def\HyField@AuxAddToFields#1
+ {
+ \prop_gput:Nnn \g__hyp_AcroForm_Fields_prop {#1}{F}
+ }%
+
+\def\HyField@AuxAddToCoFields #1 #2
+ {
+ \prop_gput:Nnn \g__hyp_AcroForm_CoFields_prop {a#1}{#2}
+ }
+
+\Hy@AtBeginDocument
+ {
+ \if@filesw
+ \immediate\write\@mainaux{%
+ \string\providecommand\string\HyField@AuxAddToFields[1]{}%
+ }%
+ \immediate\write\@mainaux{%
+ \string\providecommand\string\HyField@AuxAddToCoFields[2]{}%
+ }%
+ \fi
+ \let\HyField@AfterAuxOpen\@firstofone
+ }%
+
+\def\HyField@AddToFields
+ {
+ \exp_args:Nx\HyField__hypAddToFields
+ {
+ \pdfannot_box_ref_last:
+ }
+ \ifx\Fld@calculate@code\ltx@empty
+ \else
+ \begingroup
+ \Hy@safe@activestrue
+ \edef\Hy@temp{%
+ \endgroup
+ \if@filesw
+ \write\@mainaux
+ {
+ \string\HyField@AuxAddToCoFields
+ {
+ \Fld@calculate@sortkey
+ }
+ {
+ \pdfannot_box_ref_last:
+ }
+ }
+ \fi
+ }%
+ \Hy@temp
+ \fi
+ }%
+
+\def\HyField__hypAddToFields#1{
+ \HyField@AfterAuxOpen{%
+ \if@filesw
+ \write\@mainaux{%
+ \string\HyField@AuxAddToFields{#1}%
+ }%
+ \fi
+ }%
+ }%
+
+\ExplSyntaxOff
+\ExplSyntaxOn
+\tl_new:N \l__hyp_CheckmarkYes_tl
+\tl_set:Nn \l__hyp_CheckmarkYes_tl { __hyp_xform_CheckMarkYes }
+\tl_new:N \l__hyp_CheckmarkOff_tl
+\tl_set:Nn \l__hyp_CheckmarkOff_tl { __hyp_xform_CheckMarkOff }
+
+\def\@Form[#1]
+ {
+ \@ifundefined{textcolor}{\let\textcolor\@gobble}{}
+ \kvsetkeys{Form}{#1}
+ \pdf@ifdraftmode{}
+ {
+ \Hy@FormObjects
+ \prop_map_inline:Nn \g__hyp_AcroForm_Fields_prop
+ {
+ \pdfmanagement_add:nnx { Catalog / AcroForm } { Fields }{##1}
+ %\pdfmanagement_show:n { Catalog / AcroForm }
+ }
+ \prop_if_empty:NF \g__hyp_AcroForm_CoFields_prop
+ {
+ \prop_map_inline:Nn \g__hyp_AcroForm_CoFields_prop
+ {
+ \seq_put_right:Nn \l__hyp_tmpa_seq {##1}
+ }
+ \seq_sort:Nn \l__hyp_tmpa_seq
+ {
+ \int_compare:nNnTF { \pdf@strcmp{##1}{##2} } > { 0 }
+ { \sort_return_swapped: }
+ { \sort_return_same: }
+ }
+ \seq_map_inline:Nn \l__hyp_tmpa_seq
+ {
+ \pdfmanagement_add:nnx { Catalog / AcroForm }
+ { CO }
+ {
+ \prop_item:Nn \g__hyp_AcroForm_CoFields_prop {##1}
+ }
+ }
+ }
+ \pdfmanagement_add:nnx {Catalog / AcroForm/DR/Font }
+ {ZaDb} {\pdf_object_ref:n {l__hyp_font_zapfdingbats_obj} }
+ \pdfmanagement_add:nnx {Catalog / AcroForm/DR/Font }
+ {Helv} {\pdf_object_ref:n {l__hyp_font_helvetica_obj} }
+ \pdfmanagement_add:nnx {Catalog /AcroForm}
+ {DA}{(/Helv~10~Tf~0~g)}
+ \pdfmeta_standard_verify:nTF {form_no_NeedAppearance}
+ {
+ \legacy_if:nT { HyField@NeedAppearances }
+ {
+ \pdfmanagement_add:nnn {Catalog / AcroForm }{NeedAppearances}{true}
+ }
+ }
+ {
+ \pdfmanagement_remove:nn {Catalog / AcroForm }{NeedAppearances}
+ }
+ }
+ \MakeFieldObject
+ {
+ \group_begin:
+ \fontfamily{pzd}
+ \fontencoding{U}
+ \fontseries{m}
+ \fontshape{n}
+ \selectfont
+ \char123
+ \group_end:
+ }
+ {__hyp_xform_Ding}
+ \MakeFieldObject
+ {
+ \group_begin:
+ \fontfamily{pzd}
+ \fontencoding{U}
+ \fontseries{m}
+ \fontshape{n}
+ \selectfont
+ \phantom{\char123}
+ \group_end:
+ }
+ {__hyp_xform_DingOff}
+ \MakeFieldObject
+ {
+ \group_begin:
+ \fontfamily{pzd}
+ \fontencoding{U}
+ \fontseries{m}
+ \fontshape{n}
+ \selectfont
+ \char51
+ \group_end:
+ }
+ {__hyp_xform_CheckMarkYes}
+ \MakeFieldObject
+ {
+ \group_begin:
+ \fontfamily{pzd}
+ \fontencoding{U}
+ \fontseries{m}
+ \fontshape{n}
+ \selectfont
+ \phantom{\char51} %perhaps xetex needs some small glyph ..
+ \group_end:
+ }
+ {__hyp_xform_CheckMarkOff}
+ \MakeFieldObject
+ {
+ \fbox{\textcolor{yellow}{\textsf{Submit}}} %color?
+ }
+ {__hyp_xform_Submit}
+ \MakeFieldObject
+ {
+ \fbox{\textcolor{yellow}{\textsf{SubmitP}}} %color?
+ }
+ {__hyp_xform_SubmitP}
+ }
+\ExplSyntaxOff
+\let\@endForm\ltx@empty
+\let\HyAnn@AbsPageLabel\ltx@empty
+\let\Fld@pageobjref\ltx@empty
+
+\ExplSyntaxOn
+\newcount\HyAnn@Count
+\HyAnn@Count=\ltx@zero
+\def\HyAnn@AbsPageLabel
+ {
+ \global\advance\HyAnn@Count by\ltx@one
+ %\zref@labelbyprops{HyAnn@\the\HyAnn@Count}{abspage}%
+ %\zref@labelbylist {HyAnn@\the\HyAnn@Count} {l3pdf}
+ %\zref@refused{HyAnn@\the\HyAnn@Count}%
+ \__hyp_ref_label:en {HyAnn@\the\HyAnn@Count}{abspage}
+ \__hyp_ref_check:en {HyAnn@\the\HyAnn@Count}{abspage}
+ }%
+\def\Fld@pageobjref
+ {
+ \__hyp_ref_if_exist:enT {HyAnn@\the\HyAnn@Count}{abspage}
+ {
+ /P~\pdf_pageobject_ref:n
+ {
+ \__hyp_ref_value:en{HyAnn@\the\HyAnn@Count}{abspage}
+ }
+ }
+ }
+\ExplSyntaxOff
+\ExplSyntaxOn
+%% check if the attr should be set through
+%% hooks.
+%% check if options are missing.
+\def\@TextField[#1]#2{% parameters, label
+ \def\Fld@name{#2}%
+ \let\Fld@default\ltx@empty
+ \let\Fld@value\@empty
+ \def\Fld@width{\DefaultWidthofText}%
+ \def\Fld@height{%
+ \ifFld@multiline
+ \DefaultHeightofTextMultiline
+ \else
+ \DefaultHeightofText
+ \fi
+ }%
+ \begingroup
+ \expandafter\HyField@SetKeys\expandafter{%
+ \DefaultOptionsofText,#1%
+ }%
+ \PDFForm@Name
+ \HyField@FlagsText
+ \ifFld@hidden\def\Fld@width{1sp}\fi
+ \ifx\Fld@value\@empty\def\Fld@value{\Fld@default}\fi
+ \LayoutTextField{#2}{%
+ \leavevmode
+ \HyAnn@AbsPageLabel
+ \Hy@escapeform\PDFForm@Text
+ \pdfannot_box:nnnn
+ {\Fld@width}
+ {\Fld@height}
+ {0pt} %is this correct?
+ {\PDFForm@Text}
+ \MakeTextField{\Fld@width}{\Fld@height}
+ \HyField@AddToFields
+ }%
+ \endgroup
+}
+\providecommand\@curropt{}
+\def\@ChoiceMenu[#1]#2#3{% parameters, label, choices
+ \def\Fld@name{#2}
+ \let\Fld@default\relax
+ \let\Fld@value\relax
+ \def\Fld@width{\DefaultWidthofChoiceMenu}
+ \def\Fld@height{\DefaultHeightofChoiceMenu}
+ \begingroup
+ \Fld@menulength=0 %
+ \@tempdima\z@
+ \clist_map_variable:nNn { #3 } \@curropt
+ %\@for\@curropt:=#3\do
+ {%
+ \expandafter\Fld@checkequals\@curropt==\\%
+ \Hy@StepCount\Fld@menulength
+ \settowidth{\@tempdimb}{\@currDisplay}%
+ \ifdim\@tempdimb>\@tempdima\@tempdima\@tempdimb\fi
+ }%
+ \advance\@tempdima by~15\p@
+ \begingroup
+ \HyField@SetKeys{#1}
+ \edef\x{\endgroup
+ \noexpand\expandafter
+ \noexpand\HyField@SetKeys
+ \noexpand\expandafter{%
+ \expandafter\noexpand\csname DefaultOptionsof%
+ \ifFld@radio
+ Radio%
+ \else
+ \ifFld@combo
+ \ifFld@popdown
+ PopdownBox%
+ \else
+ ComboBox%
+ \fi
+ \else
+ ListBox%
+ \fi
+ \fi
+ \endcsname
+ }%
+ }\x
+ \HyField@SetKeys{#1}%
+ \PDFForm@Name
+ \ifFld@hidden\def\Fld@width{1sp}\fi
+ \ifx\Fld@value\relax
+ \let\Fld@value\Fld@default
+ \fi
+ \LayoutChoiceField{#2}{%
+ \ifFld@radio
+ \HyField@FlagsRadioButton
+ \__hypRadio{#3}%
+ \else
+ \begingroup
+ \HyField@FlagsChoice
+ \ifdim\Fld@width<\@tempdima
+ \ifdim\@tempdima<1cm\@tempdima1cm\fi
+ \edef\Fld@width{\the\@tempdima}%
+ \fi
+ \ifFld@combo
+ \else
+ \@tempdima=\the\Fld@menulength\Fld@charsize
+ \advance\@tempdima by~\Fld@borderwidth bp %
+ \advance\@tempdima by~\Fld@borderwidth bp %
+ \edef\Fld@height{\the\@tempdima}%
+ \fi
+ \__hypListbox{#3}%
+ \endgroup
+ \fi
+ }%
+ \endgroup
+}
+\tl_new:N \l__hyp_RadioYes_tl
+\tl_set:Nn \l__hyp_RadioYes_tl { __hyp_xform_Ding }
+\def\__hypRadio#1{%
+ \Fld@listcount=0~%
+ %\show\Fld@default
+ \EdefEscapeName\Fld@default{\Fld@default}%
+ \clist_map_variable:nNn { #1 } \@curropt
+ %\@for\@curropt:=#1\do
+ {%
+ \expandafter\Fld@checkequals\@curropt==\\%
+ \EdefEscapeName\@currValue{\@currValue}%
+ \Hy@StepCount\Fld@listcount
+ \@currDisplay\space
+ \leavevmode
+ \HyAnn@AbsPageLabel
+ \Hy@escapeform\PDFForm@Radio
+ \pdfannot_box:nnnn
+ {\Fld@width}
+ {\Fld@height}
+ {0pt} %is this correct?
+ {
+ \PDFForm@Radio
+ /AP
+ <<
+ /N
+ <<
+ /\@currValue\c_space_tl \pdfxform_ref:o {__hyp_xform_Ding}
+ %/Off \c_space_tl \pdfxform_ref:n {__hyp_xform_DingOff} %hm
+ >>
+ >>
+ }
+ {\fbox{ \MakeRadioField{\Fld@width}{\Fld@height}} }
+ \int_compare:nNnT { \Fld@listcount} = { 1 }
+ { \HyField@AddToFields }
+ \c_space_tl % deliberate space between radio buttons
+ % to do: --> should be configurable
+ }%
+}
+
+\newcount\Fld@listcount
+\def\__hypListbox#1
+ {
+ \HyField@PDFChoices{#1}
+ \mode_leave_vertical:
+ \HyAnn@AbsPageLabel
+ \Hy@escapeform\PDFForm@List
+ \pdf_link_user:nnn
+ {widget} %perhaps we need more types??
+ {\PDFForm@List}
+ {\MakeChoiceField{\Fld@width}{\Fld@height}}
+ \HyField@AddToFields
+ }
+
+\def\@PushButton[#1]#2{% parameters, label
+ \def\Fld@name{#2}%
+ \group_begin:
+ \exp_args:No\HyField@SetKeys
+ {
+ \DefaultOptionsofPushButton,#1
+ }
+ \PDFForm@Name
+ \pdfmeta_standard_verify:nnTF {annot_action_A}{JavaScript}
+ {
+ \HyField@FlagsPushButton
+ \legacy_if:nT {Fld@hidden}
+ {
+ \def\Fld@width{1sp}
+ }
+ \LayoutPushButtonField
+ {
+ \mode_leave_vertical:
+ \HyAnn@AbsPageLabel
+ \Hy@escapeform\PDFForm@Push
+ \hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}}
+ \pdfannot_box:nnnn
+ {\box_wd:N\l_tmpa_box}
+ {\box_ht:N\l_tmpa_box}
+ {\box_dp:N\l_tmpa_box} %is this correct?
+ {\PDFForm@Push}
+ {\box_use:N\l_tmpa_box}
+ \HyField@AddToFields
+ }
+ }
+ {
+ \msg_error:nn { hyp }{ pdfa-no-push-button }
+ \LayoutPushButtonField
+ {
+ \mode_leave_vertical:
+ \MakeButtonField{#2}
+ }
+ }
+ \group_end:
+}
+
+\def\@Submit[#1]#2
+ {
+ \def\Fld@width {\DefaultWidthofSubmit}
+ \def\Fld@height{\DefaultHeightofSubmit}
+ \group_begin:
+ \exp_args:No\HyField@SetKeys
+ {
+ \DefaultOptionsofSubmit,#1
+ }
+ \HyField@FlagsPushButton
+ \HyField@FlagsSubmit
+ \legacy_if:nT { Fld@hidden }
+ {
+ \def\Fld@width{1sp}
+ }
+ \mode_leave_vertical:
+ \HyAnn@AbsPageLabel
+ \Hy@escapeform\PDFForm@Submit
+ \hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}}
+ \pdfannot_box:nnnn
+ {\box_wd:N\l_tmpa_box}
+ {\box_ht:N\l_tmpa_box}
+ {\box_dp:N\l_tmpa_box} %is this correct?
+ {
+ \PDFForm@Submit
+ /AP<<
+ /N~\pdfxform_ref:n {__hyp_xform_Submit}~
+ /D~\pdfxform_ref:n {__hyp_xform_SubmitP}
+ >>
+ }
+ \HyField@AddToFields
+ \box_use:N\l_tmpa_box
+
+ \group_end:
+ }
+
+\def\@Reset[#1]#2
+ {
+ \def\Fld@width {\DefaultWidthofReset}
+ \def\Fld@height{\DefaultHeightofReset}
+ \group_begin:
+ \exp_args:No\HyField@SetKeys
+ {
+ \DefaultOptionsofReset,#1
+ }
+ \mode_leave_vertical:
+ \pdfmeta_standard_verify:nnTF {annot_action_A}{ResetForm}
+ {
+ \HyField@FlagsPushButton
+ \legacy_if:nT { Fld@hidden }
+ { \def\Fld@width{1sp} }
+ \HyAnn@AbsPageLabel
+ \Hy@escapeform\PDFForm@Reset
+ \hbox_set:Nn \l_tmpa_box { \MakeButtonField {#2}}
+ \pdfannot_box:nnnn
+ {\box_wd:N\l_tmpa_box}
+ {\box_ht:N\l_tmpa_box}
+ {\box_dp:N\l_tmpa_box} %is this correct?
+ { \PDFForm@Reset }
+ \HyField@AddToFields
+ \box_use:N \l_tmpa_box
+ }
+ {
+ \msg_error:nn { hyp }{ pdfa-no-reset-button }
+ \MakeButtonField{#2}
+ }
+ \group_end:
+ }
+
+\def\@CheckBox[#1]#2
+ {% parameters, label
+ \def\Fld@name{#2}
+ \def\Fld@default{0}
+ \group_begin:
+ \def\Fld@width {\DefaultWidthofCheckBox}
+ \def\Fld@height{\DefaultHeightofCheckBox}
+ \exp_args:No\HyField@SetKeys
+ {
+ \DefaultOptionsofCheckBox,#1
+ }
+ \PDFForm@Name
+ \HyField@FlagsCheckBox
+ \legacy_if:nT { Fld@hidden }
+ {
+ \def\Fld@width{1sp}
+ }
+ \LayoutCheckField{#2}
+ {
+ \mode_leave_vertical:
+ \HyAnn@AbsPageLabel
+ \Hy@escapeform\PDFForm@Check
+ \pdfannot_box:nnnn
+ {\Fld@width}
+ {\Fld@height}
+ {0pt} %is this correct?
+ {\PDFForm@Check}
+ \HyField@AddToFields %check if this works with xelatex ...
+ }
+ \group_end:
+ }
+\ExplSyntaxOff
+
+\ExplSyntaxOn
+\def\Hy@FormObjects
+ {
+ \pdf_object_new:nn {l__hyp_encoding_pdfdoc_obj } { dict }
+ \pdf_object_new:nn {l__hyp_font_zapfdingbats_obj } { dict }
+ \pdf_object_new:nn {l__hyp_font_helvetica_obj } { dict }
+ \pdf_object_write:nx {l__hyp_encoding_pdfdoc_obj }
+ {
+ /Type/Encoding
+ /Differences[
+ 24/breve/caron/circumflex/dotaccent/hungarumlaut/ogonek
+ /ring/tilde
+ \c_space_tl
+ 39/quotesingle
+ \c_space_tl
+ 96/grave %
+ \iow_newline:
+ 128/bullet/dagger/daggerdbl/ellipsis/emdash/endash/florin
+ /fraction/guilsinglleft/guilsinglright/minus/perthousand
+ /quotedblbase/quotedblleft/quotedblright/quoteleft
+ /quoteright/quotesinglbase/trademark/fi/fl/Lslash/OE
+ /Scaron/Ydieresis/Zcaron/dotlessi/lslash/oe/scaron/zcaron
+ \iow_newline:
+ 164/currency
+ \c_space_tl
+ 166/brokenbar
+ \c_space_tl
+ 168/dieresis/copyright/ordfeminine
+ \c_space_tl
+ 172/logicalnot/.notdef/registered/macron/degree/plusminus
+ /twosuperior/threesuperior/acute/mu
+ \c_space_tl
+ 183/periodcentered/cedilla/onesuperior/ordmasculine
+ \c_space_tl
+ 188/onequarter/onehalf/threequarters
+ \iow_newline:
+ 192/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
+ /Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave
+ /Iacute/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute
+ /Ocircumflex/Otilde/Odieresis/multiply/Oslash/Ugrave
+ /Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
+ /agrave/aacute/acircumflex/atilde/adieresis/aring/ae
+ /ccedilla/egrave/eacute/ecircumflex/edieresis/igrave
+ /iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute
+ /ocircumflex/otilde/odieresis/divide/oslash/ugrave
+ /uacute/ucircumflex/udieresis/yacute/thorn/ydieresis
+ ]
+ }
+ \pdf_object_write:nn {l__hyp_font_zapfdingbats_obj }
+ {
+ /Type/Font
+ /Subtype/Type1
+ /Name/ZaDb
+ /BaseFont/ZapfDingbats
+ }
+ \pdf_object_write:nx {l__hyp_font_helvetica_obj }
+ {
+ /Type/Font
+ /Subtype/Type1
+ /Name/Helv
+ /BaseFont/Helvetica
+ /Encoding~\pdf_object_ref:n { l__hyp_encoding_pdfdoc_obj }
+ }
+ \global\let\Hy@FormObjects\relax
+ }
+\ExplSyntaxOff
+\providecommand*{\Fld@pageobjref}{}
+\ifcsname pdf@escapestring\endcsname
+ \def\Hy@escapeform#1{%
+ \ifHy@pdfescapeform
+ \let\Hy@escapestring\pdfescapestring
+ \else
+ \let\Hy@escapestring\@firstofone
+ \fi
+ }%
+ \Hy@escapeform{}%
+\else
+ \let\Hy@escapestring\@firstofone
+ \def\Hy@escapeform#1{%
+ \ifHy@pdfescapeform
+ \def\Hy@escapestring##1{%
+ \noexpand\Hy@escapestring{\noexpand##1}%
+ }%
+ \edef\Hy@temp{#1}%
+ \expandafter\Hy__hypescapeform\Hy@temp\Hy@escapestring{}\@nil
+ \def\Hy@escapestring##1{%
+ \@ifundefined{Hy@esc@\string##1}{%
+ ##1%
+ \ThisShouldNotHappen
+ }{%
+ \csname Hy@esc@\string##1\endcsname
+ }%
+ }%
+ \else
+ \let\Hy@escapestring\@firstofone
+ \fi
+ }%
+ \def\Hy__hypescapeform#1\Hy@escapestring#2#3\@nil{%
+ \ifx\\#3\\%
+ \else
+ \expandafter
+ \Hy@pstringdef\csname Hy@esc@\string#2\endcsname{#2}% probably string-hex
+ \ltx@ReturnAfterFi{%
+ \Hy__hypescapeform#3\@nil
+ }%
+ \fi
+ }%
+\fi
+\def\PDFForm@Name{%
+ \PDFForm__hypName\Fld@name
+ \ifx\Fld@altname\relax
+ \else
+ \PDFForm__hypName\Fld@altname
+ \fi
+ \ifx\Fld@mappingname\relax
+ \else
+ \PDFForm__hypName\Fld@mappingname
+ \fi
+}
+\def\PDFForm__hypName#1{%
+ \begingroup
+ \ifnum\Hy@pdfversion<5 % implementation note 117, PDF spec 1.7
+ \ifHy@unicode
+ \Hy@unicodefalse
+ \fi
+ \fi
+ \pdfstringdef\Hy@gtemp#1%
+ \endgroup
+ \let#1\Hy@gtemp
+}
+\def\Fld@X@additionalactions{%
+ \ifx\Fld@keystroke@code\@empty
+ \else
+ /K<</S/JavaScript/JS(\Hy@escapestring{\Fld@keystroke@code})>>%
+ \fi
+ \ifx\Fld@format@code\@empty
+ \else
+ /F<</S/JavaScript/JS(\Hy@escapestring{\Fld@format@code})>>%
+ \fi
+ \ifx\Fld@validate@code\@empty
+ \else
+ /V<</S/JavaScript/JS(\Hy@escapestring{\Fld@validate@code})>>%
+ \fi
+ \ifx\Fld@calculate@code\@empty
+ \else
+ /C<</S/JavaScript/JS(\Hy@escapestring{\Fld@calculate@code})>>%
+ \fi
+ \ifx\Fld@onfocus@code\@empty
+ \else
+ /Fo<</S/JavaScript/JS(\Hy@escapestring{\Fld@onfocus@code})>>%
+ \fi
+ \ifx\Fld@onblur@code\@empty
+ \else
+ /Bl<</S/JavaScript/JS(\Hy@escapestring{\Fld@onblur@code})>>%
+ \fi
+ \ifx\Fld@onmousedown@code\@empty
+ \else
+ /D<</S/JavaScript/JS(\Hy@escapestring{\Fld@onmousedown@code})>>%
+ \fi
+ \ifx\Fld@onmouseup@code\@empty
+ \else
+ /U<</S/JavaScript/JS(\Hy@escapestring{\Fld@onmouseup@code})>>%
+ \fi
+ \ifx\Fld@onenter@code\@empty
+ \else
+ /E<</S/JavaScript/JS(\Hy@escapestring{\Fld@onenter@code})>>%
+ \fi
+ \ifx\Fld@onexit@code\@empty
+ \else
+ /X<</S/JavaScript/JS(\Hy@escapestring{\Fld@onexit@code})>>%
+ \fi
+}
+\ExplSyntaxOn
+\def\Fld@additionalactions
+ {%
+ \exp_args:Ne\str_if_eq:nnF {\Fld@X@additionalactions}{}
+ {
+ \pdfmeta_standard_verify:nT {annot_widget_no_AA}
+ {/AA<<\Fld@X@additionalactions>>}
+ }
+ }
+\ExplSyntaxOff
+\def\Fld@annotnames{%
+ /T(\Fld@name)%
+ \ifx\Fld@altname\relax
+ \else
+ /TU(\Fld@altname)%
+ \fi
+ \ifx\Fld@mappingname\relax
+ \else
+ /TM(\Fld@mappingname)%
+ \fi
+}
+\ExplSyntaxOn
+\def\PDFForm@Check
+ {
+ /Subtype/Widget
+ ~\Fld@annotflags
+ ~\Fld@pageobjref
+ ~\Fld@annotnames
+ /FT/Btn
+ \Fld@flags
+ /Q~\Fld@align
+ /BS<</W~\Fld@borderwidth /S/\Fld@borderstyle>>
+ /AP
+ <<
+ /N
+ <<
+ /Yes~\pdfxform_ref:o{\l__hyp_CheckmarkYes_tl}
+ /Off~\pdfxform_ref:o{\l__hyp_CheckmarkOff_tl}
+ >>
+ >>
+ /MK<<
+ \int_compare:nNnF {\Fld@rotation}={0}
+ {
+ /R~\Fld@rotation
+ }
+ \tl_if_empty:NF\Fld@bordercolor
+ {
+ /BC[\Fld@bordercolor]
+ }
+ \tl_if_empty:NF\Fld@bcolor
+ {
+ /BG[\Fld@bcolor]
+ }
+ /CA(\Hy@escapestring{\Fld@cbsymbol})%
+ >>
+ /DA
+ (
+ /ZaDb~\strip@pt\Fld@charsize\c_space_tl Tf
+ \tl_if_empty:NF \Fld@color
+ {
+ \c_space_tl \Fld@color
+ }
+ )
+ /H/P
+ \legacy_if:nTF {Fld@checked}
+ {
+ /V/Yes /AS/Yes
+ }
+ {
+ /V/Off /AS/Off
+ }
+ \Fld@additionalactions
+}
+\ExplSyntaxOff
+\ExplSyntaxOn
+ \def\PDFForm@Push
+ {
+ /Subtype/Widget
+ ~\Fld@annotflags
+ ~\Fld@pageobjref
+ ~\Fld@annotnames
+ /FT/Btn
+ ~\Fld@flags
+ /H/P
+ /BS<</W~\Fld@borderwidth/S/\Fld@borderstyle>>
+ \bool_if:nT
+ {
+ !\int_compare_p:nNn {\Fld@rotation} = {0}
+ ||
+ \tl_if_exist_p:N \Fld@bordercolor
+ }
+ {
+ /MK
+ <<
+ \int_compare:nNnF {\Fld@rotation} = {0}
+ {
+ /R~\Fld@rotation
+ }
+ \tl_if_exist:NT \Fld@bordercolor
+ {
+ /BC[\Fld@bordercolor]
+ }
+ >>
+ }
+ /A<</S/JavaScript/JS(\Hy@escapestring{\Fld@onclick@code})>>
+ \Fld@additionalactions
+ }
+
+\ExplSyntaxOff
+\def\PDFForm@List{%
+ /Subtype/Widget%
+ \Fld@annotflags
+ \Fld@pageobjref
+ \Fld@annotnames
+ /FT/Ch%
+ \Fld@flags
+ /Q \Fld@align
+ /BS<</W \Fld@borderwidth/S/\Fld@borderstyle>>%
+ \ifcase0\ifnum\Fld@rotation=\z@ \else 1\fi
+ \ifx\Fld@bordercolor\relax\else 1\fi
+ \ifx\fld@bcolor\relax \else 1\fi
+ \space
+ \else
+ /MK<<%
+ \ifnum\Fld@rotation=\z@
+ \else
+ /R \Fld@rotation
+ \fi
+ \ifx\Fld@bordercolor\relax
+ \else
+ /BC[\Fld@bordercolor]%
+ \fi
+ \ifx\Fld@bcolor\relax
+ \else
+ /BG[\Fld@bcolor]%
+ \fi
+ >>%
+ \fi
+ /DA(/Helv \strip@pt\Fld@charsize\space Tf%
+ \ifx\Fld@color\@empty\else\space\Fld@color\fi)%
+ \Fld@choices
+ \Fld@additionalactions
+}
+\ExplSyntaxOn
+\def\PDFForm@Radio
+ {
+ /Subtype/Widget
+ ~\Fld@annotflags
+ ~\Fld@pageobjref
+ ~\Fld@annotnames
+ /FT/Btn
+ \Fld@flags
+ /H/P
+ /BS<</W~\Fld@borderwidth/S/\Fld@borderstyle>>
+ /MK<<
+ \ifnum\Fld@rotation=\z@
+ \else
+ /R~\Fld@rotation
+ \fi
+ \ifx\Fld@bordercolor\relax
+ \else
+ /BC[\Fld@bordercolor]%
+ \fi
+ \ifx\Fld@bcolor\relax
+ \else
+ /BG[\Fld@bcolor]%
+ \fi
+ /CA(\Hy@escapestring{\Fld@radiosymbol})%
+ >>
+ /DA(/ZaDb~\strip@pt\Fld@charsize\space Tf%
+ \ifx\Fld@color\@empty\else\space\Fld@color\fi)%
+ \ifx\Fld@default\@empty
+ /V/Off%
+ /DV/Off%
+ \else
+ /V/\Fld@default
+ /DV/\Fld@default
+ \fi
+ \Fld@additionalactions
+ }
+\ExplSyntaxOff
+\ExplSyntaxOn
+\def\PDFForm@Text
+ {
+ /Subtype/Widget
+ ~\Fld@annotflags
+ ~\Fld@pageobjref
+ ~\Fld@annotnames
+ /FT/Tx
+ ~\Fld@flags
+ /Q~\Fld@align
+ /BS<</W~\Fld@borderwidth\c_space_tl /S /\Fld@borderstyle>>
+ \bool_if:nT
+ {
+ !\int_compare_p:nNn {\Fld@rotation} = {0}
+ ||
+ \tl_if_exist_p:N \Fld@bordercolor
+ ||
+ \tl_if_exist_p:N \Fld@bcolor
+ }
+ {
+ /MK
+ <<
+ \int_compare:nNnF {\Fld@rotation} = {0}
+ {
+ /R~\Fld@rotation
+ }
+ \tl_if_exist:NT \Fld@bordercolor
+ {
+ /BC[\Fld@bordercolor]
+ }
+ \tl_if_exist:NT \Fld@bcolor
+ {
+ /BG[\Fld@bcolor]
+ }
+ >>
+ }
+ /DA
+ (
+ /Helv~\strip@pt\Fld@charsize\c_space_tl Tf
+ \tl_if_empty:NF {\c_space_tl\Fld@color}
+ )
+ /DV(\Hy@escapestring{\Fld@default})
+ /V(\Hy@escapestring{\Fld@value})
+ ~\Fld@additionalactions
+ \int_compare:nNnT { \Fld@maxlen}>{0}
+ {
+ /MaxLen~\Fld@maxlen
+ }
+ }
+\ExplSyntaxOff
+
+\def\PDFForm@Submit{%
+ /Subtype/Widget%
+ \Fld@annotflags
+ \Fld@pageobjref
+ \Fld@annotnames
+ /FT/Btn%
+ \Fld@flags
+ /H/P%
+ /BS<</W \Fld@borderwidth/S/\Fld@borderstyle>>%
+ \ifcase0\ifnum\Fld@rotation=\z@ \else 1\fi
+ \ifx\Fld@bordercolor\relax\else 1\fi
+ \space
+ \else
+ /MK<<%
+ \ifnum\Fld@rotation=\z@
+ \else
+ /R \Fld@rotation
+ \fi
+ \ifx\Fld@bordercolor\relax
+ \else
+ /BC[\Fld@bordercolor]%
+ \fi
+ >>%
+ \fi
+ /A<<%
+ /S/SubmitForm%
+ /F<<%
+ /FS/URL%
+ /F(\Hy@escapestring{\Form@action})%
+ >>%
+ \Fld@submitflags
+ >>%
+ \Fld@additionalactions
+}
+\ExplSyntaxOn
+ \def\PDFForm@Reset{%
+ /Subtype/Widget%
+ \Fld@annotflags
+ \Fld@pageobjref
+ \Fld@annotnames
+ /FT/Btn%
+ \Fld@flags
+ /H/P%
+ /DA(/Helv~\strip@pt\Fld@charsize\space Tf~0~0~1~rg)%
+ \ifcase0\ifnum\Fld@rotation=\z@ \else 1\fi
+ \ifx\Fld@bordercolor\relax\else 1\fi
+ \space
+ \else
+ /MK<<%
+ \ifnum\Fld@rotation=\z@
+ \else
+ /R~\Fld@rotation
+ \fi
+ \ifx\Fld@bordercolor\relax
+ \else
+ /BC[\Fld@bordercolor]%
+ \fi
+ >>%
+ \fi
+ /BS<</W \Fld@borderwidth/S/\Fld@borderstyle>>%
+ /A<</S/ResetForm>>%
+ \Fld@additionalactions
+ }%
+
+ %these patterns are used in hyperref checks.
+\str_case:VnF \c_sys_backend_str
+ {
+ { pdfmode }
+ {
+ \def\HyPat@ObjRef
+ {
+ [0-9]*[1-9][0-9]*~0~R
+ }
+ }
+ { dvipdfmx }
+ {
+ \def\HyPat@ObjRef
+ {
+ @[^~]+
+ }
+ }
+ { xdvipdfmx }
+ {
+ \def\HyPat@ObjRef
+ {
+ @[^~]+
+ }
+ }
+ }
+ { %also set in hyperref sty, so probably not needed.
+ \def\HyPat@ObjRef/{.+}
+ }
+
+\ExplSyntaxOff
+%% \RequirePackage{rerunfilecheck}[2009/12/10]
+%% removed \Hy@OutlineRerunCheck, unneeded with bookmark
+%% removed \ReadBookmarks / unneeded with bookmark.
+%% removed \Hy@OutlineName
+%% removed \check@bm@number
+%% removed \calc@bm@number
+
+\ifHy@implicit
+\else
+ \expandafter\endinput
+\fi
+\newlength\Hy@SectionHShift
+\def\Hy@SectionAnchorHref#1{%
+ \ifx\protect\@typeset@protect
+ \Hy__hypSectionAnchor{#1}%
+ \fi
+}
+\DeclareRobustCommand*{\Hy__hypSectionAnchor}[1]{%
+ \leavevmode
+ \hbox to 0pt{%
+ \kern-\Hy@SectionHShift
+ \Hy@raisedlink{%
+ \hyper@anchorstart{#1}\hyper@anchorend
+ }%
+ \hss
+ }%
+}
+\let\H@old@ssect\@ssect
+\def\@ssect#1#2#3#4#5{%
+ \Hy@MakeCurrentHrefAuto{section*}%
+ \setlength{\Hy@SectionHShift}{#1}%
+ \begingroup
+ \toks@{\H@old@ssect{#1}{#2}{#3}{#4}}%
+ \toks\tw@\expandafter{%
+ \expandafter\Hy@SectionAnchorHref\expandafter{\@currentHref}%
+ #5%
+ }%
+ \edef\x{\endgroup
+ \the\toks@{\the\toks\tw@}%
+ }\x
+}
+\let\H@old@schapter\@schapter
+\def\@schapter#1{%
+ \begingroup
+ \let\@mkboth\@gobbletwo
+ \Hy@MakeCurrentHrefAuto{\Hy@chapapp*}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ \endgroup
+ \H@old@schapter{#1}%
+}
+\ltx@IfUndefined{@chapter}{}{%
+ \let\Hy@org@chapter\@chapter
+ \def\@chapter{%
+ \def\Hy@next{%
+ \Hy@MakeCurrentHrefAuto{\Hy@chapapp*}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ }%
+ \ifnum\c@secnumdepth>\m@ne
+ \ltx@IfUndefined{if@mainmatter}%
+ \iftrue{\csname if@mainmatter\endcsname}%
+ \let\Hy@next\relax
+ \fi
+ \fi
+ \Hy@next
+ \Hy@org@chapter
+ }%
+}
+\let\H@old@part\@part
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname chapter\endcsname\relax
+ \let\Hy@secnum@part\z@
+\else
+ \let\Hy@secnum@part\m@ne
+\fi
+\def\@part{%
+ \ifnum\Hy@secnum@part>\c@secnumdepth
+ \phantomsection
+ \fi
+ \H@old@part
+}
+\let\H@old@spart\@spart
+\def\@spart#1{%
+ \Hy@MakeCurrentHrefAuto{part*}%
+ \Hy@raisedlink{%
+ \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ }%
+ \H@old@spart{#1}%
+}
+\let\H@old@sect\@sect
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \ifnum #2>\c@secnumdepth
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+ {%
+ \Hy@MakeCurrentHrefAuto{section*}%
+ \setlength{\Hy@SectionHShift}{#3}%
+ \begingroup
+ \toks@{\H@old@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]}%
+ \toks\tw@\expandafter{%
+ \expandafter\Hy@SectionAnchorHref\expandafter{\@currentHref}%
+ #8%
+ }%
+ \edef\x{\endgroup
+ \the\toks@{\the\toks\tw@}%
+ }\x
+ }{%
+ \H@old@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}%
+ }%
+}
+\expandafter\def\csname Parent-4\endcsname{}
+\expandafter\def\csname Parent-3\endcsname{}
+\expandafter\def\csname Parent-2\endcsname{}
+\expandafter\def\csname Parent-1\endcsname{}
+\expandafter\def\csname Parent0\endcsname{}
+\expandafter\def\csname Parent1\endcsname{}
+\expandafter\def\csname Parent2\endcsname{}
+\expandafter\def\csname Parent3\endcsname{}
+\expandafter\def\csname Parent4\endcsname{}
+%%
+%% End of file `hgeneric-testphase.def'.
+%%
+%%
+%% End of file `hgeneric-testphase.def'.
diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def
new file mode 100644
index 00000000000..e520fbf4475
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperref-colorschemes.def
@@ -0,0 +1,144 @@
+%%
+%% This is file `hyperref-colorschemes.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% hyperref-generic.dtx (with options: `colorscheme')
+%%
+%% Copyright (C) 2019-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:
+%%
+%% https://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.
+%%
+%% File: hyperref-generic.dtx
+
+\prop_const_from_keyval:Nn \c__hyp_colorscheme_original_prop
+ {
+ linkcolor = [rgb]{1,0,0}, %red
+ filecolor = [rgb]{0,1,1}, %cyan
+ urlcolor = [rgb]{1,0,1}, %magenta
+ menucolor = [rgb]{1, 0, 0}, %red
+ runcolor = [rgb]{0,1,1}, %cyan
+ %-------------
+ linkbordercolor = [rgb]{1, 0 ,0 },
+ filebordercolor = [rgb]{0, .5, .5},
+ urlbordercolor = [rgb]{0, 1, 1},
+ menubordercolor = [rgb]{1, 0, 0},
+ runbordercolor = [rgb]{0, .7, .7}
+ }
+
+\prop_const_from_keyval:Nn \c__hyp_colorscheme_daleif_prop
+ {
+ linkcolor = [rgb]{0,0.2,0.6},
+ filecolor = [rgb]{0.8,0,0.8},
+ urlcolor = [rgb]{0.8,0,0.8},
+ menucolor = [rgb]{0,0.2,0.6},
+ runcolor = [rgb]{0.8,0,0.8},
+ %------------- %--------
+ linkbordercolor = [rgb]{0,0.2,0.6},
+ filebordercolor = [rgb]{0.8,0,0.8},
+ urlbordercolor = [rgb]{0.8,0,0.8},
+ menubordercolor = [rgb]{0,0.2,0.6},
+ runbordercolor = [rgb]{0.8,0,0.8}
+ }
+
+\prop_const_from_keyval:Nn \c__hyp_colorscheme_julian_prop
+ { %two colors: intern/extern
+ linkcolor = [rgb]{0.79216, 0, 0.12549},
+ filecolor = [rgb]{0.01961, 0.44314, 0.6902},
+ urlcolor = [rgb]{0.01961, 0.44314, 0.6902},
+ menucolor = [rgb]{0.79216, 0, 0.12549 },
+ runcolor = [rgb]{0.01961, 0.44314, 0.6902 },
+ %------------- %--------
+ linkbordercolor = [rgb]{0.79216, 0, 0.12549},
+ filebordercolor = [rgb]{0.01961, 0.44314, 0.6902},
+ urlbordercolor = [rgb]{0.01961, 0.44314, 0.6902},
+ menubordercolor = [rgb]{0.79216, 0, 0.12549 },
+ runbordercolor = [rgb]{0.01961, 0.44314, 0.6902 }
+ }
+
+\prop_const_from_keyval:Nn \c__hyp_colorscheme_tivv_prop
+ { %all darkgray
+ linkcolor = [rgb]{0.4 ,0.4 ,0.4 },
+ filecolor = [rgb]{0.4 ,0.4 ,0.4 },
+ urlcolor = [rgb]{0.4 ,0.4 ,0.4 },
+ menucolor = [rgb]{0.4 ,0.4 ,0.4 },
+ runcolor = [rgb]{0.4 ,0.4 ,0.4 },
+ %------------- %--------
+ linkbordercolor = [rgb]{0.4 ,0.4 ,0.4 },
+ filebordercolor = [rgb]{0.4 ,0.4 ,0.4 },
+ urlbordercolor = [rgb]{0.4 ,0.4 ,0.4 },
+ menubordercolor = [rgb]{0.4 ,0.4 ,0.4 },
+ runbordercolor = [rgb]{0.4 ,0.4 ,0.4 }
+ }
+
+\prop_const_from_keyval:Nn \c__hyp_colorscheme_szabolcsA_prop
+ { %dvipsnam.def
+ linkcolor = [rgb]{0.06, 0.46, 1}, %NavyBlue
+ filecolor = [rgb]{1, 0, 0}, %Red
+ urlcolor = [rgb]{0.06, 0.46, 1}, %NavyBlue
+ menucolor = [rgb]{1, 0, 0}, %Red
+ runcolor = [rgb]{1, 0, 0}, %Red
+ %------------- %------------------
+ linkbordercolor = [rgb]{0.06, 0.46, 1}, %NavyBlue
+ filebordercolor = [rgb]{1, 0, 0}, %Red
+ urlbordercolor = [rgb]{0.06, 0.46, 1}, %NavyBlue
+ menubordercolor = [rgb]{1, 0, 0}, %Red
+ runbordercolor = [rgb]{1, 0, 0} %Red
+ }
+
+\prop_const_from_keyval:Nn \c__hyp_colorscheme_szabolcsB_prop
+ { %dvipsnam.def
+ linkcolor = [rgb]{0.72, 0, 0}, %BrickRed
+ filecolor = [rgb]{0, 1, 0}, %Green
+ urlcolor = [rgb]{0.64, 0.08, 0.98}, %Mulberry
+ menucolor = [rgb]{0.06, 0.46, 1}, %NavyBlue
+ runcolor = [rgb]{0.64, 0.08, 0.98}, %Mulberry
+ %------------- %------------------
+ linkbordercolor = [rgb]{0.72, 0, 0}, %BrickRed
+ filebordercolor = [rgb]{0, 1, 0}, %Green
+ urlbordercolor = [rgb]{0.64, 0.08, 0.98}, %Mulberry
+ menubordercolor = [rgb]{0.06, 0.46, 1}, %NavyBlue
+ runbordercolor = [rgb]{0.64, 0.08, 0.98} %Mulberry
+ }
+
+\prop_const_from_keyval:Nn \c__hyp_colorscheme_phelype_prop
+ {
+ linkcolor = [rgb]{0.50196, 0, 0.02353},
+ filecolor = [rgb]{0.07451, 0.09412, 0.46667},
+ urlcolor = [rgb]{0.54118, 0, 0.52941},
+ menucolor = [rgb]{0.44706, 0.45882, 0},
+ runcolor = [rgb]{0.07451, 0.46667, 0.46275},
+ %------------- %-------------
+ linkbordercolor = [rgb]{0.701176, 0.4, 0.414118},
+ filebordercolor = [rgb]{0.444706, 0.456472, 0.680002},
+ urlbordercolor = [rgb]{0.724708, 0.4, 0.717646},
+ menubordercolor = [rgb]{0.668236, 0.675292, 0.4},
+ runbordercolor = [rgb]{0.444706, 0.680002, 0.67765}
+ }
+
+\prop_const_from_keyval:Nn \c__hyp_colorscheme_henryford_prop
+ {
+ linkcolor = [rgb]{0,0,0},
+ filecolor = [rgb]{0,0,0},
+ urlcolor = [rgb]{0,0,0},
+ menucolor = [rgb]{0,0,0},
+ runcolor = [rgb]{0,0,0},
+ %------------- %--------
+ linkbordercolor = [rgb]{0,0,0},
+ filebordercolor = [rgb]{0,0,0},
+ urlbordercolor = [rgb]{0,0,0},
+ menubordercolor = [rgb]{0,0,0},
+ runbordercolor = [rgb]{0,0,0}
+ }
+%%
+%%
+%% End of file `hyperref-colorschemes.def'.
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
new file mode 100644
index 00000000000..e0cb3a4e1be
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/hyperxmp-patches-tmp-ltx.sty
@@ -0,0 +1,139 @@
+%% This is file `hyperxmp-patches-tmp-ltx.sty"
+% Copyright (C) 2019-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
+%
+% https://www.latex-project.org/lppl.txt
+%
+% This file is part of the "pdfmanagement 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.
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+\ProvidesExplPackage{hyperxmp-patches-tmp-ltx}
+ {2021-02-22} {0.95a}
+ {Store hyperref metadata in XMP format / temporay patches to test pdfresource management ... UF}
+
+\cs_if_exist:NT \pdfmanagement_add:nnn
+ {
+ \pdfmanagement_if_active:T
+ {
+ \renewcommand\hyxmp@embed@packet{\hyxmp@embed@packet@generic}
+ }
+ }
+
+%
+\newcommand*{\hyxmp@embed@packet@generic}
+ {%
+ \typeout{}
+ \typeout{!!~new-hyperxmp--generic~packet~command~used!!}{}
+ \typeout{}
+ \hyxmp@construct@packet
+ %or some other command to write a object:
+ \exp_args:Nnx
+ \pdf_object_unnamed_write:nn{stream}{{/Type~/Metadata~/Subtype~/XML}{\hyxmp@xml}}%
+ % reference in the Catalog:
+ \pdfmanagement_add:nnx {Catalog} {Metadata}{\pdf_object_ref_last:}
+ }
+
+% A standard should be retrieved from the document settings.
+\cs_new:Npn \__hypxmp_get_Astandard:w #1-#2#3#4\q_stop
+ {
+ \tl_if_eq:nnT{#1}{A}
+ {
+ \Hy@pdfatrue
+ \tl_set:Nn \@pdfapart{#2}
+ \tl_set:Nx \@pdfaconformance{#3}
+ }
+ }
+\cs_new_protected:Npn \__hyxmp_get_metadata:
+ {
+ \exp_last_unbraced:Ne \__hypxmp_get_Astandard:w
+ {\GetDocumentProperties{document/pdfstandard}}Z-ZZZ\q_stop
+ \clist_map_inline:nn
+ {
+ % hyperxmp keys:
+ ,pdfcopyright
+ ,pdftype
+ ,pdflicenseurl
+ ,pdfauthortitle
+ ,pdfcaptionwriter
+ ,pdfmetalang
+ %,pdfapart %document
+ %,pdfaconformance %document
+ ,pdfuapart %probably document too but later ...
+ ,pdfxstandard
+ ,pdfsource
+ ,pdfdocumentid
+ ,pdfinstanceid
+ ,pdfversionid
+ ,pdfrendition
+ ,pdfpublication
+ ,pdfpubtype
+ ,pdfbytes
+ ,pdfnumpages
+ ,pdfissn
+ ,pdfeissn
+ ,pdfisbn
+ ,pdfbookedition
+ ,pdfpublisher
+ ,pdfvolumenum
+ ,pdfissuenum
+ ,pdfpagerange
+ ,pdfdoi
+ ,pdfurl
+ ,pdfidentifier
+ ,pdfsubtitle
+ ,pdfpubstatus
+ ,pdfcontactaddress
+ ,pdfcontactcity
+ ,pdfcontactregion
+ ,pdfcontactpostcode
+ ,pdfcontactcountry
+ ,pdfcontactphone
+ ,pdfcontactemail
+ ,pdfcontacturl
+ ,pdfdate
+ %hyperref, needs probably special handling
+ ,pdftitle
+ ,pdfsubject
+ ,pdfkeywords
+ ,pdfproducer
+ }
+ {
+ \tl_if_exist:cF{@##1}{\tl_new:c{@##1}}
+ \tl_set:cx {@##1}{\GetDocumentProperties{hyperref/##1}}
+ }
+
+ % pdfauthor, this is only a work around for simple author
+ % TODO needs improvement
+ \pdfstringdef\@pdfauthor{\GetDocumentProperties{hyperref/pdfauthor}}
+ \cs_set_eq:NN\hyxmp@pdfauthor\@pdfauthor
+
+ % pdflang,
+ \tl_if_exist:cF{@pdflang}{\tl_new:c{@pdflang}}
+ \tl_set:cx {@pdflang}{\GetDocumentProperties{document/lang}}
+ }
+
+% we need to provide a few commands so that hyperxmp stops to overwrite them
+% in \AtEndPreamble
+\AddToHook{begindocument/before}[pdfmanagement/firstaid/hyperxmp]{%
+ \def\@pdfauthor{Author}\def\@pdftitle {Title}}
+
+\DeclareHookRule{begindocument/before}{pdfmanagement/firstaid/hyperxmp}{before}{hyperxmp}
+
+\AddToHook{enddocument}[pdfmanagement-firstaid]{\__hyxmp_get_metadata:}
+
+\DeclareHookRule{enddocument}{pdfmanagement-firstaid}{before}{hyperxmp}
+
+
+\endinput
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
new file mode 100644
index 00000000000..3598d8244fb
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def
@@ -0,0 +1,377 @@
+%%
+%% This is file `l3backend-testphase-dvipdfmx.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% l3backend-testphase.dtx (with options: `drivers,dvipdfmx')
+%%
+%% Copyright (C) 2019-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:
+%%
+%% https://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.
+%%
+%% File: l3backend-testphase.dtx
+\ProvidesExplFile
+ {l3backend-testphase-dvipdfmx.def}{2021-02-22}{}
+ {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx}
+\RequirePackage{l3ref-tmp}
+\cs_generate_variant:Nn \ref_label:nn {en}
+\cs_generate_variant:Nn \ref_value:nn {en}
+\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2
+ {
+ \@bsphack
+ \ref_label:nn{#1}{abspage}
+ \@esphack
+ }
+\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2
+ {
+ \ref_value:nn{#1}{#2}
+ }
+\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en}
+\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en}
+ \__kernel_backend_literal:x { dvipdfmx:config~C~ 0x0010 }
+\prop_new:N \g__pdf_tmpa_prop
+\tl_new:N \l__pdf_tmpa_tl
+\box_new:N \l__pdf_backend_tmpa_box
+\int_new:N \g__pdf_backend_resourceid_int
+\int_new:N \g__pdf_backend_name_int
+\int_new:N \g__pdf_backend_page_int
+\tl_gput_right:Nn \@kernel@after@shipout@lastpage
+ {
+ \g__kernel_pdfmanagement_end_run_code_tl
+ }
+\tl_if_exist:NTF \@kernel@after@shipout@background
+ {
+ \g@addto@macro \@kernel@before@shipout@background{\relax}
+ \g@addto@macro \@kernel@after@shipout@background
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \tl_gput_left:Nn\@kernel@after@shipout@lastpage
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+ {
+ \hook_gput_code:nnn{shipout/background}{pdf}
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \hook_gput_code:nnn {shipout/lastpage} {pdf}
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_Pages_primitive:n #1
+ {
+ \__pdf_backend:n{put~@pages~<<#1>>}
+ }
+ %the primitive
+\cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1
+ {
+ \tex_special:D{pdf:~put~@thispage~<<#1>>}
+ }
+ % the command to store default values.
+ % Uses a prop with pdflatex + dvi,
+ % sets a lua table with lualatex
+\cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2
+ {
+ \pdfdict_gput:nnn {g__pdf_Core/Page}{ #1 }{ #2 }
+ }
+ % the command to remove a default value.
+ % Uses a prop with pdflatex + dvi,
+ % changes a lua table with lualatex
+\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1
+ {
+ \pdfdict_gremove:nn {g__pdf_Core/Page}{ #1 }
+ }
+ % the command used in the document.
+ % direct call of the primitive special with dvips/dvipdfmx
+ % \latelua: fill a page related table with lualatex, merge it with the page
+ % table and push it directly
+ % write to aux and store in prop with pdflatex
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2
+ {
+ \__pdf_backend_Page_primitive:n { /#1~#2 }
+ }
+ %the code to push the values, used in shipout
+ %merges the two props and then fills the register in pdflatex
+ %merges the two tables (the one is probably still empty)
+ % and then fills (in lua) in luatex
+ %issues the values stored in the global prop with dvi
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1
+ {
+ \exp_args:Nx \__pdf_backend_Page_primitive:n
+ { \pdfdict_use:n { g__pdf_Core/Page} }
+ }
+\clist_const:Nn \c__pdf_backend_PageResources_clist
+ {
+ ExtGState,
+ ColorSpace,
+ Pattern,
+ Shading,
+ }
+\hook_gset_rule:nnnn{shipout/firstpage}{l3backend-dvipdfmx}{after}{pdf}
+\clist_map_inline:Nn \c__pdf_backend_PageResources_clist
+ {
+ \__pdf_backend_object_new:nn { Page/Resources/#1 } { dict }
+ \hook_gput_code:nnn{shipout/firstpage}{pdf}{\__pdf_backend_object_write:nn { Page/Resources/#1 } {}}
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources:n #1
+ {
+ \__pdf_backend:n {put~@resources~<<#1>>}
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3
+ {
+ % this is not used for output, but there is a test if the resource is empty
+ \exp_args:Nnx
+ \prop_gput:cnn { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/#1} }
+ { \str_convert_pdfname:n {#2} }{ #3 }
+ %objects are not filled with \pdf_object_write as this is not additive!
+ \__pdf_backend:x
+ {
+ put~\__pdf_backend_object_ref:n {Page/Resources/#1}<</#2~#3>>
+ }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush: {}
+\bool_new:N \l__pdf_backend_xform_bool
+
+ \cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name
+ {
+ \int_gincr:N \g__pdf_backend_name_int
+ \__kernel_backend_literal:x
+ {
+ pdf:code~/#1/l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC
+ }
+ \__kernel_backend_literal:x
+ {
+ pdf:put~@resources~
+ <<
+ /Properties~
+ <<
+ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl
+ \__pdf_backend_object_ref:n { #2 }
+ >>
+ >>
+ }
+ }
+ \cs_set_protected:Npn \__pdf_backend_bdcobject:n #1 % #1 eg. Span
+ {
+ \int_gincr:N \g__pdf_backend_name_int
+ \__kernel_backend_literal:x
+ {
+ pdf:code~/#1/l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC
+ }
+ \__kernel_backend_literal:x
+ {
+ pdf:put~@resources~
+ <<
+ /Properties~
+ <<
+ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl
+ \__pdf_backend_object_last:
+ >>
+ >>
+ }
+ }
+\cs_set_protected:Npn \__pdf_backend_bmc:n #1
+ {
+ \__kernel_backend_literal:n {pdf:code~/#1~BMC} %pdfbase
+ }
+
+\cs_set_protected:Npn \__pdf_backend_bdc_contobj:nn #1 #2
+ {
+ \pdf_object_unnamed_write:nn { dict }{ #2 }
+ \__pdf_backend_bdcobject:n { #1 }
+ }
+
+\cs_set_protected:Npn \__pdf_backend_bdc_contstream:nn #1 #2
+ {
+ \__kernel_backend_literal:n {pdf:code~ /#1~<<#2>>~BDC }
+ }
+
+\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2
+ {
+ \bool_if:NTF \g__pdfmanagement_active_bool
+ {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contobj:nn}
+ {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contstream:nn}
+ \__pdf_backend_bdc:nn {#1}{#2}
+ }
+\cs_set_protected:Npn \__pdf_backend_emc:
+ {
+ \__kernel_backend_literal:n {pdf:code~EMC} %pdfbase
+ }
+ % properties are handled automatically, but the other resources should be added
+ % at shipout
+\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1
+ {
+ \clist_map_inline:Nn \c__pdf_backend_PageResources_clist
+ {
+ \prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/##1} }
+ {
+ \__kernel_backend_literal:x
+ {
+ pdf:put~@resources~
+ <</##1~\__pdf_backend_object_ref:n {Page/Resources/##1}>>
+ }
+ }
+ }
+ }
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+ {
+ \pdf_object_unnamed_write:nn {dict} { /Names [#1] }
+ %n or x?
+ \__pdf_backend:x {put~@names~<</EmbeddedFiles~\pdf_object_ref_last: >>}
+ }
+
+
+\int_new:N \g__pdf_backend_EmbeddedFiles_int
+\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
+ {
+ (
+ l3ef
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
+ {0}
+ \int_use:N \g__pdf_backend_EmbeddedFiles_int
+ )
+ }
+\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
+\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1
+ %#1 object ref
+ {
+ \int_gincr:N \g__pdf_backend_EmbeddedFiles_int
+ \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop
+ { #1 }
+ { \__pdf_backend_EmbeddedFiles_name: }
+ \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq
+ { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 }
+ }
+
+ % it needs a bit testing if it really works to set the box to 0 before the special ...
+ % does it disturb viewing the xobject?
+ % what happens with the resources (bdc)? (should work as they are specials too)
+ % xetex requires that the special is in horizontal mode. This means it affects
+ % typesetting. But we can no delay the whole form code to shipout
+ % as the object reference and the size is often wanted on the current page.
+ % so we need to allocate a box - but probably they won't be thousands xform
+ % in a document so it shouldn't matter.
+ \cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4
+ % #1 name
+ % #2 attributes
+ % #3 resources
+ % #4 content, not necessarily a box!
+ {
+ \int_gincr:N \g__pdf_backend_object_int
+ \int_const:cn
+ { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ { \g__pdf_backend_object_int }
+ \box_new:c { g__pdf_backend_xform_#1_box }
+ \hbox_gset:cn { g__pdf_backend_xform_#1_box }
+ {
+ \bool_set_true:N \l__pdf_backend_xform_bool
+ #4
+ }
+ \tl_const:cx
+ { c__pdf_backend_xform_wd_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_wd:c { g__pdf_backend_xform_#1_box } }
+ \tl_const:cx
+ { c__pdf_backend_xform_ht_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_ht:c { g__pdf_backend_xform_#1_box } }
+ \tl_const:cx
+ { c__pdf_backend_xform_dp_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_dp:c { g__pdf_backend_xform_#1_box } }
+ \box_set_dp:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim }
+ \box_set_ht:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim }
+ \box_set_wd:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim }
+ \hook_gput_next_code:nn {shipout/background}
+ {
+ \mode_leave_vertical: %needed, the xform disappears without it.
+ \__pdf_backend:x
+ {
+ bxobj ~ \__pdf_backend_xform_ref:n { #1 }
+ \c_space_tl width ~ \pdfxform_wd:n { #1 }
+ \c_space_tl height ~ \pdfxform_ht:n { #1 }
+ \c_space_tl depth ~ \pdfxform_dp:n { #1 }
+ }
+ \box_use_drop:c { g__pdf_backend_xform_#1_box }
+ \__pdf_backend:x {put ~ @resources ~<<#3>> }
+ \__pdf_backend:x
+ {
+ put~ @resources ~
+ <<
+ /ExtGState~ \pdf_object_ref:n { Page/Resources/ExtGState }
+ >>
+ }
+ \__pdf_backend:x
+ {
+ put~ @resources ~
+ <<
+ /Pattern~ \pdf_object_ref:n { Page/Resources/Pattern }
+ >>
+ }
+ \__pdf_backend:x
+ {
+ put~ @resources ~
+ <<
+ /Shading~ \pdf_object_ref:n { Page/Resources/Shading }
+ >>
+ }
+ \__pdf_backend:x
+ {
+ put~ @resources ~
+ <<
+ /ColorSpace~
+ \pdf_object_ref:n { Page/Resources/ColorSpace }
+ >>
+ }
+ \exp_args:Nx
+ \__pdf_backend:x {exobj ~<<#2>>}
+ }
+ }
+
+ \cs_new:Npn \__pdf_backend_xform_ref:n #1
+ {
+ @pdf.xform \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ }
+
+ \cs_new_protected:Npn \__pdf_backend_xform_use:n #1
+ {
+ \hbox_set:Nn \l__pdf_backend_tmpa_box
+ {
+ \__pdf_backend:x
+ {
+ uxobj~ \__pdf_backend_xform_ref:n { #1 }
+ }
+ }
+ \box_set_wd:Nn \l__pdf_backend_tmpa_box { \pdfxform_wd:n { #1 } }
+ \box_set_ht:Nn \l__pdf_backend_tmpa_box { \pdfxform_ht:n { #1 } }
+ \box_set_dp:Nn \l__pdf_backend_tmpa_box { \pdfxform_dp:n { #1 } }
+ \box_use_drop:N \l__pdf_backend_tmpa_box
+ }
+%% all
+\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF }
+ {
+ \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ { \prg_return_true: }
+ { \prg_return_false:}
+ }
+\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
+ { TF , T , F , p }
+%%
+%%
+%% End of file `l3backend-testphase-dvipdfmx.def'.
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
new file mode 100644
index 00000000000..13f31d3e3cb
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def
@@ -0,0 +1,194 @@
+%%
+%% This is file `l3backend-testphase-dvips.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% l3backend-testphase.dtx (with options: `drivers,dvips')
+%%
+%% Copyright (C) 2019-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:
+%%
+%% https://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.
+%%
+%% File: l3backend-testphase.dtx
+\ProvidesExplFile
+ {l3backend-testphase-dvips.def}{2021-02-22}{}
+ {LaTeX~PDF~management~testphase~bundle~backend~support: dvips}
+\RequirePackage{l3ref-tmp}
+\cs_generate_variant:Nn \ref_label:nn {en}
+\cs_generate_variant:Nn \ref_value:nn {en}
+\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2
+ {
+ \@bsphack
+ \ref_label:nn{#1}{abspage}
+ \@esphack
+ }
+\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2
+ {
+ \ref_value:nn{#1}{#2}
+ }
+\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en}
+\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en}
+\prop_new:N \g__pdf_tmpa_prop
+\tl_new:N \l__pdf_tmpa_tl
+\box_new:N \l__pdf_backend_tmpa_box
+\int_new:N \g__pdf_backend_resourceid_int
+\int_new:N \g__pdf_backend_name_int
+\int_new:N \g__pdf_backend_page_int
+\tl_gput_right:Nn\@kernel@after@shipout@lastpage
+ {
+ \g__kernel_pdfmanagement_end_run_code_tl
+ }
+\tl_if_exist:NTF \@kernel@after@shipout@background
+ {
+ \g@addto@macro \@kernel@before@shipout@background{\relax}
+ \g@addto@macro \@kernel@after@shipout@background
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \tl_gput_left:Nn\@kernel@after@shipout@lastpage
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+ {
+ \hook_gput_code:nnn{shipout/background}{pdf}
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \hook_gput_code:nnn {shipout/lastpage} {pdf}
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+
+\cs_new_protected:Npx \__pdf_backend_Pages_primitive:n #1
+ {
+ \tex_special:D{ps:~[#1~/PAGES~pdfmark} %]
+ }
+\cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1
+ {
+ \tex_special:D{ps:~[{ThisPage}<<#1>>~/PUT~pdfmark} %]
+ }
+ % the command to store default values.
+ % Uses a prop with pdflatex + dvi,
+ % sets a lua table with lualatex
+\cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2
+ {
+ \pdfdict_gput:nnn {g__pdf_Core/Page}{ #1 }{ #2 }
+ }
+ % the command to remove a default value.
+ % Uses a prop with pdflatex + dvi,
+ % changes a lua table with lualatex
+\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1
+ {
+ \pdfdict_gremove:nn {g__pdf_Core/Page}{ #1 }
+ }
+ % the command used in the document.
+ % direct call of the primitive special with dvips/dvipdfmx
+ % \latelua: fill a page related table with lualatex, merge it with the page
+ % table and push it directly
+ % write to aux and store in prop with pdflatex
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2
+ {
+ \__pdf_backend_Page_primitive:n { /#1~#2 }
+ }
+ %the code to push the values, used in shipout
+ %merges the two props and then fills the register in pdflatex
+ %merges the two tables (the one is probably still empty)
+ %and then fills (in lua) in luatex
+ %issues the values stored in the global prop with dvi
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1
+ {
+ \exp_args:Nx \__pdf_backend_Page_primitive:n
+ { \pdfdict_use:n { g__pdf_Core/Page} }
+ }
+\clist_const:Nn \c__pdf_backend_PageResources_clist
+ {
+ ExtGState,
+ ColorSpace,
+ Pattern,
+ Shading,
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources:n #1 {}
+\cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3
+ { %only for the show command TEST!!
+ \pdfdict_gput:nnn {g__pdf_Core/Page/Resources/#1} { #2 }{ #3 }
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush: {}
+\bool_new:N \l__pdf_backend_xform_bool
+\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2 % #1 eg. Span, #2: dict_content
+ {
+ \__pdf_backend_pdfmark:x{/#1~<<#2>>~/BDC}
+ }
+\cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name
+ {
+ \__pdf_backend_pdfmark:x{/#1~\__pdf_backend_object_ref:n{#2}~/BDC}
+ }
+\cs_set_protected:Npn \__pdf_backend_bdcobject:n #1 % #1 eg. Span,
+ {
+ \__pdf_backend_pdfmark:x{/#1~\__pdf_backend_object_last:~/BDC}
+ }
+\cs_set_protected:Npn \__pdf_backend_emc:
+ {
+ \__pdf_backend_pdfmark:n{/EMC} %
+ }
+\cs_set_protected:Npn \__pdf_backend_bmc:n #1
+ {
+ \__pdf_backend_pdfmark:n{/#1~/BMC} %
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1 {}
+
+
+
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 {}
+
+\int_new:N \g__pdf_backend_EmbeddedFiles_int
+\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
+ {
+ (
+ l3ef
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
+ {0}
+ \int_use:N \g__pdf_backend_EmbeddedFiles_int
+ )
+ }
+\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
+\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1
+ {
+ \int_gincr:N \g__pdf_backend_EmbeddedFiles_int
+ \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop
+ { #1 }
+ { \__pdf_backend_EmbeddedFiles_name: }
+ \__pdf_backend_pdfmark:x
+ {
+ /Name~\__pdf_backend_EmbeddedFiles_name:~
+ /FS~#1~
+ /EMBED
+ }
+ }
+%% all
+\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF }
+ {
+ \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ { \prg_return_true: }
+ { \prg_return_false:}
+ }
+\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
+ { TF , T , F , p }
+%%
+%%
+%% End of file `l3backend-testphase-dvips.def'.
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
new file mode 100644
index 00000000000..ba25c996cab
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def
@@ -0,0 +1,152 @@
+%%
+%% This is file `l3backend-testphase-dvisvgm.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% l3backend-testphase.dtx (with options: `drivers,dvisvgm')
+%%
+%% Copyright (C) 2019-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:
+%%
+%% https://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.
+%%
+%% File: l3backend-testphase.dtx
+\ProvidesExplFile
+ {l3backend-testphase-dvisvgm.def}{2021-02-22}{}
+ {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm}
+\RequirePackage{l3ref-tmp}
+\cs_generate_variant:Nn \ref_label:nn {en}
+\cs_generate_variant:Nn \ref_value:nn {en}
+\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2
+ {
+ \@bsphack
+ \ref_label:nn{#1}{abspage}
+ \@esphack
+ }
+\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2
+ {
+ \ref_value:nn{#1}{#2}
+ }
+\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en}
+\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en}
+\prop_new:N \g__pdf_tmpa_prop
+\tl_new:N \l__pdf_tmpa_tl
+\box_new:N \l__pdf_backend_tmpa_box
+\int_new:N \g__pdf_backend_resourceid_int
+\int_new:N \g__pdf_backend_name_int
+\int_new:N \g__pdf_backend_page_int
+\tl_if_exist:NTF \@kernel@after@shipout@background
+ {
+ \g@addto@macro \@kernel@before@shipout@background{\relax}
+ \g@addto@macro \@kernel@after@shipout@background
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \tl_gput_left:Nn\@kernel@after@shipout@lastpage
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+ {
+ \hook_gput_code:nnn{shipout/background}{pdf}
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \hook_gput_code:nnn {shipout/lastpage} {pdf}
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_Pages_primitive:n #1
+ {}
+\cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1
+ {}
+ % Uses a prop with pdflatex + dvi,
+\cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2
+ {
+ \pdfdict_gput:nnn {g__pdf_Core/Page}{ #1 }{ #2 }
+ }
+ % the command to remove a default value.
+ % Uses a prop with pdflatex + dvi,
+\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1
+ {
+ \pdfdict_gremove:nn {g__pdf_Core/Page}{ #1 }
+ }
+ % the command used in the document.
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2
+ {}
+ %the code to push the values, used in shipout
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1
+ {}
+\clist_const:Nn \c__pdf_backend_PageResources_clist
+ {
+ ExtGState,
+ ColorSpace,
+ Pattern,
+ Shading,
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources:n #1 {}
+\cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3
+ { %only for the show command TEST!!
+ \pdfdict_gput:nnn {g__pdf_Core/Page/Resources/#1} { #2 }{ #3 }
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush: {}
+\bool_new:N \l__pdf_backend_xform_bool
+\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2 % #1 eg. Span, #2: dict_content
+ {}
+\cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name
+ {}
+\cs_set_protected:Npn \__pdf_backend_bdcobject:n #1 % #1 eg. Span,
+ {}
+\cs_set_protected:Npn \__pdf_backend_emc:
+ {}
+\cs_set_protected:Npn \__pdf_backend_bmc:n #1
+ {}
+\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1 {}
+
+
+
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 {}
+
+\int_new:N \g__pdf_backend_EmbeddedFiles_int
+\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
+ {
+ (
+ l3ef
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
+ {0}
+ \int_use:N \g__pdf_backend_EmbeddedFiles_int
+ )
+ }
+\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
+\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1
+ {}
+\cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4 {}
+\cs_new_protected:Npn \__pdf_backend_xform_use:n #1 {}
+\cs_new:Npn \__pdf_backend_xform_ref:n {}
+%% all
+\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF }
+ {
+ \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ { \prg_return_true: }
+ { \prg_return_false:}
+ }
+\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
+ { TF , T , F , p }
+%%
+%%
+%% End of file `l3backend-testphase-dvisvgm.def'.
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
new file mode 100644
index 00000000000..f3fb34cc91b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def
@@ -0,0 +1,388 @@
+%%
+%% This is file `l3backend-testphase-luatex.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% l3backend-testphase.dtx (with options: `drivers,luatex')
+%%
+%% Copyright (C) 2019-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:
+%%
+%% https://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.
+%%
+%% File: l3backend-testphase.dtx
+\ProvidesExplFile
+ {l3backend-testphase-luatex.def}{2021-02-22}{}
+ {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)}
+\RequirePackage{l3ref-tmp}
+\cs_generate_variant:Nn \ref_label:nn {en}
+\cs_generate_variant:Nn \ref_value:nn {en}
+\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2
+ {
+ \@bsphack
+ \ref_label:nn{#1}{abspage}
+ \@esphack
+ }
+\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2
+ {
+ \ref_value:nn{#1}{#2}
+ }
+\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en}
+\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en}
+\prop_new:N \g__pdf_tmpa_prop
+\tl_new:N \l__pdf_tmpa_tl
+\box_new:N \l__pdf_backend_tmpa_box
+\int_new:N \g__pdf_backend_resourceid_int
+\int_new:N \g__pdf_backend_name_int
+\int_new:N \g__pdf_backend_page_int
+ \directlua { require("l3backend-testphase.lua") }
+\tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage
+ {
+ \g__kernel_pdfmanagement_end_run_code_tl
+ }
+\tl_if_exist:NTF \@kernel@after@shipout@background
+ {
+ \g@addto@macro \@kernel@before@shipout@background{\relax}
+ \g@addto@macro \@kernel@after@shipout@background
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \tl_gput_left:Nn\@kernel@after@shipout@lastpage
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+ {
+ \hook_gput_code:nnn{shipout/background}{pdf}
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \hook_gput_code:nnn {shipout/lastpage} {pdf}
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+
+\sys_if_engine_luatex:T
+ {
+ \cs_new_protected:Npn \__pdf_backend_Pages_primitive:n #1
+ {
+ \tex_directlua:D
+ {
+ pdf.setpagesattributes( \__pdf_backend_luastring:n { #1 } )
+ }
+ }
+ }
+\cs_new:Npn \__pdf_backend_luastring:n #1
+ {
+ "\tex_luaescapestring:D { \tex_unexpanded:D { #1 } }"
+ }
+ %not used, only there for consistency
+\cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1
+ {
+ \tex_latelua:D
+ {
+ pdf.setpageattributes(\__pdf_backend_luastring:n { #1 })
+ }
+ }
+ % the command to store default values.
+ % Uses a prop with pdflatex + dvi,
+ % sets a lua table with lualatex
+\cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2
+ {
+ \tex_directlua:D
+ {
+ ltx.__pdf.backend_Page_gput
+ (
+ \__pdf_backend_luastring:n { #1 },
+ \__pdf_backend_luastring:n { #2 }
+ )
+ }
+ }
+ % the command to remove a default value.
+ % Uses a prop with pdflatex + dvi,
+ % changes a lua table with lualatex
+\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1
+ {
+ \tex_directlua:D
+ {
+ ltx.__pdf.backend_Page_gremove (\__pdf_backend_luastring:n { #1 })
+ }
+ }
+ % the command used in the document.
+ % direct call of the primitive special with dvips/dvipdfmx
+ % \latelua: fill a page related table with lualatex, merge it with the page
+ % table and push it directly
+ % write to aux and store in prop with pdflatex
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2
+ {
+ \tex_latelua:D
+ {
+ ltx.__pdf.backend_ThisPage_gput
+ (
+ tex.count["g_shipout_readonly_int"],
+ \__pdf_backend_luastring:n { #1 },
+ \__pdf_backend_luastring:n { #2 }
+ )
+ ltx.__pdf.backend_ThisPage_gpush (tex.count["g_shipout_readonly_int"])
+ }
+ }
+ %the code to push the values, used in shipout
+ %merges the two props and then fills the register in pdflatex
+ %merges the two tables (the one is probably still empty) and then fills (in lua) in luatex
+ %issues the values stored in the global prop with dvi
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1
+ {
+ \tex_latelua:D
+ {
+ ltx.__pdf.backend_ThisPage_gpush (tex.count["g_shipout_readonly_int"])
+ }
+ }
+
+\clist_const:Nn \c__pdf_backend_PageResources_clist
+ {
+ ExtGState,
+ ColorSpace,
+ Pattern,
+ Shading,
+ }
+ %create the backend objects:
+\clist_map_inline:Nn \c__pdf_backend_PageResources_clist
+ {
+ \__pdf_backend_object_new:nn {Page/Resources/#1} {dict}
+ \cs_if_exist:NT \tex_directlua:D
+ {
+ \tex_directlua:D
+ {
+ ltx.__pdf.object["Page/Resources/#1"]
+ =
+ "\__pdf_backend_object_ref:n{Page/Resources/#1}"
+ }
+ }
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3
+ {
+ \pdfdict_gput:nnn {g__pdf_Core/Page/Resources/#1} { #2 }{ #3 }
+ % luatex must also trigger the lua side
+ \tex_latelua:D{ltx.__pdf.Page.Resources.#1=true}
+ \tex_latelua:D
+ {
+ ltx.pdf.Page_Resources_gpush(tex.count["g_shipout_readonly_int"])
+ }
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush:
+ {
+ \clist_map_inline:Nn \c__pdf_backend_PageResources_clist
+ {
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/##1} }
+ {
+ \__pdf_backend_object_write:nx
+ { Page/Resources/##1 }
+ { \pdfdict_use:n { g__pdf_Core/Page/Resources/##1} }
+ }
+ }
+ }
+\bool_new:N \l__pdf_backend_xform_bool
+
+\cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name
+ {
+ \int_gincr:N \g__pdf_backend_name_int
+ \exp_args:Nx\__kernel_backend_literal_page:n
+ { /#1 ~ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC }
+ \bool_if:NTF \l__pdf_backend_xform_bool
+ {
+ \exp_args:Nnx\pdfdict_gput:nnn
+ { g__pdf_Core/Xform/Resources/Properties }
+ { l3pdf\int_use:N\g__pdf_backend_name_int }
+ { \__pdf_backend_object_ref:n { #2 } }
+ }
+ {
+ \exp_args:Nx \tex_latelua:D
+ {
+ ltx.pdf.Page_Resources_Properties_gput
+ (
+ tex.count["g_shipout_readonly_int"],
+ "l3pdf\int_use:N\g__pdf_backend_name_int",
+ "\__pdf_backend_object_ref:n { #2 }"
+ )
+ }
+ }
+ }
+\cs_set_protected:Npn \__pdf_backend_bdcobject:n #1% #1 eg. Span
+ {
+ \int_gincr:N \g__pdf_backend_name_int
+ \exp_args:Nx\__kernel_backend_literal_page:n
+ { /#1 ~ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC }
+ \bool_if:NTF \l__pdf_backend_xform_bool
+ {
+ \exp_args:Nnx\pdfdict_gput:nnn %no handler needed
+ { g__pdf_Core/Xform/Resources/Properties }
+ { l3pdf\int_use:N\g__pdf_backend_name_int }
+ { \__pdf_backend_object_last: }
+ }
+ {
+ \exp_args:Nx \tex_latelua:D
+ {
+ ltx.pdf.Page_Resources_Properties_gput
+ (
+ tex.count["g_shipout_readonly_int"],
+ "l3pdf\int_use:N\g__pdf_backend_name_int",
+ "\__pdf_backend_object_last:"
+ )
+ }
+ }
+ }
+\cs_set_protected:Npn \__pdf_backend_bmc:n #1
+ {
+ \__kernel_backend_literal_page:n { /#1~BMC }
+ }
+\cs_set_protected:Npn \__pdf_backend_bdc_contobj:nn #1 #2
+ {
+ \pdf_object_unnamed_write:nn { dict } { #2 }
+ \__pdf_backend_bdcobject:n { #1 }
+ }
+\cs_set_protected:Npn \__pdf_backend_bdc_contstream:nn #1 #2
+ {
+ \__kernel_backend_literal_page:n { /#1~<<#2>>~BDC }
+ }
+\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2
+ {
+ \bool_if:NTF \g__pdfmanagement_active_bool
+ {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contobj:nn}
+ {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contstream:nn}
+ \__pdf_backend_bdc:nn {#1}{#2}
+ }
+\cs_set_protected:Npn \__pdf_backend_emc:
+ {
+ \__kernel_backend_literal_page:n { EMC }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1 {}
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+ {
+ \pdf_object_unnamed_write:nn {dict} {/Names [#1] }
+ \tex_pdfextension:D~names~{/EmbeddedFiles~\pdf_object_ref_last: }
+ }
+
+
+\int_new:N \g__pdf_backend_EmbeddedFiles_int
+\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
+ {
+ (
+ l3ef
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
+ {0}
+ \int_use:N \g__pdf_backend_EmbeddedFiles_int
+ )
+ }
+\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
+\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1
+ %#1 object ref
+ {
+ \int_gincr:N \g__pdf_backend_EmbeddedFiles_int
+ \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop
+ { #1 }
+ { \__pdf_backend_EmbeddedFiles_name: }
+ \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq
+ { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4
+ {
+ \hbox_set:Nn \l__pdf_backend_tmpa_box
+ {
+ \bool_set_true:N \l__pdf_backend_xform_bool
+ \prop_gclear:c { \__kernel_pdfdict_name:n { g__pdf_Core/Xform/Resources/Properties } }
+ #4
+ }
+ \tl_const:cx
+ { c__pdf_backend_xform_wd_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_wd:N \l__pdf_backend_tmpa_box }
+ \tl_const:cx
+ { c__pdf_backend_xform_ht_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_ht:N \l__pdf_backend_tmpa_box }
+ \tl_const:cx
+ { c__pdf_backend_xform_dp_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_dp:N \l__pdf_backend_tmpa_box }
+ %% do we need to test if #2 and #3 are empty??
+ \tex_immediate:D \tex_pdfxform:D
+ ~ attr ~ { #2 }
+ %% which resources should be default? Is an argument actually needed?
+ ~ resources ~
+ {
+ #3
+ \int_compare:nNnT
+ {\prop_count:c { \__kernel_pdfdict_name:n { g__pdf_Core/Xform/Resources/Properties } }}
+ >
+ { 0 }
+ {
+ /Properties~
+ <<
+ \pdfdict_use:n { g__pdf_Core/Xform/Resources/Properties }
+ >>
+ }
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/ExtGState } }
+ {
+ /ExtGState~ \pdf_object_ref:n { Page/Resources/ExtGState }
+ }
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/Pattern } }
+ {
+ /Pattern~ \pdf_object_ref:n { Page/Resources/Pattern }
+ }
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/Shading } }
+ {
+ /Shading~ \pdf_object_ref:n { Page/Resources/Shading }
+ }
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/ColorSpace } }
+ {
+ /ColorSpace~ \pdf_object_ref:n { Page/Resources/ColorSpace }
+ }
+ }
+ \l__pdf_backend_tmpa_box
+ \int_const:cn
+ { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ { \tex_pdflastxform:D }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_xform_use:n #1 %protected as with xelatex
+ {
+ \tex_pdfrefxform:D \int_use:c
+ {
+ c__pdf_backend_xform_ \tl_to_str:n {#1} _int
+ }
+ \scan_stop:
+ }
+
+\cs_new:Npn \__pdf_backend_xform_ref:n #1
+ { \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } ~ 0 ~ R }
+
+%% all
+\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF }
+ {
+ \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ { \prg_return_true: }
+ { \prg_return_false:}
+ }
+\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
+ { TF , T , F , p }
+%%
+%%
+%% End of file `l3backend-testphase-luatex.def'.
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
new file mode 100644
index 00000000000..40ce682e041
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def
@@ -0,0 +1,406 @@
+%%
+%% This is file `l3backend-testphase-pdftex.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% l3backend-testphase.dtx (with options: `drivers,pdftex')
+%%
+%% Copyright (C) 2019-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:
+%%
+%% https://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.
+%%
+%% File: l3backend-testphase.dtx
+\ProvidesExplFile
+ {l3backend-testphase-pdftex.def}{2021-02-22}{}
+ {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)}
+\RequirePackage{l3ref-tmp}
+\cs_generate_variant:Nn \ref_label:nn {en}
+\cs_generate_variant:Nn \ref_value:nn {en}
+\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2
+ {
+ \@bsphack
+ \ref_label:nn{#1}{abspage}
+ \@esphack
+ }
+\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2
+ {
+ \ref_value:nn{#1}{#2}
+ }
+\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en}
+\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en}
+\prop_new:N \g__pdf_tmpa_prop
+\tl_new:N \l__pdf_tmpa_tl
+\box_new:N \l__pdf_backend_tmpa_box
+\int_new:N \g__pdf_backend_resourceid_int
+\int_new:N \g__pdf_backend_name_int
+\int_new:N \g__pdf_backend_page_int
+\tl_gput_right:Nn \@kernel@after@enddocument@afterlastpage
+ {
+ \g__kernel_pdfmanagement_end_run_code_tl
+ }
+\tl_if_exist:NTF \@kernel@after@shipout@background
+ {
+ \g@addto@macro \@kernel@before@shipout@background{\relax}
+ \g@addto@macro \@kernel@after@shipout@background
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \tl_gput_left:Nn\@kernel@after@shipout@lastpage
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+ {
+ \hook_gput_code:nnn{shipout/background}{pdf}
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \hook_gput_code:nnn {shipout/lastpage} {pdf}
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_Pages_primitive:n #1
+ {
+ \tex_global:D \tex_pdfpagesattr:D { #1 }
+ }
+ %the primitive
+ \cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1
+ {
+ \tex_global:D \tex_pdfpageattr:D { #1 }
+ }
+ \cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2 %key,value
+ {
+ \pdfdict_gput:nnn {g__pdf_Core/Page}{ #1 }{ #2 }
+ }
+\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1
+ {
+ \pdfdict_gremove:nn {g__pdf_Core/Page}{ #1 }
+ }
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2
+ {
+ %we need to know the page the resource should be added too.
+ \int_gincr:N\g__pdf_backend_resourceid_int
+ %\zref@labelbylist {l3pdf\int_use:N\g__pdf_backend_resourceid_int} {l3pdf}
+ %\ref_label:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage}
+ \__pdf_backend_ref_label:en { l3pdf\int_use:N\g__pdf_backend_resourceid_int }{abspage}
+ \tl_set:Nx \l__pdf_tmpa_tl
+ {
+ %\zref@extractdefault
+ \__pdf_backend_ref_value:en {l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage}
+ }
+ \pdfdict_if_exist:nF { g__pdf_Core/backend_Page\l__pdf_tmpa_tl}
+ {
+ \pdfdict_new:n { g__pdf_Core/backend_Page\l__pdf_tmpa_tl}
+ }
+ %backend_Page has no handler.
+ \pdfdict_gput:nnn {g__pdf_Core/backend_Page\l__pdf_tmpa_tl}{ #1 }{ #2 }
+ }
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1
+ {
+ \prop_gset_eq:Nc \g__pdf_tmpa_prop { \__kernel_pdfdict_name:n { g__pdf_Core/Page } }
+ \prop_if_exist:cT { \__kernel_pdfdict_name:n { g__pdf_Core/backend_Page#1 } }
+ {
+ \prop_map_inline:cn { \__kernel_pdfdict_name:n { g__pdf_Core/backend_Page#1 } }
+ {
+ \prop_gput:Nnn \g__pdf_tmpa_prop { ##1 }{ ##2 }
+ }
+ }
+ \exp_args:Nx \__pdf_backend_Page_primitive:n
+ {
+ \prop_map_function:NN \g__pdf_tmpa_prop \pdfdict_item:ne
+ }
+ }
+\clist_const:Nn \c__pdf_backend_PageResources_clist
+ {
+ ExtGState,
+ ColorSpace,
+ Pattern,
+ Shading,
+ }
+ %create the backend objects:
+\clist_map_inline:Nn \c__pdf_backend_PageResources_clist
+ {
+ \__pdf_backend_object_new:nn {Page/Resources/#1} {dict}
+ \cs_if_exist:NT \tex_directlua:D
+ {
+ \tex_directlua:D
+ {
+ ltx.__pdf.object["Page/Resources/#1"]
+ =
+ "\__pdf_backend_object_ref:n{Page/Resources/#1}"
+ }
+ }
+ }
+ \cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3
+ {
+ \pdfdict_gput:nnn {g__pdf_Core/Page/Resources/#1} { #2 }{ #3 }
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush:
+ {
+ \clist_map_inline:Nn \c__pdf_backend_PageResources_clist
+ {
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/##1} }
+ {
+ \__pdf_backend_object_write:nx
+ { Page/Resources/##1 }
+ { \pdfdict_use:n { g__pdf_Core/Page/Resources/##1} }
+ }
+ }
+ }
+\bool_new:N \l__pdf_backend_xform_bool
+
+\cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name
+ {
+ \int_gincr:N \g__pdf_backend_name_int
+ \exp_args:Nx\__kernel_backend_literal_page:n
+ { /#1 ~ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC }
+ % code to set the property ....
+ \int_gincr:N\g__pdf_backend_resourceid_int
+ \bool_if:NTF \l__pdf_backend_xform_bool
+ {
+ \exp_args:Nnxx\pdfdict_gput:nnn %no handler needed
+ { g__pdf_Core/Xform/Resources/Properties }
+ { l3pdf\int_use:N\g__pdf_backend_resourceid_int }
+ { \__pdf_backend_object_ref:n { #2 } }
+ }
+ {
+ %\zref@labelbylist
+ \__pdf_backend_ref_label:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage}
+ \tl_set:Nx \l__pdf_tmpa_tl
+ {
+ %\zref@extractdefault
+ %\ref_value:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage}
+ \__pdf_backend_ref_value:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage}
+ }
+ \pdfdict_if_exist:nF { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties }
+ {
+ \pdfdict_new:n { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties }
+ }
+ \exp_args:Nnxx\pdfdict_gput:nnn
+ { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties }
+ { l3pdf\int_use:N\g__pdf_backend_resourceid_int }
+ { \__pdf_backend_object_ref:n{#2} }
+ }
+ }
+\cs_set_protected:Npn \__pdf_backend_bdcobject:n #1% #1 eg. Span
+ {
+ \int_gincr:N \g__pdf_backend_name_int
+ \exp_args:Nx\__kernel_backend_literal_page:n
+ { /#1 ~ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC }
+ % code to set the property ....
+ \int_gincr:N\g__pdf_backend_resourceid_int
+ \bool_if:NTF \l__pdf_backend_xform_bool
+ {
+ \exp_args:Nnxx\pdfdict_gput:nnn
+ { g__pdf_Core/Xform/Resources/Properties }
+ { l3pdf\int_use:N\g__pdf_backend_resourceid_int }
+ { \__pdf_backend_object_last: }
+ }
+ {
+ %\zref@labelbylist
+ %\ref_label:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage}
+ \__pdf_backend_ref_label:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage}
+ \tl_set:Nx \l__pdf_tmpa_tl
+ {
+ %\zref@extractdefault
+ % \ref_value:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage}
+ \__pdf_backend_ref_value:en{l3pdf\int_use:N\g__pdf_backend_resourceid_int}{abspage}
+ }
+ \pdfdict_if_exist:nF { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties }
+ {
+ \pdfdict_new:n { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties }
+ }
+ \exp_args:Nnxx\pdfdict_gput:nnn
+ { g__pdf_Core/backend_Page\l__pdf_tmpa_tl/Resources/Properties }
+ { l3pdf\int_use:N\g__pdf_backend_resourceid_int }
+ { \__pdf_backend_object_last: }
+ %\pdfdict_show:n { g_backend_Page\l__pdf_tmpa_tl/Resources/Properties }
+ }
+ }
+\cs_set_protected:Npn \__pdf_backend_bmc:n #1
+ {
+ \__kernel_backend_literal_page:n { /#1~BMC }
+ }
+\cs_set_protected:Npn \__pdf_backend_bdc_contobj:nn #1 #2
+ {
+ \pdf_object_unnamed_write:nn { dict } { #2 }
+ \__pdf_backend_bdcobject:n { #1 }
+ }
+\cs_set_protected:Npn \__pdf_backend_bdc_contstream:nn #1 #2
+ {
+ \__kernel_backend_literal_page:n { /#1~<<#2>>~BDC }
+ }
+\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2
+ {
+ \bool_if:NTF \g__pdfmanagement_active_bool
+ {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contobj:nn}
+ {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contstream:nn}
+ \__pdf_backend_bdc:nn {#1}{#2}
+ }
+\cs_set_protected:Npn \__pdf_backend_emc:
+ {
+ \__kernel_backend_literal_page:n { EMC }
+ }
+
+\cs_new:Npn \__pdf_backend_PageResources_gpush_aux:n #1 %#1 ExtGState etc
+ {
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/#1} }
+ {
+ \pdfdict_item:ne { #1 }{ \pdf_object_ref:n {Page/Resources/#1}}
+ }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1
+ {
+ \exp_args:NNx \tex_global:D \tex_pdfpageresources:D
+ {
+ \prop_if_exist:cT
+ { \__kernel_pdfdict_name:n { g__pdf_Core/backend_Page#1/Resources/Properties } }
+ {
+ /Properties~
+ <<
+ \prop_map_function:cN
+ { \__kernel_pdfdict_name:n { g__pdf_Core/backend_Page#1/Resources/Properties } }
+ \pdfdict_item:ne
+ >>
+ }
+ %% add ExtGState etc
+ \clist_map_function:NN
+ \c__pdf_backend_PageResources_clist
+ \__pdf_backend_PageResources_gpush_aux:n
+ }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+ {
+ \pdf_object_unnamed_write:nn {dict} {/Names [#1] }
+ \tex_pdfnames:D {/EmbeddedFiles~\pdf_object_ref_last:}
+ }
+
+
+\int_new:N \g__pdf_backend_EmbeddedFiles_int
+\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
+ {
+ (
+ l3ef
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
+ {0}
+ \int_use:N \g__pdf_backend_EmbeddedFiles_int
+ )
+ }
+\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
+\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1
+ %#1 object ref
+ {
+ \int_gincr:N \g__pdf_backend_EmbeddedFiles_int
+ \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop
+ { #1 }
+ { \__pdf_backend_EmbeddedFiles_name: }
+ \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq
+ { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4
+ {
+ \hbox_set:Nn \l__pdf_backend_tmpa_box
+ {
+ \bool_set_true:N \l__pdf_backend_xform_bool
+ \prop_gclear:c {\__kernel_pdfdict_name:n { g__pdf_Core/Xform/Resources/Properties }}
+ #4
+ }
+ %store the dimensions
+ \tl_const:cx
+ { c__pdf_backend_xform_wd_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_wd:N \l__pdf_backend_tmpa_box }
+ \tl_const:cx
+ { c__pdf_backend_xform_ht_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_ht:N \l__pdf_backend_tmpa_box }
+ \tl_const:cx
+ { c__pdf_backend_xform_dp_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_dp:N \l__pdf_backend_tmpa_box }
+ %% do we need to test if #2 and #3 are empty??
+ \tex_immediate:D \tex_pdfxform:D
+ ~ attr ~ { #2 }
+ %% which other resources should be default? Is an argument actually needed?
+ ~ resources ~
+ {
+ #3
+ \int_compare:nNnT
+ { \prop_count:c { \__kernel_pdfdict_name:n { g__pdf_Core/Xform/Resources/Properties } } }
+ >
+ { 0 }
+ {
+ /Properties~
+ <<
+ \pdfdict_use:n { g__pdf_Core/Xform/Resources/Properties }
+ >>
+ }
+
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/ExtGState } }
+ {
+ /ExtGState~ \pdf_object_ref:n { Page/Resources/ExtGState }
+ }
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/Pattern } }
+ {
+ /Pattern~ \pdf_object_ref:n { Page/Resources/Pattern }
+ }
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/Shading } }
+ {
+ /Shading~ \pdf_object_ref:n { Page/Resources/Shading }
+ }
+ \prop_if_empty:cF
+ { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/ColorSpace } }
+ {
+ /ColorSpace~ \pdf_object_ref:n { Page/Resources/ColorSpace }
+ }
+ }
+ \l__pdf_backend_tmpa_box
+ \int_const:cn
+ { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ { \tex_pdflastxform:D }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_xform_use:n #1
+ {
+ \tex_pdfrefxform:D
+ \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ \scan_stop:
+ }
+
+\cs_new:Npn \__pdf_backend_xform_ref:n #1
+ {
+ \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } ~ 0 ~ R
+ }
+%% all
+\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF }
+ {
+ \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ { \prg_return_true: }
+ { \prg_return_false:}
+ }
+\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
+ { TF , T , F , p }
+%%
+%%
+%% End of file `l3backend-testphase-pdftex.def'.
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
new file mode 100644
index 00000000000..60a336e651b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def
@@ -0,0 +1,377 @@
+%%
+%% This is file `l3backend-testphase-xetex.def',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% l3backend-testphase.dtx (with options: `drivers,xdvipdfmx')
+%%
+%% Copyright (C) 2019-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:
+%%
+%% https://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.
+%%
+%% File: l3backend-testphase.dtx
+\ProvidesExplFile
+ {l3backend-testphase-xetex.def}{2021-02-22}{}
+ {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX}
+\RequirePackage{l3ref-tmp}
+\cs_generate_variant:Nn \ref_label:nn {en}
+\cs_generate_variant:Nn \ref_value:nn {en}
+\cs_new_protected:Npn \__pdf_backend_ref_label:nn #1 #2
+ {
+ \@bsphack
+ \ref_label:nn{#1}{abspage}
+ \@esphack
+ }
+\cs_new:Npn \__pdf_backend_ref_value:nn #1 #2
+ {
+ \ref_value:nn{#1}{#2}
+ }
+\cs_generate_variant:Nn \__pdf_backend_ref_label:nn {en}
+\cs_generate_variant:Nn \__pdf_backend_ref_value:nn {en}
+ \__kernel_backend_literal:x { dvipdfmx:config~C~ 0x0010 }
+\prop_new:N \g__pdf_tmpa_prop
+\tl_new:N \l__pdf_tmpa_tl
+\box_new:N \l__pdf_backend_tmpa_box
+\int_new:N \g__pdf_backend_resourceid_int
+\int_new:N \g__pdf_backend_name_int
+\int_new:N \g__pdf_backend_page_int
+\tl_gput_right:Nn \@kernel@after@shipout@lastpage
+ {
+ \g__kernel_pdfmanagement_end_run_code_tl
+ }
+\tl_if_exist:NTF \@kernel@after@shipout@background
+ {
+ \g@addto@macro \@kernel@before@shipout@background{\relax}
+ \g@addto@macro \@kernel@after@shipout@background
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \tl_gput_left:Nn\@kernel@after@shipout@lastpage
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+ {
+ \hook_gput_code:nnn{shipout/background}{pdf}
+ {
+ \g__kernel_pdfmanagement_thispage_shipout_code_tl
+ }
+ \hook_gput_code:nnn {shipout/lastpage} {pdf}
+ {
+ \g__kernel_pdfmanagement_lastpage_shipout_code_tl
+ }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_Pages_primitive:n #1
+ {
+ \__pdf_backend:n{put~@pages~<<#1>>}
+ }
+ %the primitive
+\cs_new_protected:Npn \__pdf_backend_Page_primitive:n #1
+ {
+ \tex_special:D{pdf:~put~@thispage~<<#1>>}
+ }
+ % the command to store default values.
+ % Uses a prop with pdflatex + dvi,
+ % sets a lua table with lualatex
+\cs_new_protected:Npn \__pdf_backend_Page_gput:nn #1 #2
+ {
+ \pdfdict_gput:nnn {g__pdf_Core/Page}{ #1 }{ #2 }
+ }
+ % the command to remove a default value.
+ % Uses a prop with pdflatex + dvi,
+ % changes a lua table with lualatex
+\cs_new_protected:Npn \__pdf_backend_Page_gremove:n #1
+ {
+ \pdfdict_gremove:nn {g__pdf_Core/Page}{ #1 }
+ }
+ % the command used in the document.
+ % direct call of the primitive special with dvips/dvipdfmx
+ % \latelua: fill a page related table with lualatex, merge it with the page
+ % table and push it directly
+ % write to aux and store in prop with pdflatex
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gput:nn #1 #2
+ {
+ \__pdf_backend_Page_primitive:n { /#1~#2 }
+ }
+ %the code to push the values, used in shipout
+ %merges the two props and then fills the register in pdflatex
+ %merges the two tables (the one is probably still empty)
+ % and then fills (in lua) in luatex
+ %issues the values stored in the global prop with dvi
+\cs_new_protected:Npn \__pdf_backend_ThisPage_gpush:n #1
+ {
+ \exp_args:Nx \__pdf_backend_Page_primitive:n
+ { \pdfdict_use:n { g__pdf_Core/Page} }
+ }
+\clist_const:Nn \c__pdf_backend_PageResources_clist
+ {
+ ExtGState,
+ ColorSpace,
+ Pattern,
+ Shading,
+ }
+\hook_gset_rule:nnnn{shipout/firstpage}{l3backend-xetex}{after}{pdf}
+\clist_map_inline:Nn \c__pdf_backend_PageResources_clist
+ {
+ \__pdf_backend_object_new:nn { Page/Resources/#1 } { dict }
+ \hook_gput_code:nnn{shipout/firstpage}{pdf}{\__pdf_backend_object_write:nn { Page/Resources/#1 } {}}
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources:n #1
+ {
+ \__pdf_backend:n {put~@resources~<<#1>>}
+ }
+\cs_new_protected:Npn \__pdf_backend_PageResources_gput:nnn #1 #2 #3
+ {
+ % this is not used for output, but there is a test if the resource is empty
+ \exp_args:Nnx
+ \prop_gput:cnn { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/#1} }
+ { \str_convert_pdfname:n {#2} }{ #3 }
+ %objects are not filled with \pdf_object_write as this is not additive!
+ \__pdf_backend:x
+ {
+ put~\__pdf_backend_object_ref:n {Page/Resources/#1}<</#2~#3>>
+ }
+ }
+
+\cs_new_protected:Npn \__pdf_backend_PageResources_obj_gpush: {}
+\bool_new:N \l__pdf_backend_xform_bool
+
+ \cs_set_protected:Npn \__pdf_backend_bdcobject:nn #1 #2 % #1 eg. Span, #2: object name
+ {
+ \int_gincr:N \g__pdf_backend_name_int
+ \__kernel_backend_literal:x
+ {
+ pdf:code~/#1/l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC
+ }
+ \__kernel_backend_literal:x
+ {
+ pdf:put~@resources~
+ <<
+ /Properties~
+ <<
+ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl
+ \__pdf_backend_object_ref:n { #2 }
+ >>
+ >>
+ }
+ }
+ \cs_set_protected:Npn \__pdf_backend_bdcobject:n #1 % #1 eg. Span
+ {
+ \int_gincr:N \g__pdf_backend_name_int
+ \__kernel_backend_literal:x
+ {
+ pdf:code~/#1/l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl BDC
+ }
+ \__kernel_backend_literal:x
+ {
+ pdf:put~@resources~
+ <<
+ /Properties~
+ <<
+ /l3pdf\int_use:N\g__pdf_backend_name_int\c_space_tl
+ \__pdf_backend_object_last:
+ >>
+ >>
+ }
+ }
+\cs_set_protected:Npn \__pdf_backend_bmc:n #1
+ {
+ \__kernel_backend_literal:n {pdf:code~/#1~BMC} %pdfbase
+ }
+
+\cs_set_protected:Npn \__pdf_backend_bdc_contobj:nn #1 #2
+ {
+ \pdf_object_unnamed_write:nn { dict }{ #2 }
+ \__pdf_backend_bdcobject:n { #1 }
+ }
+
+\cs_set_protected:Npn \__pdf_backend_bdc_contstream:nn #1 #2
+ {
+ \__kernel_backend_literal:n {pdf:code~ /#1~<<#2>>~BDC }
+ }
+
+\cs_set_protected:Npn \__pdf_backend_bdc:nn #1 #2
+ {
+ \bool_if:NTF \g__pdfmanagement_active_bool
+ {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contobj:nn}
+ {\cs_gset_eq:NN \__pdf_backend_bdc:nn \__pdf_backend_bdc_contstream:nn}
+ \__pdf_backend_bdc:nn {#1}{#2}
+ }
+\cs_set_protected:Npn \__pdf_backend_emc:
+ {
+ \__kernel_backend_literal:n {pdf:code~EMC} %pdfbase
+ }
+ % properties are handled automatically, but the other resources should be added
+ % at shipout
+\cs_new_protected:Npn \__pdf_backend_PageResources_gpush:n #1
+ {
+ \clist_map_inline:Nn \c__pdf_backend_PageResources_clist
+ {
+ \prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Page/Resources/##1} }
+ {
+ \__kernel_backend_literal:x
+ {
+ pdf:put~@resources~
+ <</##1~\__pdf_backend_object_ref:n {Page/Resources/##1}>>
+ }
+ }
+ }
+ }
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_gpush:n #1 %array content
+ {
+ \pdf_object_unnamed_write:nn {dict} { /Names [#1] }
+ %n or x?
+ \__pdf_backend:x {put~@names~<</EmbeddedFiles~\pdf_object_ref_last: >>}
+ }
+
+
+\int_new:N \g__pdf_backend_EmbeddedFiles_int
+\cs_new:Npn \__pdf_backend_EmbeddedFiles_name:
+ {
+ (
+ l3ef
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {10}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {100}
+ {0}
+ \int_compare:nNnT {\g__pdf_backend_EmbeddedFiles_int} < {1000}
+ {0}
+ \int_use:N \g__pdf_backend_EmbeddedFiles_int
+ )
+ }
+\seq_new:N \g__pdf_backend_EmbeddedFiles_seq
+\prop_new:N \g__pdf_backend_EmbeddedFiles_named_prop
+\cs_new_protected:Npn \__pdf_backend_NamesEmbeddedFiles_add:n #1
+ %#1 object ref
+ {
+ \int_gincr:N \g__pdf_backend_EmbeddedFiles_int
+ \prop_gput:Nnx \g__pdf_backend_EmbeddedFiles_named_prop
+ { #1 }
+ { \__pdf_backend_EmbeddedFiles_name: }
+ \seq_gput_right:Nx \g__pdf_backend_EmbeddedFiles_seq
+ { \__pdf_backend_EmbeddedFiles_name: \c_space_tl #1 }
+ }
+
+ % it needs a bit testing if it really works to set the box to 0 before the special ...
+ % does it disturb viewing the xobject?
+ % what happens with the resources (bdc)? (should work as they are specials too)
+ % xetex requires that the special is in horizontal mode. This means it affects
+ % typesetting. But we can no delay the whole form code to shipout
+ % as the object reference and the size is often wanted on the current page.
+ % so we need to allocate a box - but probably they won't be thousands xform
+ % in a document so it shouldn't matter.
+ \cs_new_protected:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4
+ % #1 name
+ % #2 attributes
+ % #3 resources
+ % #4 content, not necessarily a box!
+ {
+ \int_gincr:N \g__pdf_backend_object_int
+ \int_const:cn
+ { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ { \g__pdf_backend_object_int }
+ \box_new:c { g__pdf_backend_xform_#1_box }
+ \hbox_gset:cn { g__pdf_backend_xform_#1_box }
+ {
+ \bool_set_true:N \l__pdf_backend_xform_bool
+ #4
+ }
+ \tl_const:cx
+ { c__pdf_backend_xform_wd_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_wd:c { g__pdf_backend_xform_#1_box } }
+ \tl_const:cx
+ { c__pdf_backend_xform_ht_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_ht:c { g__pdf_backend_xform_#1_box } }
+ \tl_const:cx
+ { c__pdf_backend_xform_dp_ \tl_to_str:n {#1} _tl }
+ { \tex_the:D \box_dp:c { g__pdf_backend_xform_#1_box } }
+ \box_set_dp:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim }
+ \box_set_ht:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim }
+ \box_set_wd:cn { g__pdf_backend_xform_#1_box } { \c_zero_dim }
+ \hook_gput_next_code:nn {shipout/background}
+ {
+ \mode_leave_vertical: %needed, the xform disappears without it.
+ \__pdf_backend:x
+ {
+ bxobj ~ \__pdf_backend_xform_ref:n { #1 }
+ \c_space_tl width ~ \pdfxform_wd:n { #1 }
+ \c_space_tl height ~ \pdfxform_ht:n { #1 }
+ \c_space_tl depth ~ \pdfxform_dp:n { #1 }
+ }
+ \box_use_drop:c { g__pdf_backend_xform_#1_box }
+ \__pdf_backend:x {put ~ @resources ~<<#3>> }
+ \__pdf_backend:x
+ {
+ put~ @resources ~
+ <<
+ /ExtGState~ \pdf_object_ref:n { Page/Resources/ExtGState }
+ >>
+ }
+ \__pdf_backend:x
+ {
+ put~ @resources ~
+ <<
+ /Pattern~ \pdf_object_ref:n { Page/Resources/Pattern }
+ >>
+ }
+ \__pdf_backend:x
+ {
+ put~ @resources ~
+ <<
+ /Shading~ \pdf_object_ref:n { Page/Resources/Shading }
+ >>
+ }
+ \__pdf_backend:x
+ {
+ put~ @resources ~
+ <<
+ /ColorSpace~
+ \pdf_object_ref:n { Page/Resources/ColorSpace }
+ >>
+ }
+ \exp_args:Nx
+ \__pdf_backend:x {exobj ~<<#2>>}
+ }
+ }
+
+ \cs_new:Npn \__pdf_backend_xform_ref:n #1
+ {
+ @pdf.xform \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ }
+
+ \cs_new_protected:Npn \__pdf_backend_xform_use:n #1
+ {
+ \hbox_set:Nn \l__pdf_backend_tmpa_box
+ {
+ \__pdf_backend:x
+ {
+ uxobj~ \__pdf_backend_xform_ref:n { #1 }
+ }
+ }
+ \box_set_wd:Nn \l__pdf_backend_tmpa_box { \pdfxform_wd:n { #1 } }
+ \box_set_ht:Nn \l__pdf_backend_tmpa_box { \pdfxform_ht:n { #1 } }
+ \box_set_dp:Nn \l__pdf_backend_tmpa_box { \pdfxform_dp:n { #1 } }
+ \box_use_drop:N \l__pdf_backend_tmpa_box
+ }
+%% all
+\prg_new_conditional:Npnn \__pdf_backend_xform_if_exist:n #1 { p , T , F , TF }
+ {
+ \int_if_exist:cTF { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
+ { \prg_return_true: }
+ { \prg_return_false:}
+ }
+\prg_new_eq_conditional:NNn \pdfxform_if_exist:n\__pdf_backend_xform_if_exist:n
+ { TF , T , F , p }
+%%
+%%
+%% End of file `l3backend-testphase-xetex.def'.
diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3ref-tmp.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3ref-tmp.sty
new file mode 100644
index 00000000000..32ec132f775
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/l3ref-tmp.sty
@@ -0,0 +1,131 @@
+%%
+%% This is file `l3ref-tmp.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% l3ref.dtx (with options: `package')
+%%
+%% Copyright (C) 2020-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 "l3ref bundle" (The Work in LPPL)
+%% and all files in that bundle must be distributed together.
+%%
+%% File: l3ref.dtx
+\ProvidesExplPackage{l3ref-tmp}{2020-10-09}{}
+ {L3 Experimental cross-referencing}
+\cs_new_protected:Npn \ref_attribute_gset:nnnn #1#2#3#4
+ {
+ \exp_args:Nx \__ref_attribute_gset:nnnn { \tl_to_str:n {#1} }
+ {#2} {#3} {#4}
+ }
+\cs_new_protected:Npn \__ref_attribute_gset:nnnn #1#2#3#4
+ {
+ \cs_gset:cpn { __ref_attribute_ #1 : } {#4}
+ \tl_gclear_new:c { g__ref_default_ #1 _tl }
+ \tl_gset:cn { g__ref_default_ #1 _tl } {#2}
+ \bool_if_exist:cF { g__ref_shipout_ #1 _tl }
+ { \bool_new:c { g__ref_shipout_ #1 _tl } }
+ \str_case:nnF {#3}
+ {
+ { now } { { \bool_gset_false:c { g__ref_shipout_ #1 _tl } } }
+ { shipout }
+ { \bool_gset_true:c { g__ref_shipout_ #1 _tl } }
+ }
+ { \msg_error:nnnn { ref } { unknown-setpoint } {#1} {#3} }
+ }
+\cs_new_protected:Npn \ref_label:nN #1#2
+ { \ref_label:nV {#1} #2 }
+\cs_new_protected:Npn \ref_label:nn #1#2
+ { \exp_args:Nx \__ref_label:nn { \tl_to_str:n {#1} } {#2} }
+\cs_generate_variant:Nn \ref_label:nn { nV }
+\cs_new_protected:Npn \__ref_label:nn #1#2
+ {
+ \legacy_if:nT { @filesw }
+ {
+ \iow_shipout_x:Nx \@auxout
+ {
+ \token_to_str:N \newlabeldata
+ {#1}
+ { \clist_map_function:nN {#2} \__ref_label_attribute:n }
+ }
+ }
+ }
+\cs_new:Npn \__ref_label_attribute:n #1
+ { \exp_args:Ne \__ref_label_attribute_aux:n { \tl_to_str:n {#1} } }
+\cs_new:Npn \__ref_label_attribute_aux:n #1
+ {
+ \cs_if_exist:cTF { __ref_attribute_ #1 : }
+ {
+ {#1}
+ {
+ \bool_if:cTF { g__ref_shipout_ #1 _tl }
+ { \exp_not:c }
+ { \use:c }
+ { __ref_attribute_ #1 : }
+ }
+ }
+ { \msg_expandable_error:nnn { ref } { attribute-not-defined } {#1} }
+ }
+\cs_new:Npn \ref_value:nn #1#2
+ {
+ \exp_args:Nee \__ref_value:nn { \tl_to_str:n {#1} } { \tl_to_str:n {#2} }
+ }
+\cs_new:Npn \__ref_value:nn #1#2
+ {
+ \tl_if_exist:cTF { g__ref_label_ #1 _ #2 _tl }
+ { \tl_use:c { g__ref_label_ #1 _ #2 _tl } }
+ {
+ \tl_if_exist:cTF { g__ref_default_ #2 _tl }
+ { \tl_use:c { g__ref_default_ #2 _tl } }
+ { \exp_not:n { \textbf { ?? } } }
+ }
+ }
+\prg_new_conditional:Npnn \ref_if_exist:nn #1#2 { p , T , F, TF } % #1 label #2 attribute
+ {
+ \tl_if_exist:cTF { g__ref_label_ \tl_to_str:n {#1} _ \tl_to_str:n {#2} _tl }
+ {
+ \prg_return_true:
+ }
+ {
+ \prg_return_false:
+ }
+ }
+\cs_new_protected:Npn \newlabeldata #1#2
+ {
+ \__ref_data:nnn {#1} #2 { \q_recursion_tail } { ? } \q_recursion_stop
+ }
+\cs_new_protected:Npn \__ref_data:nnn #1#2#3
+ {
+ \quark_if_recursion_tail_stop:n {#2}
+ \tl_gclear_new:c { g__ref_label_ #1 _ #2 _tl }
+ \tl_gset:cn { g__ref_label_ #1 _ #2 _tl } {#3}
+ \__ref_data:nnn {#1}
+ }
+\ref_attribute_gset:nnnn { abspage } { 0 } { shipout }
+ { \int_use:N \g_shipout_readonly_int }
+\ref_attribute_gset:nnnn { page } { 0 } { shipout } { \thepage }
+\clist_new:N \g_ref_main_clist
+\clist_gput_right:Nn \g_ref_main_clist { page }
+\msg_new:nnnn { ref } { attribute-not-defined }
+ { Attribute~'#1'~not~defined. }
+ {
+ LaTeX~has~been~asked~to~use~attribute~'#1',~but~this~
+ name~has~not~been~defined.
+ }
+\msg_new:nnnn { ref } { unknown-setpoint }
+ { Unknown~keyword~'#3'~for~setting~attribute~'#1'. }
+ {
+ LaTeX~has~been~asked~to~set~the~attribute~'#1',~but~the~keyword~
+ '#3'~is~not~one~of~the~two~known~values:~'now'~or~'shipout'.
+ }
+%%
+%%
+%% End of file `l3ref.sty'.
diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty
new file mode 100644
index 00000000000..b3ade3f709a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdflscape-ltx.sty
@@ -0,0 +1,54 @@
+%%
+%% This is file `pdflscape-ltx.sty',
+%%
+%% Version: 2021/02/22 v0.95a
+%%
+%% Copyright (C) 2021 The LaTeX Project
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% https://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% https://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainers of this work are
+%% The LaTeX Project
+%%
+%%
+%% This work consists of the main source file pdflscape-ltx.sty
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesExplPackage {pdflscape-ltx}{2021/02/22}{v0.95a}
+ {Display of landscape pages in PDF - adaption of pdflscape to the PDFmanagement bundle (testphase)}
+
+\RequirePackage{lscape}
+% this always turns in the same direction as pdflscape does too.
+% left and right would need
+% \pdfmanagement_add:nnn{ThisPage}{Rotate}{..}
+% on every page (e.g. in a shipout hook) and some option to control the wanted
+% orientation.
+
+\tl_new:N\g__pdflscape_saverotate_tl
+\hook_gput_code:nnn {env/landscape/begin}{pdflscape}
+ {
+ \pdfmanagement_get:nnN {Page}{Rotate}\l_tmpa_tl
+ \tl_gset_eq:NN\g__pdflscape_saverotate_tl\l_tmpa_tl
+ \clearpage
+ \pdfmanagement_add:nnn{Page}{Rotate}{90}
+ }
+\hook_gput_code:nnn {env/landscape/after}{pdflscape}
+ {
+ \quark_if_no_value:NTF\g__pdflscape_saverotate_tl
+ {\pdfmanagement_remove:nn{Page}{Rotate}}
+ {\pdfmanagement_add:nnx{Page}{Rotate}{\g__pdflscape_saverotate_tl}}
+ }
+
+\endinput
+%%
+%% End of file `pdflscape-ltx.sty'.
diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty
new file mode 100644
index 00000000000..f1f2b6c81ba
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty
@@ -0,0 +1,183 @@
+%%
+%% This is file `pdfmanagement-firstaid.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pdfmanagement-firstaid.dtx (with options: `package')
+%%
+%% Copyright (C) 2019-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:
+%%
+%% https://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.
+%%
+%% File: pdfmanagement-firstaid.dtx
+\ProvidesExplPackage {pdfmanagement-firstaid} {2021-02-22} {0.95a}
+ {LaTeX PDF management testphase bundle / firstaid-patches}
+
+\clist_map_inline:nn {pgf,transparent,hyperxmp,pdflscape,xcolor,color}
+ {
+ \bool_new:c { g__pdfmanagement_firstaid_#1_bool }
+ \bool_gset_true:c { g__pdfmanagement_firstaid_#1_bool }
+ }
+\clist_map_inline:Nn \g__pdfmanagement_firstaidoff_clist
+ {
+ \bool_if_exist:cT { g__pdfmanagement_firstaid_#1_bool }
+ {
+ \bool_gset_false:c { g__pdfmanagement_firstaid_#1_bool }
+ }
+ }
+\msg_new:nnn { pdfmanagement } { firstaid }
+ { loading~pdfmanagement~firstaid~code~for~#1 }
+\@ifundefined{color_set:nn}{
+\RequirePackage{l3color}}{}
+\bool_if:NT \g__pdfmanagement_firstaid_color_bool
+ {
+ \declare@file@substitution{color.sty}{color-ltx.sty}
+ }
+\@ifundefined{color_set:nn}{
+\RequirePackage{l3color}}{}
+\bool_if:NT \g__pdfmanagement_firstaid_xcolor_bool
+ {
+ \AddToHook{package/after/xcolor}
+ {\RequirePackage{xcolor-patches-tmp-ltx}\XC@@names}
+ }
+
+\bool_if:NT \g__pdfmanagement_firstaid_pgf_bool
+ {
+ \msg_info:nnn{pdfmanagement }{firstaid}{pgf}
+ \AddToHook{file/after/pgfrcs.sty}
+ {
+ \cs_set_eq:NN
+ \__pdfmanagement_pgfori_pgfutil@setuppdfresources
+ \pgfutil@setuppdfresources
+ \def\pgfutil@setuppdfresources
+ {
+ \pdfmanagement_if_active:TF
+ {
+ \__pdfmanagement_pgf_sys_setuppdfresources_plain:
+ }
+ {
+ \__pdfmanagement_pgfori_pgfutil@setuppdfresources
+ }
+ }
+ }
+ }
+\cs_new_protected:Npn \__pdfmanagement_pgf_sys_setuppdfresources_plain:
+ {
+ %objects are already created ...
+ \def\pgf@sys@pdf@possible@resources
+ {
+ /ColorSpace~\pdf_object_ref:n {Page/Resources/ColorSpace}
+ /Pattern ~\pdf_object_ref:n {Page/Resources/Pattern}
+ /ExtGState ~\pdf_object_ref:n {Page/Resources/ExtGState}
+ }
+ \let\pgf@sys@pdf@check@resources=\relax%
+ %not sure if needed, but perhaps the lists are used somewhere else ...
+ \let\pgf@sys@pgf@resource@list@extgs=\pgfutil@empty%
+ \let\pgf@sys@pgf@resource@list@patterns=\pgfutil@empty%
+ \let\pgf@sys@pgf@resource@list@colorspaces=\pgfutil@empty%
+ % the commands to add page resources
+ \def\pgf@sys@addpdfresource@extgs@plain##1
+ {
+ \exp_after:wN %for transparent which passes a command
+ \__pdfmanagement_patch_pgfextgs:w ##1\q_stop
+ }
+ \def\pgf@sys@addpdfresource@patterns@plain##1
+ {
+ \__pdfmanagement_patch_pgfpatterns:w ##1\q_stop
+ }
+ \def\pgf@sys@addpdfresource@colorspaces@plain##1
+ {
+ \__pdfmanagement_patch_pgfcolorspaces:w ##1\q_stop
+ }
+ }
+
+\cs_new:Npn \__pdfmanagement_split_dict_entry_aux:NNw #1 #2 /#3~#4\q_stop
+ {
+ \tl_set:Nn #1 {#3}
+ \tl_set:Nn #2 {#4}
+ }
+
+\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>>}
+ }
+\cs_new:Npn \__pdfmanagement_patch_pgfpatterns:w #1/#2\space#3\q_stop
+ {
+ \exp_args:Nnxx
+ \__pdf_backend_PageResources_gput:nnn
+ {Pattern}{\tl_trim_spaces:n{#2}}{#3}
+ }
+\cs_new:Npn \__pdfmanagement_patch_pgfcolorspaces:w #1/#2[#3]#4\q_stop
+ {
+ \exp_args:Nne
+ \__pdf_backend_PageResources_gput:nnn
+ {ColorSpace}{\tl_trim_spaces:n{#2}}{[#3]}
+ }
+
+\bool_if:NT \g__pdfmanagement_firstaid_transparent_bool
+ {
+ \declare@file@substitution{transparent.sty}{transparent-ltx.sty}
+ }
+\bool_if:NT \g__pdfmanagement_firstaid_pdflscape_bool
+ {
+ \declare@file@substitution{pdflscape.sty}{pdflscape-ltx.sty}
+ }
+\bool_if:NT \g__pdfmanagement_firstaid_hyperxmp_bool
+ {
+ \AddToHook
+ {file/after/hyperxmp.sty}
+ {\RequirePackage{hyperxmp-patches-tmp-ltx}}
+ }
+\hook_gput_code:nnn {begindocument} {pdf}
+ {
+ \tl_if_exist:NT \spc@op
+ {
+ \def\spc@Pageresources#1{}
+ }
+
+ }
+
+\hook_gput_code:nnn {begindocument/end} {pdf}
+ {
+ \tl_if_exist:NT \spc@op
+ {
+ \__pdf_backend_object_new:nn {__spc_extgstate_op_false}{dict}
+ \__pdf_backend_object_write:nn
+ {__spc_extgstate_op_false}
+ {/Type /ExtGState~/op~false~/OP~false}
+ \pdfmanagement_add:nnn
+ {Page/Resources/ExtGState}
+ {SPCko}
+ {\__pdf_backend_object_ref:n {__spc_extgstate_op_false}}
+ \__pdf_backend_object_new:nn {__spc_extgstate_op_true0}{dict}
+ \__pdf_backend_object_write:nn
+ {__spc_extgstate_op_true0}
+ {/Type /ExtGState~/op~true~/OP~true~/OPM~0}%
+ \pdfmanagement_add:nnn
+ {Page/Resources/ExtGState}
+ {SPCmz}
+ {\__pdf_backend_object_ref:n {__spc_extgstate_op_true0}}
+ \__pdf_backend_object_new:nn {__spc_extgstate_op_true1}{dict}
+ \__pdf_backend_object_write:nn
+ {__spc_extgstate_op_true1}
+ {/Type /ExtGState~/op~true~/OP~true~/OPM~1}%
+ \pdfmanagement_add:nnn
+ {Page/Resources/ExtGState}
+ {SPCop}
+ {\__pdf_backend_object_ref:n {__spc_extgstate_op_true1}}
+ }
+ }
+%%
+%%
+%% End of file `pdfmanagement-firstaid.sty'.
diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty
new file mode 100644
index 00000000000..7873ac752da
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty
@@ -0,0 +1,45 @@
+%%
+%% This is file `pdfmanagement-testphase.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pdfmanagement-testphase.dtx (with options: `package')
+%%
+%% Copyright (C) 2019-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:
+%%
+%% https://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.
+%%
+%% File: pdfmanagement-testphase.dtx
+\ProvidesExplPackage {pdfmanagement-testphase} {2021-02-22} {0.95a}
+ {LaTeX PDF management testphase bundle}
+\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
+\IfFormatAtLeastTF{2020-10-01}{}{
+ \PackageWarning{pdfmanagement-testphase}
+ {This~package~needs~LaTeX~2020-10-01~or~newer.
+ \MessageBreak Loading~is~aborted.}{}
+ \DeclareOption { debug }{}
+ \newcommand\DeclareDocumentMetadata[1]{}
+ \ProcessOptions\relax
+ }
+\IfFormatAtLeastTF{2020-10-01}{}{\endinput}
+
+\DeclareOption { debug }
+ {
+ \msg_redirect_module:nnn { pdf } { none } { warning }
+ }
+
+\ProcessOptions\relax
+%% can perhaps be combined or made optional ...
+\input{pdfmanagement-testphase.ltx}
+%%
+%%
+%% End of file `pdfmanagement-testphase.sty'.
diff --git a/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty
new file mode 100644
index 00000000000..be7a2522708
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/transparent-ltx.sty
@@ -0,0 +1,26 @@
+%%
+%% This is file `transparent-ltx.sty',
+%% a replacement for transparent sty from Heiko Oberdiek
+%%
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+\ProvidesExplPackage{transparent-ltx}%
+ {2021-02-22}{v0.95a}{Transparency with color stacks (replacement for transparent.sty from Heiko Oberdiek)}%
+
+\RequirePackage{l3opacity}
+
+\NewDocumentCommand{\transparent} { m }
+ {
+ \opacity_select:n{\fp_eval:n{ min(max(0,#1),1) } }
+ }
+
+\NewDocumentCommand{\texttransparent}{m m}
+ {
+ \mode_leave_vertical:
+ \group_begin:
+ \transparent{#1}
+ #2
+ \group_end:
+ }
+
+
+\endinput
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
new file mode 100644
index 00000000000..c49a000fa20
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty
@@ -0,0 +1,98 @@
+%% LaTeX2e file `xcolor-patches.sty'
+%%
+\ProvidesPackage{xcolor-patches-tmp-ltx}[2021/02/22 v0.95a patch xcolor for l3color]
+\@ifundefined{color_set:nn}{\RequirePackage{l3color}}{}
+
+\ExplSyntaxOn
+\cs_gset_protected:Npn \@expl@xcolor@set@@nnn #1 #2 #3
+ {
+ \cs_if_exist:cTF { __color_parse_model_ #2 :w }
+ {
+ \color_set:nnn {#1}{#2}{#3}
+ }
+ {
+ \tl_if_eq:nnTF{#2}{named}
+ {
+ \color_set:nn{#1}{#3}
+ }
+ {
+ %this is for multi models, it will break if there is model
+ %l3 doesn't know, but the case is rare, so accept it for now.
+ \color_set:nnn{#1}{#2}{#3}
+ }
+ }
+ }
+ \cs_generate_variant:Nn \color_set:nn {ne}
+ \cs_new_protected:Npn \@expl@xcolor@set@@ne #1 #2
+ {
+ \exp_args:Nx \__color_if_defined:nT {#2}
+ { \color_set:ne {#1}{#2} }
+ }
+\ExplSyntaxOff
+%\pretocmd{\XC@col@rlet} {\@expl@color@set@@ne{#2}{#4}}{}{\fail}
+\def\XC@col@rlet[#1]#2[#3]#4%
+ {\@expl@xcolor@set@@ne{#2}{#4}%
+ \begingroup
+ \edef\@@cls{#1}\XC@edef\@@nam{#2}\XC@sdef\@@mod{#3}\XC@edef\@@clr{#4}%
+ \XC@info\@@clr\@@tmp\XC@@tstfalse
+ \ifnum\@@tmp=\@ne\ifx\@@mod\@empty
+ \ifx\@@cls\@empty
+ \XC@@tsttrue
+ \else
+ \edef\@@tmp
+ {\expandafter\expandafter\expandafter\@secondoffive
+ \csname\string\color@\@@clr\endcsname}%
+ \ifx\@@cls\@@tmp\XC@@tsttrue\fi
+ \fi
+ \fi\fi
+ \ifXC@@tst
+ \XC@logdef\@@nam\XC@c@l@rlet\@@nam\@@clr
+ \else
+ \extractcolorspec\@@clr\@@clr
+ \ifx\@@mod\@empty\else
+ \expandafter\convertcolorspec\@@clr\@@mod\@@clr
+ \edef\@@clr{{\@@mod}{\@@clr}}\fi
+ \edef\@@tmp{\noexpand\XC@definecolor[\@@cls]{\@@nam}\@@clr}%
+ \fi
+ \expandafter\endgroup\@@tmp\xglobal@stop}
+
+%\pretocmd{\XC@definec@lor}{\@expl@color@set@@nnn{#2}{#4}{#5}}{}{\fail}
+\def\XC@definec@lor[#1]#2[#3]#4#5%
+ {\@expl@xcolor@set@@nnn{#2}{#4}{#5}%
+ \begingroup
+ \XC@sdef\@@cls{#1}\XC@edef\@@nam{#2}\edef\colornameprefix{#3}%
+ \XC@logdef\@@nam
+ \XC@getmodclr02{#4}{#5}{\let\@@tmp\relax}%
+ {\ifx\@@mod\XC@mod@named
+ \XC@c@l@rlet\@@nam\@@clr
+ \else
+ \ifx\@@cls\XC@mod@ps
+ \edef\@@drv{\@@mod\space\@@clr}\def\@@hue{0}%
+ \edef\@@clr{\@nameuse{XC@clr@\@@mod @white}}%
+ \else
+ \ifconvertcolorsD
+ \let\@@tmp\@@mod\XC@sdef\@@mod{\XC@tgt@mod\@@tmp}%
+ \convertcolorspec\@@tmp\@@clr\@@mod\@@clr
+ \fi
+ \XC@coremodel\@@mod\@@clr
+ \csname color@\@@mod\expandafter\endcsname
+ \expandafter\@@drv\expandafter{\@@clr}%
+ \ifcase\XC@@xcp@
+ \immediate\write\XC@@xcp{/\colornameprefix\@@nam{\expandafter
+ \XC@strip@comma\@@clr,,\@nnil}XC\@@mod}%
+ \let\@@cls\XC@mod@named
+ \fi
+ \ifx\@@cls\@empty\else
+ \let\@@tmp\@@cls
+ \@nameuse{define@color@\@@cls}\@@nam\@@drv
+ \csname color@\@@tmp\expandafter\endcsname
+ \expandafter\@@drv\expandafter{\@@nam}%
+ \fi
+ \fi
+ \toks@\expandafter{\@@drv}%
+ \edef\@@tmp
+ {\ifglobalcolors\global\else\xglobal@\fi
+ \noexpand\@namedef{\string\color@\@@nam}%
+ {\noexpand\xcolor@{\@@cls}{\the\toks@}{\@@mod}{\@@clr}}}%
+ \fi}%
+ \expandafter\endgroup\@@tmp\xglobal@stop}