diff options
author | Karl Berry <karl@freefriends.org> | 2022-09-26 20:31:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-09-26 20:31:16 +0000 |
commit | af1f3d06504be6a1c533161f07f584fc59705d24 (patch) | |
tree | f8de259c6619d0c7e1c3c6b647bfe42bf226ba4e /Master/texmf-dist/source/latex | |
parent | cb2024fbf55f973cb3de2af62268e2d1b31a5e75 (diff) |
pdfmanagement-testphase (26sep22)
git-svn-id: svn://tug.org/texlive/trunk@64521 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
19 files changed, 1837 insertions, 226 deletions
diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx index a1616e6f179..c8f8812c45b 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/hyperref-generic.dtx @@ -25,10 +25,9 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass{l3doc} -\usepackage{tabularx,array,booktabs,hyperxmp} +\usepackage{tabularx,array,booktabs} \hypersetup{pdfauthor=The LaTeX Project, pdftitle=generic hyperref driver (LaTeX PDF management testphase bundle)} \premulticols=4cm @@ -83,7 +82,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -166,8 +165,9 @@ % % \enquote{Metadata}, informations about the document, are stored in a PDF in two % places: The |/Info| dictionary and the XMP-metadata. \pkg{hyperref} only handles the -% |/Info| dictionary. The XMP-metadata can be added with like \pkg{pdfx} and -% \pkg{hyperxmp}. +% |/Info| dictionary. The XMP-metadata are added by code from \pkg{l3pdfmeta}. +% (without the pdfmanagement the XMP-metadata can be added with packages like \pkg{pdfx} and +% \pkg{hyperxmp}). % % The |/Info| dictionary can be filled with arbitrary keys, but the PDF viewer typically % care only about a few, like |/Author|, |/Title| and |/Keywords|. @@ -200,6 +200,18 @@ % \begin{verbatim} % pdfauthor = {Bär, Peter Anteater, {Riley, the sloth}} % \end{verbatim} +% +% \item It is possible to store titles in more than one language. If the value begins with +% an \enquote{optional argument} which represents a language tag, the value is taken +% as a comma list and splitted. The first value is used for the Info dictionary, +% the others are used in the XMP-metadata. Commas in a title must then be +% protected with braces: +% +% \begin{verbatim} +% pdftitle = {[en]English Title,[de] Deutscher Titel,[fr]{titre français, avec comma}} +% \end{verbatim} +% +% % \item All values of relevant keys (including keys from the hyperxmp package) % will be stored in a Metadata container, and can be retrieved with % \cs{GetDocumentProperties}. @@ -222,9 +234,6 @@ % \pkg{hyperref} has a few keys to set dates. They typically expect the date % in \enquote{PDF} format: |D:YYYYMMDDhhmmss+01'00'|. % -% One should be aware that \pkg{hyperxmp} will sometimes -% overwrites such settings. -% ^^A XMP: yyyy-mm-ddThh:mm:ss+tt:tt, PDF: D:YYYYMMDDhhmmss+01'00' % % \section{PDF page size (mediabox)} % The standard \pkg{hyperref} driver contain code to set the PDF page size. @@ -877,9 +886,10 @@ % /D & \meta{array of numbers} & dash pattern (lines/gaps) (default [3]) % \end{tabular} % -% \DescribeHypkey{pdfcreationdate}\DescribeHypkey{pdfmoddate} +% \DescribeHypkey{pdfcreationdate}\DescribeHypkey{pdfmoddate}\DescribeHypkey{pdfmetadate} % Setting these keys is normally not needed. If they are used the values -% are stored directly in the Info dictionary for |/Creationdate| and |/ModDate|. +% of the first two keys are stored directly in the Info dictionary for +% |/Creationdate| and |/ModDate|. All three keys are used in XMP-metadata. % The values are converted to strings but not processed further, so they should % have the correct PDF format without the enclosing parentheses, % e.g. |D:20200202111111+01'00'|. @@ -959,7 +969,7 @@ %<@@=hyp> % \end{macrocode} % \begin{macrocode} -\ProvidesFile{hgeneric-testphase.def}[2022-08-24 v0.95r % +\ProvidesFile{hgeneric-testphase.def}[2022-09-26 v0.95s % generic Hyperref driver for the LaTeX PDF management testphase bundle] \RequirePackage{etoolbox} %why? @@ -2761,17 +2771,17 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_ocg_init: { - \pdf_object_new:nn { @@/OCG/View } { dict } - \pdf_object_new:nn { @@/OCG/Print } { dict } - \pdf_object_new:nn { @@/OCG/config } { dict } - \pdf_object_new:nn { @@/OCG/refarray } { array } - \pdf_object_write:nx { @@/OCG/refarray } + \pdf_object_new:n { @@/OCG/View } + \pdf_object_new:n { @@/OCG/Print } + \pdf_object_new:n { @@/OCG/config } + \pdf_object_new:n { @@/OCG/refarray } + \pdf_object_write:nnx { @@/OCG/refarray } { array } { \pdf_object_ref:n { @@/OCG/View } \c_space_tl \pdf_object_ref:n { @@/OCG/Print } } - \pdf_object_write:nn { @@/OCG/View } + \pdf_object_write:nnn { @@/OCG/View } { dict } { /Type/OCG /Name(View) @@ -2781,7 +2791,7 @@ /View <</ViewState/ON >>~ >> } - \pdf_object_write:nn { @@/OCG/Print } + \pdf_object_write:nnn { @@/OCG/Print } { dict } { /Type/OCG /Name(Print) @@ -2793,7 +2803,7 @@ } \pdfmanagement_add:nnx { Catalog / OCProperties }{OCGs }{ \pdf_object_ref:n {@@/OCG/View} } \pdfmanagement_add:nnx { Catalog / OCProperties }{OCGs }{ \pdf_object_ref:n {@@/OCG/Print} } - \pdf_object_write:nx { @@/OCG/config } + \pdf_object_write:nnx { @@/OCG/config } { dict } { /OFF[\pdf_object_ref:n { @@/OCG/Print }] /AS[ @@ -3171,6 +3181,7 @@ { \pdfmanagement_add:nnx {Catalog} { URI }{ <</Base \l_@@_tmpa_tl>> } } + \@@_store_metadata:nn {baseurl}{#1} } %only false does something ... ,bookmarks .choice: @@ -3808,14 +3819,11 @@ { ,pdflang .code:n = { - \tl_if_empty:nTF { #1 } - { - \pdfmanagement_remove:nn {Catalog} { Lang } - } + \tl_if_empty:nF { #1 } { \pdfmanagement_add:nnx {Catalog} { Lang } { (#1) } + \AddToDocumentProperties[document]{lang}{#1} } - \@@_store_metadata:nn {pdflang}{#1} } } % \end{macrocode} @@ -3823,10 +3831,14 @@ % % \subsubsection{\enquote{info keys}} % \begin{hypkey}{pdfauthor,pdftitle,pdfcreator,pdfsubject,pdfproducer,pdfkeywords} -% The keys store their value also in the metadate container, so that hyperxmp can +% The keys store their value also in the metadata container, so that hyperxmp can % use them. Creator and Producer can't be removed with the pdfmanagement, % but we allow to set an empty value. +% If the value begin with an optional argument, we assume a multilanguage clist and +% use only the first value. % \begin{macrocode} +\regex_new:N\l_@@_optlang_regex +\regex_set:Nn\l_@@_optlang_regex {\A\[([A-Za-z\-]+)\](.*)} \cs_new_protected:Npn \@@_setup_info_key:nn #1 #2 { \keys_define:nn { hyp / setup } @@ -3853,7 +3865,17 @@ } } { - \@@_text_pdfstring_info:nN {##1}\l_@@_tmpa_str + \tl_set:Nx\l_@@_tmpa_tl {\clist_item:nn{##1}{1}} + \exp_args:NNV + \regex_extract_once:NnN \l_@@_optlang_regex \l_@@_tmpa_tl\l_@@_tmpa_seq + \seq_if_empty:NTF\l_@@_tmpa_seq + { + \@@_text_pdfstring_info:nN {##1}\l_@@_tmpa_str + } + { + \exp_args:Nx + \@@_text_pdfstring_info:nN {\seq_item:Nn \l_@@_tmpa_seq{3}}\l_@@_tmpa_str + } \str_if_eq:VnF\l_@@_tmpa_str{<FEFF>} { \pdfmanagement_add:nnx {Info}{#2}{\l_@@_tmpa_str} @@ -3900,7 +3922,7 @@ \@@_setup_info_key:nn {keywords} {Keywords} % \end{macrocode} % \end{hypkey} -% \begin{hypkey}{pdfcreationdate,pdfmoddate} +% \begin{hypkey}{pdfcreationdate,pdfmoddate,pdfmetadate} % These keys are not really needed. We store them too in the container. % CreationDate and ModDate should not use the hex encoding. % \begin{macrocode} @@ -3918,6 +3940,7 @@ \pdfmanagement_add:nnx {Info}{#2}{(##1)} } \@@_store_metadata:nn {pdf#1}{##1} + \AddToDocumentProperties[document]{#1}{#2} } } \keys_define:nn { hyp / info } @@ -3938,6 +3961,10 @@ \@@_setup_info_date_key:nn {creationdate} {CreationDate} \@@_setup_info_date_key:nn {moddate} {ModDate} +\keys_define:nn { hyp / setup } + { + pdfmetadate .code:n = { \@@_store_metadata:nn {pdfmetadate}{#1} } + } % \end{macrocode} % \end{hypkey} % \begin{hypkey}{pdftrapped} @@ -3995,7 +4022,7 @@ % % \subsection{hyperxmp keys} % hyperxmp defines lots of keys for \cs{hypersetup}. -% They now longer work with this driver. So we provide them, +% They now longer work with this driver. So we provide most of them, % but they are only stored as metadata: % \begin{macrocode} \clist_map_inline:nn @@ -4006,10 +4033,6 @@ ,pdfauthortitle ,pdfcaptionwriter ,pdfmetalang - ,pdfapart - ,pdfaconformance - ,pdfuapart - ,pdfxstandard ,pdfsource ,pdfdocumentid ,pdfinstanceid @@ -4049,15 +4072,6 @@ } } -\str_if_eq:eeT {A}{\pdfmeta_standard_item:n{type}} - { - \exp_args:Nnx - \keys_set:nn {hyp / setup} - { - ,pdfapart = \pdfmeta_standard_item:n {level} - ,pdfaconformance = \pdfmeta_standard_item:n {conformance} - } - } % \end{macrocode} % % \subsection{Transitions} @@ -4732,10 +4746,10 @@ \ExplSyntaxOn \def\Hy@FormObjects { - \pdf_object_new:nn {@@/Encoding/pdfdoc } { dict } - \pdf_object_new:nn {@@/Font/ZaDb } { dict } - \pdf_object_new:nn {@@/Font/Helv } { dict } - \pdf_object_write:nx {@@/Encoding/pdfdoc } + \pdf_object_new:n {@@/Encoding/pdfdoc } + \pdf_object_new:n {@@/Font/ZaDb } + \pdf_object_new:n {@@/Font/Helv } + \pdf_object_write:nnx {@@/Encoding/pdfdoc } { dict } { /Type/Encoding /Differences[ @@ -4777,14 +4791,14 @@ /uacute/ucircumflex/udieresis/yacute/thorn/ydieresis ] } - \pdf_object_write:nn {@@/Font/ZaDb } + \pdf_object_write:nnn {@@/Font/ZaDb } { dict } { /Type/Font /Subtype/Type1 /Name/ZaDb /BaseFont/ZapfDingbats } - \pdf_object_write:nx {@@/Font/Helv } + \pdf_object_write:nnx {@@/Font/Helv } { dict } { /Type/Font /Subtype/Type1 diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx index f9fc15bf4dd..e556f3575c1 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3backend-testphase.dtx @@ -45,7 +45,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % @@ -56,27 +56,27 @@ % \begin{macrocode} %<drivers>\ProvidesExplFile %<*dvipdfmx> - {l3backend-testphase-dvipdfmx.def}{2022-08-24}{} + {l3backend-testphase-dvipdfmx.def}{2022-09-26}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx} %</dvipdfmx> %<*dvips> - {l3backend-testphase-dvips.def}{2022-08-24}{} + {l3backend-testphase-dvips.def}{2022-09-26}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvips} %</dvips> %<*dvisvgm> - {l3backend-testphase-dvisvgm.def}{2022-08-24}{} + {l3backend-testphase-dvisvgm.def}{2022-09-26}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm} %</dvisvgm> %<*luatex> - {l3backend-testphase-luatex.def}{2022-08-24}{} + {l3backend-testphase-luatex.def}{2022-09-26}{} {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)} %</luatex> %<*pdftex> - {l3backend-testphase-pdftex.def}{2022-08-24}{} + {l3backend-testphase-pdftex.def}{2022-09-26}{} {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)} %</pdftex> %<*xdvipdfmx> - {l3backend-testphase-xetex.def}{2022-08-24}{} + {l3backend-testphase-xetex.def}{2022-09-26}{} {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX} %</xdvipdfmx> % \end{macrocode} @@ -580,7 +580,7 @@ %<*pdftex|luatex> \clist_map_inline:Nn \c_@@_backend_PageResources_clist { - \pdf_object_new:nn {@@/Page/Resources/#1} {dict} + \pdf_object_new:n {@@/Page/Resources/#1} \cs_if_exist:NT \tex_directlua:D { \tex_directlua:D @@ -624,8 +624,8 @@ \prop_if_empty:cF { \__kernel_pdfdict_name:n { g_@@_Core/Page/Resources/##1} } { - \pdf_object_write:nx - { @@/Page/Resources/##1 } + \pdf_object_write:nnx + { @@/Page/Resources/##1 } { dict } { \pdfdict_use:n { g_@@_Core/Page/Resources/##1} } } } @@ -649,8 +649,11 @@ % \clist_map_inline:Nn \c_@@_backend_PageResources_clist { - \pdf_object_new:nn { @@/Page/Resources/#1 } { dict } - \hook_gput_code:nnn{shipout/firstpage}{pdf}{\pdf_object_write:nn { @@/Page/Resources/#1 } {}} + \pdf_object_new:n { @@/Page/Resources/#1 } + \hook_gput_code:nnn + {shipout/firstpage} + {pdf} + {\pdf_object_write:nnn { @@/Page/Resources/#1 } { dict } {}} } \cs_new_protected:Npn \@@_backend_PageResources:n #1 { @@ -1998,9 +2001,52 @@ %<*drivers> \pdfmanagement_add:nnn{Info}{CreationDate}{(D:20010101205959-00'00')} \pdfmanagement_add:nnn{Info}{ModDate}{(D:20010101205959-00'00')} + \AddToDocumentProperties[document]{pdfcreationdate}{D:20010101205959-00'00'} + \AddToDocumentProperties[document]{pdfmoddate}{D:20010101205959-00'00'} + \AddToDocumentProperties[hyperref]{pdfmetadate}{D:20010101205959-00'00'} + \AddToDocumentProperties[hyperref]{pdfdate}{D:20010101205959-00'00'} + \AddToDocumentProperties[hyperref]{pdfinstanceid}{uuid:0a57c455-157a-4141-8c19-6237d832fc80} } %</drivers> % \end{macrocode} +% +% \subsection{Uncompressed metadata object stream} +% The xmp metadata should be written \enquote{uncompressed} to pdf. +% It is not quite clear what exactly that means. Probably it only +% means that there should be no |/Filter| key in the stream, but +% packages like \pkg{pdfx} and \pkg{hyperref} try to suppress object +% compression too, so we add support for it too. +% With luatex this is possible by using the |uncompressed| key word. +% With pdftex one can change locally the compresslevel. (x)dvipdfmx does +% it automatically and doesn't need some special command. No solution +% is known for the dvips route. We need it only once, so we make +% it special and probably no public interface is needed. It writes +% an unnamed object so should be referenced directly with |\pdf_object_ref_last:| +% \begin{macrocode} +%<*luatex> +\cs_new_protected:Npn \__pdf_backend_metadata_stream:n #1 + { + \tex_immediate:D \tex_pdfextension:D obj ~uncompressed~ + \__pdf_backend_object_write:nn {stream} {{/Type~/Metadata~/Subtype~/XML}{#1}} + } +%</luatex> +%<*pdftex> +\cs_new_protected:Npn \__pdf_backend_metadata_stream:n #1 + { + \group_begin: + \tex_pdfcompresslevel:D 0 \scan_stop: + \tex_immediate:D \tex_pdfobj:D + \__pdf_backend_object_write:nn {stream} {{/Type~/Metadata~/Subtype~/XML}{#1}} + \group_end: + } +%</pdftex> +%<*xdvipdfmx|dvipdfmx|dvips|dvisvgm> +\cs_new_protected:Npn \__pdf_backend_metadata_stream:n #1 + { + \pdf_object_unnamed_write:nn {stream}{{/Type~/Metadata~/Subtype~/XML}{#1}} + } +%</xdvipdfmx|dvipdfmx|dvips|dvisvgm> +% \end{macrocode} % \subsection{lua code for lualatex} % \begin{macrocode} %<*lua> diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx index 399f483a7a1..afc1eebb5d6 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfannot.dtx @@ -23,10 +23,9 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass[full]{l3doc} -\usepackage{array,booktabs,hyperxmp} +\usepackage{array,booktabs} \hypersetup{pdfauthor=The LaTeX Project, pdftitle=l3pdfannot (LaTeX PDF management testphase bundle)} \begin{document} @@ -49,7 +48,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -382,7 +381,7 @@ % This outputs the property list of the dictionary as a list of % |/key value| pairs. % This can be used e.g. when writing a dictionary object with -% \cs{pdf_object_write:nx} +% \cs{pdf_object_write:nnx} % \end{function} % % \begin{variable}[added = 2020-12-28]{\l_pdfannot_F_bitset} @@ -433,7 +432,7 @@ % \begin{macrocode} %<@@=pdfannot> %<*header> -\ProvidesExplPackage{l3pdfannot}{2022-08-24}{0.95r} +\ProvidesExplPackage{l3pdfannot}{2022-09-26}{0.95s} {PDF-annotations} \RequirePackage{l3pdfdict} %</header> diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx index 5a7fba13526..ceba32f4fdb 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfdict.dtx @@ -23,10 +23,9 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass[full]{l3doc} -\usepackage{array,booktabs,hyperxmp} +\usepackage{array,booktabs} \hypersetup{pdfauthor=The LaTeX Project, pdftitle=l3pdfdict (LaTeX PDF management testphase bundle)} @@ -50,7 +49,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -145,7 +144,7 @@ % This outputs the property list of the dictionary as a list of % |/key value| pairs. % This can be used e.g. when writing a dictionary object with -% \cs{pdf_object_write:nx} +% \cs{pdf_object_write:nnx} % \end{function} % % \begin{function}[updated = 2020-12-03] @@ -209,7 +208,7 @@ % \begin{macrocode} %<@@=pdfdict> %<*header> -\ProvidesExplPackage{l3pdfdict}{2022-08-24}{0.95r} +\ProvidesExplPackage{l3pdfdict}{2022-09-26}{0.95s} {Tools for PDF dictionaries (LaTeX PDF management testphase bundle)} %</header> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx index 96e39426af1..c0c574c2a64 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-action.dtx @@ -23,7 +23,6 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} \documentclass[full]{l3doc} \usepackage{array,booktabs,siunitx} @@ -50,7 +49,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -419,12 +418,12 @@ % ,\pdf_name_from_unicode_e:n % ,\pdf_object_if_exist:nTF % ,\pdf_object_if_exist:nF -% ,\pdf_object_new:nn +% ,\pdf_object_new:n % ,\pdf_object_ref:n % ,\pdf_object_ref_last: % ,\pdf_object_unnamed_write:nn % ,\pdf_object_unnamed_write:nx -% ,\pdf_object_write:nn +% ,\pdf_object_write:nnn % ,\pdf_string_from_unicode:nnN % ,\pdfannot_box_ref_last: % ,\pdfannot_dict_put:nnn diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx index ffa2b7ca3ab..3b3d37f6cc1 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-checkbox.dtx @@ -23,7 +23,6 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} \documentclass[full]{l3doc} \usepackage{array,booktabs} @@ -65,7 +64,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -322,11 +321,11 @@ % ,\pdf_name_from_unicode_e:n % ,\pdf_object_if_exist:nTF % ,\pdf_object_if_exist:nF -% ,\pdf_object_new:nn +% ,\pdf_object_new:n % ,\pdf_object_ref:n % ,\pdf_object_ref_last: % ,\pdf_object_unnamed_write:nn -% ,\pdf_object_write:nn +% ,\pdf_object_write:nnn % ,\pdf_string_from_unicode:nnN % ,\pdfannot_box_ref_last: % ,\pdfannot_dict_put:nnn @@ -542,9 +541,9 @@ { \pdf_object_if_exist:nF {@@/checkbox/AP/#1} { - \pdf_object_new:nn {@@/checkbox/AP/#1}{dict} - \pdf_object_write:nx - {@@/checkbox/AP/#1} + \pdf_object_new:n {@@/checkbox/AP/#1} + \pdf_object_write:nnx + {@@/checkbox/AP/#1} { dict } { /Yes ~ \pdfxform_ref:n { #1/Yes} /Off ~ \pdfxform_ref:n { #1/Off} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx index f9991ad304c..de498078c69 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-choice.dtx @@ -23,7 +23,6 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} \documentclass[full]{l3doc} \usepackage{array,booktabs} @@ -50,7 +49,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -366,13 +365,13 @@ % ,\pdf_name_from_unicode_e:n % ,\pdf_object_if_exist:nTF % ,\pdf_object_if_exist:nF -% ,\pdf_object_new:nn +% ,\pdf_object_new:n % ,\pdf_object_ref:n % ,\pdf_object_ref_last: % ,\pdf_object_unnamed_write:nn % ,\pdf_object_unnamed_write:nx -% ,\pdf_object_write:nx -% ,\pdf_object_write:nn +% ,\pdf_object_write:nnx +% ,\pdf_object_write:nnn % ,\pdf_string_from_unicode:nnN % ,\pdfannot_box_ref_last: % ,\pdfannot_dict_put:nnn diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx index 83b90edcddf..3dab822d449 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-pushbutton.dtx @@ -23,7 +23,6 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} \documentclass[full]{l3doc} \usepackage{array,booktabs,siunitx} @@ -56,7 +55,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -348,11 +347,11 @@ % ,\pdf_name_from_unicode_e:n % ,\pdf_object_if_exist:nTF % ,\pdf_object_if_exist:nF -% ,\pdf_object_new:nn +% ,\pdf_object_new:n % ,\pdf_object_ref:n % ,\pdf_object_ref_last: % ,\pdf_object_unnamed_write:nn -% ,\pdf_object_write:nn +% ,\pdf_object_write:nnn % ,\pdf_string_from_unicode:nnN % ,\pdfannot_box_ref_last: % ,\pdfannot_dict_put:nnn diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx index 1551e41fd0c..f0f46ed31b8 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-radiobutton.dtx @@ -23,7 +23,6 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} \documentclass[full]{l3doc} \usepackage{array,booktabs} @@ -84,7 +83,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -516,13 +515,13 @@ % ,\pdf_name_from_unicode_e:n % ,\pdf_object_if_exist:nTF % ,\pdf_object_if_exist:nF -% ,\pdf_object_new:nn +% ,\pdf_object_new:n % ,\pdf_object_ref:n % ,\pdf_object_ref_last: % ,\pdf_object_unnamed_write:nn % ,\pdf_object_unnamed_write:nx -% ,\pdf_object_write:nx -% ,\pdf_object_write:nn +% ,\pdf_object_write:nnx +% ,\pdf_object_write:nnn % ,\pdf_string_from_unicode:nnN % ,\pdfannot_box_ref_last: % ,\pdfannot_dict_put:nnn @@ -691,13 +690,13 @@ % We need an object and a seq for the Opt array. % The object is written at the end of the document. % \begin{macrocode} - \pdf_object_new:nn {@@/field/@@/radio-Opt/#1}{array} + \pdf_object_new:n {@@/field/@@/radio-Opt/#1} \pdfdict_put:nnx { l_@@/field }{Opt} { \pdf_object_ref:n {@@/field/@@/radio-Opt/#1} } \seq_new:c { g_@@_radio_opt_#1_seq } \hook_gput_code:nnn {shipout/lastpage}{pdffield/radio} { - \pdf_object_write:nx - {@@/field/@@/radio-Opt/#1} + \pdf_object_write:nnx + {@@/field/@@/radio-Opt/#1} { array } {\seq_use:cn {g_@@_radio_opt_#1_seq}{~}} } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx index f3497cb8fb6..cd9c7da10e9 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield-textfield.dtx @@ -23,7 +23,6 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} \documentclass[full]{l3doc} \usepackage{array,booktabs} @@ -50,7 +49,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -419,11 +418,11 @@ % ,\pdf_name_from_unicode_e:n % ,\pdf_object_if_exist:nTF % ,\pdf_object_if_exist:nF -% ,\pdf_object_new:nn +% ,\pdf_object_new:n % ,\pdf_object_ref:n % ,\pdf_object_ref_last: % ,\pdf_object_unnamed_write:nn -% ,\pdf_object_write:nn +% ,\pdf_object_write:nnn % ,\pdf_string_from_unicode:nnN % ,\pdfannot_box_ref_last: % ,\pdfannot_dict_put:nnn diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx index 51a81d2f01f..effe1ff41ee 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffield.dtx @@ -23,7 +23,6 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} \documentclass{l3doc} \usepackage{array,booktabs,caption} @@ -70,7 +69,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -921,11 +920,11 @@ % ,\NeedsTeXFormat % ,\pdf_name_from_unicode_e:n % ,\pdf_object_if_exist:nTF -% ,\pdf_object_new:nn +% ,\pdf_object_new:n % ,\pdf_object_ref:n % ,\pdf_object_ref_last: % ,\pdf_object_unnamed_write:nx -% ,\pdf_object_write:nx +% ,\pdf_object_write:nnx % ,\pdf_string_from_unicode:nnN % ,\pdfannot_box_ref_last: % ,\pdfannot_dict_put:nnn @@ -974,7 +973,7 @@ %<*package> %<@@=pdffield> \NeedsTeXFormat{LaTeX2e} -\ProvidesExplPackage{l3pdffield-testphase}{2022-08-24}{0.95r}% +\ProvidesExplPackage{l3pdffield-testphase}{2022-09-26}{0.95s}% {form fields} % \end{macrocode} % \subsection{hyperref specific command} @@ -1167,8 +1166,8 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_field:n #1 { - \pdf_object_new:nn {@@/field/#1} {dict} - \pdf_object_new:nn {@@/field/Kids/#1} {array} + \pdf_object_new:n {@@/field/#1} + \pdf_object_new:n {@@/field/Kids/#1} \tl_if_empty:NTF \l_@@_currentparent_tl { \pdfmanagement_add:nnx @@ -1220,12 +1219,12 @@ } \hook_gput_code:nnn {shipout/lastpage}{pdffield} %xetex needs this ... { - \pdf_object_write:nx {@@/field/Kids/#1} + \pdf_object_write:nnx {@@/field/Kids/#1} { array } { \seq_use:cn{g_@@_field/Kids/#1_seq}{~} } } - \pdf_object_write:nx {@@/field/#1} { \pdfdict_use:n {l_@@/field} } + \pdf_object_write:nnx {@@/field/#1} { dict } { \pdfdict_use:n {l_@@/field} } } \hook_gput_code:nnn {shipout/lastpage}{pdffield} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx index 5527a4e1281..257ed6a6f23 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdffile.dtx @@ -23,10 +23,9 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass[full]{l3doc} -\usepackage{array,booktabs,hyperxmp} +\usepackage{array,booktabs} \hypersetup{pdfauthor=The LaTeX Project,pdftitle=l3pdffile (LaTeX PDF management testphase bundle)} \usepackage{caption} \providecommand\potentialclash{\noindent\llap{\dbend\ }} @@ -50,7 +49,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -177,7 +176,7 @@ % Embedding an existing file is in most cases quite straightforward. This module % offers commands, but it can also be done with the basic commands % from the |l3pdf| module \cs{pdf_object_unnamed_write:nn} or -% \cs{pdf_object_new:nn}/\cs{pdf_object_write:nn} or primitive commands +% \cs{pdf_object_new:n}/\cs{pdf_object_write:nnn} or primitive commands % to create objects. % The object number should be stored for the reference % in the |/Filespec| dictionary. @@ -335,7 +334,7 @@ % created stream. % % \begin{verbatim} -% \pdf_object_new:nn{module/filespec/A}{dict} % a new filespec object +% \pdf_object_new:n {module/filespec/A} % a new filespec object % \pdf_object_ref:n {module/filespec/A} % a reference % \pdf_object_unnamed_write:nn { stream }{ {...}{content} } %writing the stream % % filling and writing the filespec dictionary: @@ -397,7 +396,7 @@ % % \begin{macrocode} %<*header> -\ProvidesExplPackage{l3pdffile}{2022-08-24}{0.95r} +\ProvidesExplPackage{l3pdffile}{2022-09-26}{0.95s} {embedding and referencing files in PDF---LaTeX PDF management testphase bundle} \RequirePackage{l3pdftools} %temporarly!! %</header> @@ -645,7 +644,7 @@ \@@_filename_convert_to_print:nN { #2 } \l_@@_tmpa_str \pdfdict_put:nnx {l_pdffile/Filespec}{F} { \l_@@_tmpa_str } \pdfdict_put:nnx {l_pdffile/Filespec}{UF}{ \l_@@_tmpa_str } - \pdf_object_write:nx { #1 } + \pdf_object_write:nnx { #1 } { dict } { \pdfdict_use:n { l_pdffile/Filespec} \tl_if_empty:nF { #3 } @@ -704,7 +703,7 @@ } \tl_if_blank:nTF { #2 } { - \pdf_object_new:nn { #3 } {dict} + \pdf_object_new:n { #3 } \exp_args:Nnnx \@@_filespec_write:nnn %#1 dict, #2 target file name, #3 object ref @@ -713,7 +712,7 @@ {\l_@@_embed_ref_tl} } { - \pdf_object_new:nn { #3 } {dict} + \pdf_object_new:n { #3 } \exp_args:Nnnx \@@_filespec_write:nnn %#1 dict, #2 target file name, #3 object ref @@ -747,7 +746,7 @@ { #1 } \l_@@_automimetype_tl \tl_set:Nx \l_@@_embed_ref_tl { \pdf_object_ref_last: } - \pdf_object_new:nn { #3 } {dict} + \pdf_object_new:n { #3 } \exp_args:Nnxx \@@_filespec_write:nnn %#1 dict, #2 target file name, #3 object ref diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx index 63865b46273..a2ece6cbcdf 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmanagement.dtx @@ -23,11 +23,10 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass[full]{l3doc} \usepackage{tabularx} -\usepackage{array,booktabs,hyperxmp} +\usepackage{array,booktabs} \hypersetup{pdfauthor=The LaTeX Project,pdftitle=l3pdfmanagement (LaTeX PDF management testphase bundle)} \providecommand\potentialclash{\noindent\llap{\dbend\ }} @@ -58,7 +57,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -538,8 +537,8 @@ % The value is an object reference. It is sensible to declare the object % first. E.g. % \begin{verbatim} -% \pdf_object_new:nn {module/intent}{dict} -% \pdf_object_write:nn {module/intent}{...} +% \pdf_object_new:n {module/intent} +% \pdf_object_write:nnn {module/intent}{dict}{...} % \pdfmanagement_add:nnx {Catalog} {OutputIntents}{\pdf_object_ref:n {module/intent}} % \end{verbatim} % @@ -633,7 +632,7 @@ %<@@=pdfmanagement> %<*header> % -\ProvidesExplPackage{l3pdfmanagement}{2022-08-24}{0.95r} +\ProvidesExplPackage{l3pdfmanagement}{2022-09-26}{0.95s} {Management of core PDF dictionaries (LaTeX PDF management testphase bundle)} %</header> % \end{macrocode} @@ -1279,9 +1278,9 @@ \prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AA } } { - \pdf_object_new:nn { @@/Catalog/AA } { dict } - \pdf_object_write:nx - { @@/Catalog/AA } + \pdf_object_new:n { @@/Catalog/AA } + \pdf_object_write:nnx + { @@/Catalog/AA }{ dict } { \pdfdict_use:n { g__pdf_Core/Catalog/AA } } \exp_args:Nnx \__pdf_backend_catalog_gput:nn @@ -1309,9 +1308,9 @@ { \seq_if_empty:cF { g_@@_/Catalog/AcroForm/Fields_seq } { - \pdf_object_new:nn { @@/Catalog/AcroForm/Fields } { array } - \pdf_object_write:nx - { @@/Catalog/AcroForm/Fields } + \pdf_object_new:n { @@/Catalog/AcroForm/Fields } + \pdf_object_write:nnx + { @@/Catalog/AcroForm/Fields } { array } { \seq_use:cn { g_@@_/Catalog/AcroForm/Fields_seq } {~} } \exp_args:Nnnx \prop_gput:cnn %we have to use \prop here to avoid the handler ... @@ -1321,10 +1320,9 @@ } \seq_if_empty:cF { g_@@_/Catalog/AcroForm/CO_seq } { - \pdf_object_new:nn { @@/Catalog/AcroForm/CO } { array } - \exp_args:Nnx - \pdf_object_write:nn - { @@/Catalog/AcroForm/CO } + \pdf_object_new:n { @@/Catalog/AcroForm/CO } + \pdf_object_write:nnx + { @@/Catalog/AcroForm/CO } { array } { \seq_use:cn { g_@@_/Catalog/AcroForm/CO_seq } {~} } \exp_args:Nnnx \prop_gput:cnn %we have to use \prop here to avoid the handler ... @@ -1334,10 +1332,9 @@ } \prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AcroForm/DR/Font}} { - \pdf_object_new:nn { @@/Catalog/AcroForm/DR/Font } {dict} - \exp_args:Nnx - \pdf_object_write:nn - { @@/Catalog/AcroForm/DR/Font } + \pdf_object_new:n { @@/Catalog/AcroForm/DR/Font } + \pdf_object_write:nnx + { @@/Catalog/AcroForm/DR/Font } { dict } { \pdfdict_use:n { g__pdf_Core/Catalog/AcroForm/DR/Font } } \exp_args:Nnnx \prop_gput:cnn %we have to use \prop here to avoid the handler ... @@ -1347,10 +1344,9 @@ } \prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AcroForm/DR}} { - \pdf_object_new:nn { @@/Catalog/AcroForm/DR } {dict} - \exp_args:Nnx - \pdf_object_write:nn - { @@/Catalog/AcroForm/DR } + \pdf_object_new:n { @@/Catalog/AcroForm/DR } + \pdf_object_write:nnx + { @@/Catalog/AcroForm/DR } { dict } { \pdfdict_use:n { g__pdf_Core/Catalog/AcroForm/DR } } \exp_args:Nnnx \prop_gput:cnn %we have to use \prop here to avoid the handler ... @@ -1360,10 +1356,9 @@ } \prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/AcroForm} } { - \pdf_object_new:nn { @@/Catalog/AcroForm } {dict} - \exp_args:Nnx - \pdf_object_write:nn - { @@/Catalog/AcroForm } + \pdf_object_new:n { @@/Catalog/AcroForm } + \pdf_object_write:nnx + { @@/Catalog/AcroForm } { dict } { \pdfdict_use:n { g__pdf_Core/Catalog/AcroForm } } \exp_args:Nnnx \@@_handler_gput:nnn @@ -1385,10 +1380,9 @@ \seq_if_empty:cF { g_@@_/Catalog/AF_seq } { - \pdf_object_new:nn { @@/Catalog/AF } { array } - \exp_args:Nnx - \pdf_object_write:nn - { @@/Catalog/AF } + \pdf_object_new:n { @@/Catalog/AF } + \pdf_object_write:nnx + { @@/Catalog/AF } { array } { \seq_use:cn { g_@@_/Catalog/AF_seq } {~} } \exp_args:Nnx \__pdf_backend_catalog_gput:nn @@ -1409,11 +1403,10 @@ \prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/MarkInfo } } { - \pdf_object_new:nn { @@/Catalog/MarkInfo } { dict } - \exp_args:Nnx - \pdf_object_write:nn - { @@/Catalog/MarkInfo } - { \pdfdict_use:n { g__pdf_Core/Catalog/MarkInfo } } + \pdf_object_new:n { @@/Catalog/MarkInfo } + \pdf_object_write:nnx + { @@/Catalog/MarkInfo } { dict } + { \pdfdict_use:n { g__pdf_Core/Catalog/MarkInfo } } \exp_args:Nnx \__pdf_backend_catalog_gput:nn {MarkInfo} @@ -1450,11 +1443,10 @@ > { 0 } { - \pdf_object_new:nn { @@/Catalog/OCProperties } { dict } + \pdf_object_new:n { @@/Catalog/OCProperties } \seq_gpop_left:cN { g_@@_/Catalog/OCProperties/Configs_seq} \l_@@_tmpa_tl - \exp_args:Nnx - \pdf_object_write:nn {@@/Catalog/OCProperties} - { + \pdf_object_write:nnx {@@/Catalog/OCProperties} {dict} + { /OCGs~[ \seq_use:cn { g_@@_/Catalog/OCProperties/OCGs_seq } {~} ] /D~\l_@@_tmpa_tl~ \seq_if_empty:cF { g_@@_/Catalog/OCProperties/Configs_seq } @@ -1462,7 +1454,7 @@ /Configs~ [ \seq_use:cn { g_@@_/Catalog/OCProperties/Configs_seq} {~} ] } - } + } \exp_args:Nnx \__pdf_backend_catalog_gput:nn { OCProperties } @@ -1481,10 +1473,9 @@ \seq_if_empty:cF { g_@@_/Catalog/OutputIntents_seq } { - \pdf_object_new:nn { @@/Catalog/OutputIntents } { array } - \exp_args:Nnx - \pdf_object_write:nn - { @@/Catalog/OutputIntents } + \pdf_object_new:n { @@/Catalog/OutputIntents } + \pdf_object_write:nnx + { @@/Catalog/OutputIntents } { array } { \seq_use:cn { g_@@_/Catalog/OutputIntents_seq } {~} } \exp_args:Nnx \__pdf_backend_catalog_gput:nn @@ -1506,10 +1497,9 @@ \seq_if_empty:cF { g_@@_/Catalog/Requirements_seq } { - \pdf_object_new:nn { @@/Catalog/Requirements } { array } - \exp_args:Nnx - \pdf_object_write:nn - { @@/Catalog/Requirements } + \pdf_object_new:n { @@/Catalog/Requirements } + \pdf_object_write:nnx + { @@/Catalog/Requirements } { array } { \seq_use:cn { g_@@_/Catalog/Requirements_seq } {~} } \exp_args:Nnx \__pdf_backend_catalog_gput:nn @@ -1531,10 +1521,9 @@ \prop_if_empty:cF { \__kernel_pdfdict_name:n { g__pdf_Core/Catalog/ViewerPreferences } } { - \pdf_object_new:nn { @@/Catalog/ViewerPreferences } { dict } - \exp_args:Nnx - \pdf_object_write:nn - { @@/Catalog/ViewerPreferences } + \pdf_object_new:n { @@/Catalog/ViewerPreferences } + \pdf_object_write:nnx + { @@/Catalog/ViewerPreferences } { dict } { \pdfdict_use:n { g__pdf_Core/Catalog/ViewerPreferences } } \exp_args:Nnx \__pdf_backend_catalog_gput:nn diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx index d284c399a9d..8e83708d886 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfmeta.dtx @@ -23,10 +23,9 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass[full]{l3doc} -\usepackage{array,booktabs,hyperxmp} +\usepackage{array,booktabs} \hypersetup{pdfauthor=The LaTeX Project,pdftitle=l3pdfmeta (LaTeX PDF management testphase bundle)} \begin{document} @@ -50,7 +49,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -372,6 +371,193 @@ % It also sets the seed for random functions. % \end{function} % +% \section{XMP-metadata} +% XMP-metadata are data in XML format embedded in a stream +% inside the PDF and referenced from the |/Catalog|. +% Such a XMP-metadata stream contains various document related data, +% is required by various PDF standards and can replace +% or extend the data in the |/Info| dictionary. +% In PDF 2.0 the /Info dictionary is actually deprecated +% and only XMP-metadata should be used for the metadata of the PDF. +% +% The content of a XMP-metadata stream is not a fix set of data. +% Typically fields like the title, the author, the language and keywords will +% be there. But standards like e.g. ZUGferd (a standard for electronic bills) +% can require to add more fields, and it is also possible +% to define and add purely local data. +% +% In some workflows (e.g. if dvips + ghostscript is used) +% a XMP-metadata stream with some standard content is added automatically by +% the backend, but normally it must be created with code. +% +% For this task the packages \pkg{hyperxmp}, \pkg{xmpincl} or \pkg{pdfx} +% (which uses \pkg{xmpincl}) +% can be used, but all these packages are not compatible with the +% pdfmanagement\footnote{\pkg{hyperxmp} was partly compatible as the pdfmanagement +% contained some patches for it, but these patches have now been removed.}. +% The following code is meant as replacement for these packages. +% +% \pkg{hyperxmp} uses |\hypersetup| as user interface to enter the XMP-metadata. +% This syntax is also supported by the new code\footnote{with a number of changes which +% are discussed in more details below}, so if \pkg{hyperref} +% has been loaded, e.g. |pdftitle=xxx| can be used to set the title. +% But XMP-metadata shouldn't require to use \pkg{hyperref} and in a future +% version an interface without \pkg{hyperref} will be added. +% +% There is currently no full user interface command to extend the XMP-metadata +% with for example the code needed for ZUGferd, +% they will be added in a second step. +% +% +% \subsection{Encoding and escaping} +% +% XMP-metadata are stored as UTF-8 in the PDF. This mean if you open a PDF in an editor +% a content like \enquote{grüße} will be shown probably as \enquote{grüße}. +% As XMP-metadata are in XML format special chars like |<|, |>|, and |&| and +% \texttt{\textquotestraightdblbase} must be escaped. +% +% \pkg{hyperxmp} hooks into \pkg{hyperref} and passes all +% input through |\pdfstringdef|. This means a word like +% \enquote{hallo} is first converted by |\pdfstringdef| into\\ +% |\376\377\000h\000a\000l\000l\000o| and then back to UTF-8 by +% \pkg{hyperxmp} and in the course of this action +% the XML-escapings are applied. +% \pkg{pdfx} uses |\pdfstringdef| together with +% a special fontencoding (similar to the PU-encoding of \pkg{hyperref}) +% for a similar aim. +% The code here is based on |\text_purify:n| followed by a few replacements for the +% escaping. +% +% User data should normally be declared in the preamble (or even in the +% |\DocumentMetadata| command), and consist of rather simple text; |&| can be entered +% as |\&| (but directly |&| will normally work too), +% babel shorthands should not be used. Some datas are interpreted as comma lists, +% in this cases commas which are part of the text should be protected by braces. +% In some cases a text in brackets like |[en]| is interpreted as language tag, +% if they are part of a text they should be protected by braces too. +% XMP-metadata are stored uncompressed in the PDF so if you are unsure +% if a value has +% been passed correctly, open the PDF in an editor, copy the whole block and +% pass it to a validator, e.g. \url{https://www.w3.org/RDF/Validator/}. +% +% \subsection{User interfaces and differences to \pkg{hyperxmp} } +% +% \subsubsection{PDF standards} +% +% The \pkg{hyperxmp}/\pkg{hyperref} keys |pdfapart|, |pdfaconformance|, |pdfuapart|, +% |pdfxstandard| and |pdfa| are ignored by this code. Standards must be set with the +% |pdfstandard| key of |\DocumentMetadata|. This key can be used more than once, +% e.g. \\ +% |pdfstandard=A-2b,pdfstandard=X-4,pdfstandard=UA-1|. +% \\ Note that using these +% keys doesn't mean that the document actually follows the standard. \LaTeX{} +% can neither ensure nor check all requirements of a standard, and not everything +% it can do theoretically has already been implemented. +% When setting an |A| standard, the code will e.g. insert a color profile and +% warn if the PDF version doesn't fit, but |X| and |UA| currently only +% adds the relevant declarations to the XMP-metadata. +% It is up to the author to ensure and validate +% that the document actually follows the standard. +% +% \subsubsection{Dates} +% \begin{itemize} +% \item +% The dates |xmp:CreateDate|, |xmp:ModifyDate|, |xmp:MetadataDate| +% are normally set automatically to the current date/time when the compilation +% started. If they should be changed +% (e.g. for regression tests to produce reproducible documents) they can +% be set with |\hypersetup| with the keys +% |pdfcreationdate|, |pdfmoddate| and |pdfmetadate|. +% +% \begin{verbatim} +% \hypersetup{pdfcreationdate=D:20010101205959-00'00'} +% \end{verbatim} +% +% The format should be a full date/time in PDF format, so one of these (naturally +% the numbers can change): +% \begin{verbatim} +% D:20010101205959-00'00' +% D:20010101205959+00'00' +% D:20010101205959Z +% \end{verbatim} +% +% \item The date |dc:date| is an \enquote{author date} and so +% should normally be set to the same date as +% given by |\date|. This can be done with the key |pdfdate|\footnote{Extracting +% the value automatically from \texttt{\textbackslash date} is not really possible +% as authors often put formatting or additional info in this command.}. +% The value should be a date in ISO 8601 format: +% +% \begin{verbatim} +% 2022 %year +% 2022-09-04 %year-month-day +% 2022-09-04T19:20 %year-month-day hour:minutes +% 2022-09-04T19:20:30 % year-month-day hour:minutes:second +% 2022-09-04T19:20:30.45 % year-month-day hour:minutes:second with fraction +% 2022-09-04T19:20+01:00 % with time zone designator +% 2022-09-04T19:20-02:00 % time zone designator +% 2022-09-04T19:20Z % time zone designator +% \end{verbatim} +% +% It is also possible to give the date as a full date in PDF format as described +% above. If not set the current date/time is used. +%\end{itemize} +% +% \subsection{Language} +% The code assumes that a default language is always declared +% (as the pdfmanagement gives the |/Lang| entry in the catalog a default value) +% This language can be changed with the |\DocumentMetadata| key |lang| (preferred) +% but the \pkg{hyperref} key |pdflang| is also honored. Its value should be a +% simple language tag like |de| or |de-DE|. +% +% The main language is also used in a number of attributes in the XMP data, +% if wanted a different language can be set here with the +% \pkg{hyperref}/\pkg{hyperxmp} key |pdfmetalang|. +% +% A number of entries can be given a language tag. Such a language is +% given by using an \enquote{optional argument} before the text: +% +% \begin{verbatim} +% \hypersetup{pdftitle={[en]english,[de]deutsch}} +% \hypersetup{pdfsubtitle={[en]subtitle in english}} +% \end{verbatim} +% +% \subsection{Rights} +% The keys |pdfcopyright| and |pdflicenseurl| work similar as in \pkg{hyperxmp}. +% But differently to \pkg{hyperxmp} the code doesn't set the |xmpRights:Marked| +% property, as I have some doubts that one deduce its value simply +% by checking if the other keys have been used; if needed it should be added manually. +% +% \subsection{PDF related data} +% The PDF producer is for all engines by default built from the engine +% name and the engine version and doesn't use the banners as with \pkg{hyperxmp} +% and \pkg{pdfx}, it can be set manually with the |pdfproducer| key. +% +% The key |pdftrapped| is ignored. |Trapped| is deprecated in PDF 2.0. +% +% \subsection{Document data} +% +% The authors should be given with the |pdfauthor| key, separated by commas. If an +% author contains a comma, protect/hide it by a brace. + +% \subsection{User commands} +% The XMP-meta data are added automatically. This can be suppressed with the +% |\DocumentMetadata| key |xmp|. +% +% \begin{function}{\pdfmeta_xmp_add:n} +% \begin{syntax} +% \cs{pdfmeta_xmp_add:n}\Arg{XML} +% \end{syntax} +% With this command additional XML code can be added to the Metadata. +% The content is added unchanged, and not sanitized. +% \end{function} +% \begin{function}{\pdfmeta_xmp_xmlns_new:nn} +% \begin{syntax} +% \cs{pdfmeta_xmp_xmlns_new:nn}\Arg{prefix}\Arg{uri} +% \end{syntax} +% With this command a xmlns name space can be added. +% \end{function} +% % \end{documentation} % % \begin{implementation} @@ -381,7 +567,7 @@ % \begin{macrocode} %<@@=pdfmeta> %<*header> -\ProvidesExplPackage{l3pdfmeta}{2022-08-24}{0.95r} +\ProvidesExplPackage{l3pdfmeta}{2022-09-26}{0.95s} {PDF-Standards---LaTeX PDF management testphase bundle} %</header> % \end{macrocode} @@ -395,11 +581,15 @@ \msg_new:nnn {pdf }{wrong-pdfversion} {PDF~version~#1~is~too~#2~for~standard~'#3'.} % \end{macrocode} -% \begin{variable}{\l_@@_tmpa_tl,\l_@@_tmpb_tl,\l_@@_tmpa_str} +% \begin{variable}{\l_@@_tmpa_tl,\l_@@_tmpb_tl,\l_@@_tmpa_str, +% \g_@@tmpa_str,\l_@@_tmpa_seq,\l_@@_tmpb_seq} % \begin{macrocode} -\tl_new:N\l_@@_tmpa_tl -\tl_new:N\l_@@_tmpb_tl +\tl_new:N \l_@@_tmpa_tl +\tl_new:N \l_@@_tmpb_tl \str_new:N \l_@@_tmpa_str +\str_new:N \g_@@_tmpa_str +\seq_new:N \l_@@_tmpa_seq +\seq_new:N \l_@@_tmpb_seq % \end{macrocode} % \end{variable} % \subsection{Standards (work in progress)} @@ -889,8 +1079,8 @@ { \pdf_object_if_exist:nF { __color_icc_ #1 } { - \pdf_object_new:nn { __color_icc_ #1 }{fstream} - \pdf_object_write:nx { __color_icc_ #1 } + \pdf_object_new:n { __color_icc_ #1 } + \pdf_object_write:nnx { __color_icc_ #1 } { fstream } { {/N\c_space_tl \prop_item:cn{c_@@_colorprofile_#1}{N} @@ -982,6 +1172,1376 @@ \cs_new_protected:Npn \pdfmeta_set_regression_data: { \__pdf_backend_set_regression_data: } % \end{macrocode} +% +% \section{XMP-Metadata implementation} + +% \begin{variable}{\g_@@_xmp_bool} +% This boolean decides if the metadata are included +% \begin{macrocode} +\bool_new:N\g_@@_xmp_bool +\bool_gset_true:N \g_@@_xmp_bool +% \end{macrocode} +% \end{variable} +% Preset the two fields to avoid problems with standards. +% \begin{macrocode} +\hook_gput_code:nnn{pdfmanagement/add}{pdfmanagement} + { + \pdfmanagement_add:nnx {Info}{Producer}{(\c_sys_engine_exec_str-\c_sys_engine_version_str)} + \pdfmanagement_add:nnx {Info}{Creator}{(LaTeX)} + } +% \end{macrocode} +% \subsection{New document keys} +% \begin{macrocode} +\keys_define:nn { document / metadata } + { + _pdfstandard / X-4 .code:n = + {\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-4}}, + _pdfstandard / X-4p .code:n = + {\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-4p}}, + _pdfstandard / X-5g .code:n = + {\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-5g}}, + _pdfstandard / X-5n .code:n = + {\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-5n}}, + _pdfstandard / X-5pg .code:n = + {\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-5pg}}, + _pdfstandard / X-6 .code:n = + {\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-6p}}, + _pdfstandard / X-6n .code:n = + {\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-6n}}, + _pdfstandard / X-6p .code:n = + {\AddToDocumentProperties [document]{pdfstandard-X}{PDF/X-6p}}, + _pdfstandard / UA-1 .code:n = + {\AddToDocumentProperties [document]{pdfstandard-UA}{1}}, + xmp .bool_gset:N = \g_@@_xmp_bool + } +% \end{macrocode} +% \subsection{Messages} +% \begin{macrocode} +\msg_new:nnn{pdfmeta}{namespace-defined}{The~xmlns~namespace~`#1`~is~already~declared} +% \end{macrocode} +% \subsection{Some helper commands} +% \subsubsection{Generate a BOM} +% \begin{macro}{\@@_xmp_generate_bom:} +% \begin{macrocode} +\bool_lazy_or:nnTF + { \sys_if_engine_luatex_p: } + { \sys_if_engine_xetex_p: } + { + \cs_new:Npn \@@_xmp_generate_bom: + { \char_generate:nn {"FEFF}{12} } + } + { + \cs_new:Npn \@@_xmp_generate_bom: + { + \char_generate:nn {"EF}{12} + \char_generate:nn {"BB}{12} + \char_generate:nn {"BF}{12} + } + } +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Indentation} +% We provide a command which indents the xml based +% on a counter, and one which accepts a fix number. +% The counter can be increased and decreased. +% +% \begin{variable}{\l_@@_xmp_indent_int} +% \begin{macrocode} +\int_new:N \l_@@_xmp_indent_int +% \end{macrocode} +% \end{variable} +% \begin{macro}{\@@_xmp_indent:, +% \@@_xmp_indent:n, +% \@@_xmp_incr_indent:, +% \@@_xmp_decr_indent:} +% \begin{macrocode} +\cs_new:Npn \@@_xmp_indent: + { + \iow_newline: + \prg_replicate:nn {\l_@@_xmp_indent_int}{\c_space_tl} + } + +\cs_new:Npn \@@_xmp_indent:n #1 + { + \iow_newline: + \prg_replicate:nn {#1}{\c_space_tl} + } + +\cs_new_protected:Npn \@@_xmp_incr_indent: + { + \int_incr:N \l_@@_xmp_indent_int + } + +\cs_new_protected:Npn \@@_xmp_decr_indent: + { + \int_decr:N \l_@@_xmp_indent_int + } +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Date and time handling} +% If the date is given in PDF format we have to split it to create +% the XMP format. We use a precompiled regex for this. +% To some extend the regex can also handle incomplete dates. +% +% \begin{variable}{\l_@@_xmp_date_regex} +% \begin{macrocode} +\regex_new:N \l_@@_xmp_date_regex +\regex_set:Nn \l_@@_xmp_date_regex + {D:(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?(\d{2})?([Z\+\-])?(?:(\d{2})\')?(?:(\d{2})\')?} +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\@@_xmp_date_split:nN} +% This command takes a date in PDF format, splits it with the regex and +% stores the captures in a sequence. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_date_split:nN #1 #2 %#1 date, #2 seq + { + \regex_split:NnN \l_@@_xmp_date_regex {#1} #2 + } +\cs_generate_variant:Nn \@@_xmp_date_split:nN {VN,eN} +% \end{macrocode} +% \end{macro} + +% \begin{macro}[EXP]{\@@_xmp_print_date:N} +% This prints the date stored in a sequence as created +% by the previous command. +% +% \begin{macrocode} +\cs_new:Npn\@@_xmp_print_date:N #1 % seq + { + \tl_if_blank:eTF { \seq_item:Nn #1 {1} } + { + \seq_item:Nn #1 {2} %year + - + \seq_item:Nn #1 {3} %month + - + \seq_item:Nn #1 {4} % day + \tl_if_blank:eF + { \seq_item:Nn #1 {5} } + { T \seq_item:Nn #1 {5} } %hour + \tl_if_blank:eF + { \seq_item:Nn #1 {6} } + { : \seq_item:Nn #1 {6} } %minutes + \tl_if_blank:eF + { \seq_item:Nn #1 {7} } + { : \seq_item:Nn #1 {7} } %seconds + \seq_item:Nn #1 {8} %Z,+,- + \seq_item:Nn #1 {9} + \tl_if_blank:eF + { \seq_item:Nn #1 {10} } + { : \seq_item:Nn #1 {10} } + } + { + \seq_item:Nn #1 {1} + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{variable}{\l_@@_xmp_currentdate_tl,\l_@@_xmp_currentdate_seq} +% The tl var contains the date of the log-file in PDF format, +% the seq the result splitted with the regex. +% \begin{macrocode} +\tl_new:N \l_@@_xmp_currentdate_tl +\seq_new:N \l_@@_xmp_currentdate_seq +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\@@_xmp_date_get:nNN} +% This checks a document property and if empty uses the current date. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_date_get:nNN #1 #2 #3 + %#1 property, #2 tl var with PDF date, #3 seq for splitted date + { + \tl_set:Nx #2 { \GetDocumentProperties{#1} } + \tl_if_blank:VTF #2 + { + \seq_set_eq:NN #3 \l_@@_xmp_currentdate_seq + \tl_set_eq:NN #2 \l_@@_xmp_currentdate_tl + } + { + \@@_xmp_date_split:VN #2 #3 + } + } +% \end{macrocode} +% \end{macro} +% \subsubsection{UUID} +% We need a command to generate an uuid +% \begin{macro}{\@@_xmp_create_uuid:nN} +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_create_uuid:nN #1 #2 + { + \str_set:Nx#2 {\str_lowercase:f{\tex_mdfivesum:D{#1}}} + \str_set:Nx#2 + { uuid: + \str_range:Nnn #2{1}{8} + -\str_range:Nnn#2{9}{12} + -4\str_range:Nnn#2{13}{15} + -8\str_range:Nnn#2{16}{18} + -\str_range:Nnn#2{19}{30} + } + } +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Purifying and escaping of strings} +% +% \begin{macro}{\@@_xmp_sanitize:nN} +% We have to sanitize the user input. For this we pass +% it through |\text_purify| and then replace a few special chars. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_sanitize:nN #1 #2 +%#1 input string, #2 str with the output + { + \group_begin: + \text_declare_purify_equivalent:Nn \& {\tl_to_str:N & } + \text_declare_purify_equivalent:Nn \texttilde {\c_tilde_str} + \tl_set:Nx \l_@@_tmpa_tl { \text_purify:n {#1} } + \str_gset:Nx \g_@@_tmpa_str { \tl_to_str:N \l_@@_tmpa_tl } + \str_greplace_all:Nnn\g_@@_tmpa_str {&}{&} + \str_greplace_all:Nnn\g_@@_tmpa_str {<}{<} + \str_greplace_all:Nnn\g_@@_tmpa_str {>}{>} + \str_greplace_all:Nnn\g_@@_tmpa_str {"}{"} + \group_end: + \str_set_eq:NN #2 \g_@@_tmpa_str + } + +\cs_generate_variant:Nn\@@_xmp_sanitize:nN {VN} +% \end{macrocode} +% \end{macro} +% +% \subsection{Language handling} +% The language of the metadata is used in various attributes, so we store it in +% command. +% \begin{variable}{\l_@@_xmp_doclang_tl,\l_@@_xmp_metalang_tl} +% \begin{macrocode} +\tl_new:N \l_@@_xmp_doclang_tl +\tl_new:N \l_@@_xmp_metalang_tl +% \end{macrocode} +% \end{variable} +% +% The language is retrieved at the start of the packet. We assume that +% |lang| is always set and so don't use the |x-default| value of \pkg{hyperxmp}. +% +% \begin{variable}{\l_@@_xmp_lang_regex} +% \begin{macrocode} +\regex_new:N\l_@@_xmp_lang_regex +\regex_set:Nn\l_@@_xmp_lang_regex {\A\[([A-Za-z\-]+)\](.*)} +% \end{macrocode} +% \end{variable} +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_lang_get:nNN #1 #2 #3 +% #1 text, #2 tl var for lang match (or default), #3 tl var for text + { + \regex_extract_once:NnN \l_@@_xmp_lang_regex {#1}\l_@@_tmpa_seq + \seq_if_empty:NTF \l_@@_tmpa_seq + { + \tl_set:Nn #2 \l_@@_xmp_metalang_tl + \tl_set:Nn #3 {#1} + } + { + \tl_set:Nx #2 {\seq_item:Nn\l_@@_tmpa_seq{2}} + \tl_set:Nx #3 {\seq_item:Nn\l_@@_tmpa_seq{3}} + } + } +\cs_generate_variant:Nn \@@_xmp_lang_get:nNN {eNN,VNN} +% \end{macrocode} +% + + +% \subsection{Filling the packet} +% This tl var that holds the whole packet +% \begin{variable}{\g_@@_xmp_packet_tl} +% \begin{macrocode} +\tl_new:N \g_@@_xmp_packet_tl +% \end{macrocode} +% \end{variable} +% +% \subsubsection{Helper commands to add lines and lists} +% +% \begin{macro}{\@@_xmp_add_packet_chunk:n} +% This is the most basic command. +% It is meant to produce a line and will use the current indent. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_add_packet_chunk:n #1 + { + \tl_gput_right:Nx\g_@@_xmp_packet_tl + { + \@@_xmp_indent: \exp_not:n{#1} + } + } +\cs_generate_variant:Nn \@@_xmp_add_packet_chunk:n {e} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\@@_xmp_add_packet_chunk:nN} +% This is the most basic command. +% It is meant to produce a line and will use the current indent. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_add_packet_chunk:nN #1 #2 + { + \tl_put_right:Nx#2 + { + \@@_xmp_indent: \exp_not:n{#1} + } + } +\cs_generate_variant:Nn \@@_xmp_add_packet_chunk:nN {eN} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\@@_xmp_add_packet_open:nn} +% This commands opens a xml structure and increases the indent. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_add_packet_open:nn #1 #2 %#1 prefix #2 name + { + \@@_xmp_add_packet_chunk:n {<#1:#2>} + \@@_xmp_incr_indent: + } +\cs_generate_variant:Nn \@@_xmp_add_packet_open:nn {ne} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\@@_xmp_add_packet_open_attr:nnn} +% This commands opens a xml structure too but allows also to give an +% attribute. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_add_packet_open_attr:nnn #1 #2 #3 + %#1 prefix #2 name #3 attr + { + \@@_xmp_add_packet_chunk:n {<#1:#2~#3>} + \@@_xmp_incr_indent: + } +\cs_generate_variant:Nn \@@_xmp_add_packet_open_attr:nnn {nne} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\@@_xmp_add_packet_close:nn} +% This closes a structure and decreases the indent. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_add_packet_close:nn #1 #2 %#1 prefix #2:name + { + \@@_xmp_decr_indent: + \@@_xmp_add_packet_chunk:n {</#1:#2>} + } +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@@_xmp_add_packet_line:nnn} +% This will produce a full line with open and closing xml. +% The content is sanitized. We test if there is content to be +% able to suppress data which has not be set. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_add_packet_line:nnn #1 #2 #3 + %#1 prefix #2 name #3 content + { + \tl_if_blank:nF {#3} + { + \@@_xmp_sanitize:nN {#3}\l_@@_tmpa_str + \@@_xmp_add_packet_chunk:e {<#1:#2>\l_@@_tmpa_str</#1:#2>} + } + } +\cs_generate_variant:Nn \@@_xmp_add_packet_line:nnn {nne,nnV,nee} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@@_xmp_add_packet_line:nnnN} +% This will produce a full line with open and closing xml and store it in +% the given tl-var. This allows to prebuild blocks and then to test if there are empty. +% The content is sanitized. We test if there is content to be +% able to suppress data which has not be set. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_add_packet_line:nnnN #1 #2 #3 #4 + %#1 prefix #2 name #3 content #4 tl_var to prebuilt. + { + \tl_if_blank:nF {#3} + { + \@@_xmp_sanitize:nN {#3}\l_@@_tmpa_str + \@@_xmp_add_packet_chunk:eN {<#1:#2>\l_@@_tmpa_str</#1:#2>} #4 + } + } +\cs_generate_variant:Nn \@@_xmp_add_packet_line:nnnN {nneN} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@@_xmp_add_packet_line_attr:nnnn} +% A similar command with attribute +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_add_packet_line_attr:nnnn #1 #2 #3 #4 + %#1 prefix #2 name #3 attribute #4 content + { + \tl_if_blank:nF {#4} + { + \@@_xmp_sanitize:nN {#4}\l_@@_tmpa_str + \@@_xmp_add_packet_chunk:e {<#1:#2~#3>\l_@@_tmpa_str</#1:#2>} + } + } +\cs_generate_variant:Nn \@@_xmp_add_packet_line_attr:nnnn {nnee,nneV} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_xmp_add_packet_line_default:nnnn} +% \begin{macrocode} + \cs_new_protected:Npn \@@_xmp_add_packet_line_default:nnnn #1 #2 #3 #4 + % #1 prefix #2 name #3 default #4 content + { + \tl_if_blank:nTF { #4 } + { + \tl_set:Nn \l_@@_tmpa_tl {#3} + } + { + \tl_set:Nn \l_@@_tmpa_tl {#4} + } + \@@_xmp_add_packet_line:nnV {#1}{#2}\l_@@_tmpa_tl + } +\cs_generate_variant:Nn \@@_xmp_add_packet_line_default:nnnn {nnee} +% \end{macrocode} +% \end{macro} +% Some data are stored as unordered (Bag) or ordered lists (Seq) or (Alt). +% Here we check also for the language. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_add_packet_list:nnnn #1 #2 #3 #4 + %#1 prefix, #2 name, #3 type (Seq/Bag/Alt) #4 a clist + { + \clist_if_empty:nF { #4 } + { + \@@_xmp_add_packet_open:nn {#1}{#2} + \@@_xmp_add_packet_open:nn {rdf}{#3} + \clist_map_inline:nn {#4} + { + \@@_xmp_lang_get:nNN {##1}\l_@@_tmpa_tl\l_@@_tmpb_tl + \@@_xmp_add_packet_line_attr:nneV + {rdf}{li}{xml:lang="\l_@@_tmpa_tl" }\l_@@_tmpb_tl + } + \@@_xmp_add_packet_close:nn{rdf}{#3} + \@@_xmp_add_packet_close:nn {#1}{#2} + } + } +\cs_generate_variant:Nn \@@_xmp_add_packet_list:nnnn {nnne} +% \end{macrocode} +% +% \subsubsection{Building the main packet} +% +% \begin{macro}{\@@_xmp_build_packet:} +% This is the main command to build the packet. +% As data has to be set and collected first, it will be expanded +% rather late in the document. +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_packet: + { +% \end{macrocode} +% Get the main languages +% \begin{NOTE}{UF} +% think if an error is needed for empty lang. +% \end{NOTE} +% \begin{macrocode} + \tl_set:Nx \l_@@_xmp_doclang_tl {\GetDocumentProperties{document/lang}} + \tl_set:Nx \l_@@_xmp_metalang_tl {\GetDocumentProperties{hyperref/pdfmetalang}} + \tl_if_blank:VT \l_@@_xmp_metalang_tl + { \cs_set_eq:NN \l_@@_xmp_metalang_tl\l_@@_xmp_doclang_tl} +% \end{macrocode} +% we preprocess a number of data to be able to suppress them and their schema +% if there are unused. Currently only done for iptc +% \begin{macrocode} + \@@_xmp_build_iptc_data:N \l_@@_xmp_iptc_data_tl + \tl_if_empty:NT \l_@@_xmp_iptc_data_tl + { + \seq_remove_all:Nn \l_@@_xmp_schema_seq { Iptc4xmpCore } + } +% \end{macrocode} +% The start of the package. +% No need to try to juggle with catcode, this is fix text +% \begin{macrocode} + \@@_xmp_add_packet_chunk:e + {<?xpacket~begin="\@@_xmp_generate_bom:"~id="W5M0MpCehiHzreSzNTczkc9d"?>} + \@@_xmp_add_packet_open:nn{x}{xmpmeta~xmlns:x="adobe:ns:meta/"} + \@@_xmp_add_packet_open:ne{rdf} + {RDF~xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns\c_hash_str"} +% \end{macrocode} +% The rdf namespaces +% \begin{macrocode} + \@@_xmp_add_packet_open_attr:nne + {rdf}{Description}{rdf:about="" \g_@@_xmp_xmlns_tl} +% \end{macrocode} +% The extensions +% \begin{macrocode} + \@@_xmp_add_packet_open:nn{pdfaExtension}{schemas} + \@@_xmp_add_packet_open:nn {rdf}{Bag} + \seq_map_inline:Nn \l_@@_xmp_schema_seq + { + \tl_use:c { g_@@_xmp_schema_##1_tl } + } + \@@_xmp_add_packet_close:nn {rdf}{Bag} + \@@_xmp_add_packet_close:nn {pdfaExtension}{schemas} +% \end{macrocode} +% Now starts the part with the data. +% \begin{macrocode} + % data + \@@_xmp_build_pdf: + \@@_xmp_build_xmpRights: + \@@_xmp_build_standards: %pdfaid,pdfxid,pdfuaid + \@@_xmp_build_dc: + \@@_xmp_build_photoshop: + \@@_xmp_build_xmp: + \@@_xmp_build_xmpMM: + \@@_xmp_build_prism: + \@@_xmp_build_iptc: + \@@_xmp_build_user: %user additions + % end + \@@_xmp_add_packet_close:nn {rdf}{Description} + \@@_xmp_add_packet_close:nn {rdf}{RDF} + \@@_xmp_add_packet_close:nn {x}{xmpmeta} + \int_set:Nn \l_@@_xmp_indent_int{20} + \prg_replicate:nn{10}{\@@_xmp_add_packet_chunk:n {}} + \int_zero:N \l_@@_xmp_indent_int + \@@_xmp_add_packet_chunk:n {<?xpacket~end="w"?>} + } +% \end{macrocode} +% \end{macro} + +% \subsection{Building the chunks: rdf namespaces} +% This is the list of external names spaces. +% They are rather simple, and we store them directly +% into a string. Special chars should be escaped properly, +% see e.g. |\c_hash_str| for the hash. + +% \begin{variable}{\g_@@_xmp_xmlns_tl,\g_@@_xmp_xmlns_prop} +% The string will hold the prepared chunk, the prop stores the name spaces +% so that one can check on the user level for duplicates. +% \begin{macrocode} +\str_new:N \g_@@_xmp_xmlns_tl +\prop_new:N \g_@@_xmp_xmlns_prop +% \end{macrocode} +% \end{variable} +% \begin{macro}{\@@_xmp_xmlns_new:nn,\@@_xmp_xmlns_new:nx} +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_xmlns_new:nn #1 #2 + { + \prop_gput:Nnn \g_@@_xmp_xmlns_prop {#1}{#2} + \tl_gput_right:Nx \g_@@_xmp_xmlns_tl + { + \@@_xmp_indent:n{4} xmlns:\exp_not:n{#1="#2"} + } + } +\cs_generate_variant:Nn \@@_xmp_xmlns_new:nn {nx} +% \end{macrocode} +% \end{macro} +% Now we fill the data. The list is more or less the same as in hyperxmp +% \begin{macrocode} +\@@_xmp_xmlns_new:nn {pdf} {http://ns.adobe.com/pdf/1.3/} +\@@_xmp_xmlns_new:nn {xmpRights}{http://ns.adobe.com/xap/1.0/rights/} +\@@_xmp_xmlns_new:nn {dc} {http://purl.org/dc/elements/1.1/} +\@@_xmp_xmlns_new:nn {photoshop}{http://ns.adobe.com/photoshop/1.0/} +\@@_xmp_xmlns_new:nn {xmp} {http://ns.adobe.com/xap/1.0/} +\@@_xmp_xmlns_new:nn {xmpMM} {http://ns.adobe.com/xap/1.0/mm/} +\@@_xmp_xmlns_new:nx {stEvt} + {http://ns.adobe.com/xap/1.0/sType/ResourceEvent\c_hash_str} +\@@_xmp_xmlns_new:nn {pdfaid} {http://www.aiim.org/pdfa/ns/id/} +\@@_xmp_xmlns_new:nn {pdfuaid} {http://www.aiim.org/pdfua/ns/id/} +\@@_xmp_xmlns_new:nn {pdfx} {http://ns.adobe.com/pdfx/1.3/} +\@@_xmp_xmlns_new:nn {pdfxid} {http://www.npes.org/pdfx/ns/id/} +\@@_xmp_xmlns_new:nn {prism} {http://prismstandard.org/namespaces/basic/3.0/} +%\@@_xmp_xmlns_new:nn {jav} {http://www.niso.org/schemas/jav/1.0/} +%\@@_xmp_xmlns_new:nn {xmpTPg} {http://ns.adobe.com/xap/1.0/t/pg/} +\@@_xmp_xmlns_new:nx {stFnt} {http://ns.adobe.com/xap/1.0/sType/Font\c_hash_str} +\@@_xmp_xmlns_new:nn {Iptc4xmpCore}{http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/} +\@@_xmp_xmlns_new:nn {pdfaExtension}{http://www.aiim.org/pdfa/ns/extension/} +\@@_xmp_xmlns_new:nx {pdfaSchema}{http://www.aiim.org/pdfa/ns/schema\c_hash_str} +\@@_xmp_xmlns_new:nx {pdfaProperty}{http://www.aiim.org/pdfa/ns/property\c_hash_str} +\@@_xmp_xmlns_new:nx {pdfaType} {http://www.aiim.org/pdfa/ns/type\c_hash_str} +\@@_xmp_xmlns_new:nx {pdfaField}{http://www.aiim.org/pdfa/ns/field\c_hash_str} +% \end{macrocode} + +% \subsection{Building the chunks: Extensions} +% In this part local name spaces or additional names in a name space can be declared. +% A \enquote{schema} declaration consist of the declaration of the name, uri and prefix +% which then surrounds a bunch of property declarations. +% The current code doesn't support all syntax options but sticks to +% what is used in \pkg{hyperxmp} and \pkg{pdfx}. +% If needed it can be extended later. +% +% \begin{variable}{\l_@@_xmp_schema_seq} +% This variable will hold the list of prefix so that we can loop +% to produce the final XML +% \begin{macrocode} +\seq_new:N \l_@@_xmp_schema_seq +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\@@_xmp_schema_new:nnn} +% With this command a new schema can be declared. The main tl contains the +% XML wrapper code, it then includes the list of properties which are +% created with the next command. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_schema_new:nnn #1 #2 #3 + %#1 name #2 prefix, #3 text + { + \seq_put_right:Nn \l_@@_xmp_schema_seq { #2 } + \tl_new:c { g_@@_xmp_schema_#2_tl } + \tl_new:c { g_@@_xmp_schema_#2_properties_tl } + \tl_gput_right:cn { g_@@_xmp_schema_#2_tl } + { + \@@_xmp_add_packet_open_attr:nnn{rdf}{li}{rdf:parseType="Resource"} + \@@_xmp_add_packet_line:nnn {pdfaSchema}{schema}{#1} + \@@_xmp_add_packet_line:nnn {pdfaSchema}{prefix}{#2} + \@@_xmp_add_packet_line:nnn {pdfaSchema}{namespaceURI}{#3} + \@@_xmp_add_packet_open:nn {pdfaSchema}{property} + \@@_xmp_add_packet_open:nn{rdf}{Seq} + \tl_use:c { g_@@_xmp_schema_#2_properties_tl } + \@@_xmp_add_packet_close:nn{rdf}{Seq} + \@@_xmp_add_packet_close:nn {pdfaSchema}{property} + \cs_if_exist_use:c {@@_xmp_schema_#2_additions:} + \@@_xmp_add_packet_close:nn{rdf}{li} + } + } +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\@@_xmp_property_new:nnn} +% This adds a property to a schema. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_property_new:nnnnn #1 #2 #3 #4 #5 % + %#1 schema #2 name, #3 type, #4 category #5 description + { + \tl_gput_right:cn { g_@@_xmp_schema_#1_properties_tl } + { + \@@_xmp_add_packet_open:nn {rdf}{li~rdf:parseType="Resource"} + \@@_xmp_add_packet_line:nnn {pdfaProperty}{name}{#2} + \@@_xmp_add_packet_line:nnn {pdfaProperty}{valueType}{#3} + \@@_xmp_add_packet_line:nnn {pdfaProperty}{category}{#4} + \@@_xmp_add_packet_line:nnn {pdfaProperty}{description}{#5} + \@@_xmp_add_packet_close:nn{rdf}{li} + } + } +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\@@_xmp_add_packet_field:nnn} +% This adds a field to a schema. +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_add_packet_field:nnn #1 #2 #3 % + %#1 name #2 valuetype #3 description + { + \@@_xmp_add_packet_open_attr:nnn {rdf}{li}{rdf:parseType="Resource"} + \@@_xmp_add_packet_line:nnn {pdfaField}{name}{#1} + \@@_xmp_add_packet_line:nnn {pdfaField}{valueType}{#2} + \@@_xmp_add_packet_line:nnn {pdfaField}{description}{#3} + \@@_xmp_add_packet_close:nn{rdf}{li} + } +% \end{macrocode} +% \end{macro} +% +% \subsubsection{The extension data} +% +% The list of extension has been reviewed and compared with +% the list of namespaces which can be used in pdf/A-1\footnote{While +% A-1 builds on PDF 1.4 and so it probably no longer relevant, it is +% not quite clear if one can remove this for A-2 and newer, so we stay on the +% safe side.} +% +% +% [1]~\url{https://www.pdfa.org/wp-content/uploads/2011/08/tn0008_predefined_xmp_properties_in_pdfa-1_2008-03-20.pdf} +% and the content of the namespaces as listed here +% [2]~\url{https://developer.adobe.com/xmp/docs/XMPNamespaces/pdf/} +% +% +% \begin{description} +% \item[pdf] property: Trapped. +% We ignore it, it seems to validate without it. +% \item[xmpMM] properties DocumentID, InstanceID, VersionID, +% Renditionclass declared by hyperxmp. +% Properties InstanceID and OriginalDocumentID declared by pdfx (pdfx.xmp) +% With the exception of OriginalDocumentID all are already allowed and +% predefined. We ignore OriginalDocumentID until requested. +% \item[pdfaid] properties part and conformance are declared by hyperxmp, but +% no here as already in http://www.aiim.org/pdfa/ns/id/. But we declare +% year so that it can be used also with older A-standards. +% \begin{macro}{pdfaid~(schema)} +% \begin{macrocode} +\@@_xmp_schema_new:nnn + {PDF/A~Identification~Schema} + {pdfaid} + {http://www.aiim.org/pdfa/ns/id/} +\@@_xmp_property_new:nnnnn + {pdfaid} + {year} + {Integer} + {internal} + {Year~of~standard} +% \end{macrocode} +% \end{macro} +% \item[pdfuaid] here we need to declare the property \enquote{part}. +% \begin{macro}{pdfuaid~(schema)} +% \begin{macrocode} +\@@_xmp_schema_new:nnn + {PDF/UA~Universal~Accessibility~Schema} + {pdfuaid} + {http://www.aiim.org/pdfua/ns/id/} +\@@_xmp_property_new:nnnnn + {pdfuaid} + {part} + {Integer} + {internal} + {Part~of~ISO~14289~standard} +% \end{macrocode} +% \end{macro} +% \item[pdfx] According to [1] not an allowed schema, but it seems +% to validate and allow to set the pdf/X version, \pkg{hyperxmp} +% declares here the properties |GTS_PDFXVersion| and |GTS_PDFXConformance|. +% Ignored as only relevant for older pdf/X version not supported by the pdfmanagement. +% +% \item[pdfxid] we set this so that we +% can add the pdf/X version for pdf/X-4 and higher +% \begin{macro}{pdfxid~(schema)} +% \begin{macrocode} +\@@_xmp_schema_new:nnn + {PDF/X~ID~Schema} + {pdfxid} + {http://www.npes.org/pdfx/ns/id/} +\@@_xmp_property_new:nnnnn + {pdfxid} + {GTS_PDFXVersion} + {Text} + {internal} + {ID~of~PDF/X~standard} +% \end{macrocode} +% \end{macro} + +%\item[Prism] +% \begin{macro}{prism~(schema)} +% \begin{macrocode} +\@@_xmp_schema_new:nnn + {PRISM~Basic~Metadata} + {prism} + {http://prismstandard.org/namespaces/basic/3.0/} +\@@_xmp_property_new:nnnnn + {prism} + {complianceProfile} + {Text} + {internal} + {PRISM~specification~compliance~profile~to~which~this~document~adheres} +\@@_xmp_property_new:nnnnn + {prism} + {publicationName} + {Text} + {external} + {Publication name} +\@@_xmp_property_new:nnnnn + {prism} + {aggregationType} + {Text} + {external} + {Publication type} +\@@_xmp_property_new:nnnnn + {prism} + {bookEdition} + {Text} + {external} + {Edition~of~the~book~in~which~the~document~was~published} +\@@_xmp_property_new:nnnnn + {prism} + {volume} + {Text} + {external} + {Publication~volume~number} +\@@_xmp_property_new:nnnnn + {prism} + {number} + {Text} + {external} + {Publication~issue~number~within~a~volume} +\@@_xmp_property_new:nnnnn + {prism} + {pageRange} + {Text} + {external} + {Page~range~for~the~document~within~the~print~version~of~its~publication} +\@@_xmp_property_new:nnnnn + {prism} + {issn} + {Text} + {external} + {ISSN~for~the~printed~publication~in~which~the~document~was~published} +\@@_xmp_property_new:nnnnn + {prism} + {eIssn} + {Text} + {external} + {ISSN~for~the~electronic~publication~in~which~the~document~was~published} +\@@_xmp_property_new:nnnnn + {prism} + {isbn} + {Text} + {external} + {ISBN for the publication in which the document was published} +\@@_xmp_property_new:nnnnn + {prism} + {doi} + {Text} + {external} + {Digital~Object~Identifier~for~the~document} +\@@_xmp_property_new:nnnnn + {prism} + {url} + {URL} + {external} + {URL~at~which~the~document~can~be~found} +\@@_xmp_property_new:nnnnn + {prism} + {byteCount} + {Integer} + {internal} + {Approximate~file~size~in~octets} +\@@_xmp_property_new:nnnnn + {prism} + {pageCount} + {Integer} + {internal} + {Number~of~pages~in~the~print~version~of~the~document} +\@@_xmp_property_new:nnnnn + {prism} + {subtitle} + {Text} + {external} + {Document's subtitle} +% \end{macrocode} +% \end{macro} +% \item[iptc] +% \begin{macrocode} +\@@_xmp_schema_new:nnn + {IPTC~Core~Schema} + {Iptc4xmpCore} + {http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/} +\@@_xmp_property_new:nnnnn + {Iptc4xmpCore} + {CreatorContactInfo} + {ContactInfo} + {external} + {Document~creator's~contact~information} +\cs_new_protected:cpn { @@_xmp_schema_Iptc4xmpCore_additions: } + { + \@@_xmp_add_packet_open:nn{pdfaSchema}{valueType} + \@@_xmp_add_packet_open:nn{rdf}{Seq} + \@@_xmp_add_packet_open_attr:nnn{rdf}{li}{rdf:parseType="Resource"} + \@@_xmp_add_packet_line:nnn{pdfaType}{type}{ContactInfo} + \@@_xmp_add_packet_line:nnn{pdfaType}{namespaceURI} + {http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/} + \@@_xmp_add_packet_line:nnn{pdfaType}{prefix}{Iptc4xmpCore} + \@@_xmp_add_packet_line:nnn{pdfaType}{description} + {Basic~set~of~information~to~get~in~contact~with~a~person} + \@@_xmp_add_packet_open:nn{pdfaType}{field} + \@@_xmp_add_packet_open:nn{rdf}{Seq} + \@@_xmp_add_packet_field:nnn{CiAdrCity}{Text} + {Contact~information~city} + \@@_xmp_add_packet_field:nnn{CiAdrCtry}{Text} + {Contact~information~country} + \@@_xmp_add_packet_field:nnn{CiAdrExtadr}{Text} + {Contact~information~address} + \@@_xmp_add_packet_field:nnn{CiAdrPcode}{Text} + {Contact~information~local~postal~code} + \@@_xmp_add_packet_field:nnn{CiAdrRegion}{Text} + {Contact~information~regional~information~such~as~state~or~province} + \@@_xmp_add_packet_field:nnn{CiEmailWork}{Text} + {Contact~information~email~address(es)} + \@@_xmp_add_packet_field:nnn{CiTelWork}{Text} + {Contact~information~telephone~number(s)} + \@@_xmp_add_packet_field:nnn{CiUrlWork}{Text} + {Contact~information~Web~URL(s)} + \@@_xmp_add_packet_close:nn{rdf}{Seq} + \@@_xmp_add_packet_close:nn{pdfaType}{field} + \@@_xmp_add_packet_close:nn{rdf}{li} + \@@_xmp_add_packet_close:nn{rdf}{Seq} + \@@_xmp_add_packet_close:nn{pdfaSchema}{valueType} + } +% \end{macrocode} +% \item[jav]: currently ignored +% +% \end{description} +% \subsection{The actual user / document data} + +% \subsubsection{pdf} +% This builds pdf related the data with the (prefix \enquote{pdf}). +% +% \begin{macro}{\@@_xmp_build_pdf:} +% \begin{macro}{ +% Producer/pdfproducer, +% PDFversion} +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_pdf: + { +% \end{macrocode} +% At first the producer. If not given manually we build it from the exec string +% plus the version number +% \begin{macrocode} + \@@_xmp_add_packet_line_default:nnee + {pdf}{Producer} + {\c_sys_engine_exec_str-\c_sys_engine_version_str} + {\GetDocumentProperties{hyperref/pdfproducer}} +% \end{macrocode} +% Now the PDF version +% \begin{macrocode} + \@@_xmp_add_packet_line:nne{pdf}{PDFVersion}{\pdf_version:} +% \end{macrocode} +% \begin{macrocode} + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{xmp} +% This builds the data with the (prefix \enquote{xmp}). +% +% \begin{macro}{\@@_xmp_build_xmp:} +% \begin{macro}{ +% CreatorTool/pdfcreator, +% BaseUrl/baseurl} +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_xmp: + { +% \end{macrocode} +% The creator +% \begin{macrocode} + \@@_xmp_add_packet_line_default:nnee + {xmp}{CreatorTool} + {LaTeX} + { \GetDocumentProperties{hyperref/pdfcreator} } +% \end{macrocode} +% The baseurl +% \begin{macrocode} + \@@_xmp_add_packet_line_default:nnee + {xmp}{BaseURL}{} + { \GetDocumentProperties{hyperref/baseurl} } +% \end{macrocode} +% CreationDate +% \begin{macrocode} + \@@_xmp_date_get:nNN + {document/pdfcreationdate}\l_@@_tmpa_tl\l_@@_tmpa_seq + \@@_xmp_add_packet_line:nne{xmp}{CreateDate}{\@@_xmp_print_date:N\l_@@_tmpa_seq} + \pdfmanagement_add:nnx{Info}{CreationDate}{(\l_@@_tmpa_tl)} +% \end{macrocode} +% ModifyDate +% \begin{macrocode} + \@@_xmp_date_get:nNN + {document/pdfmoddate}\l_@@_tmpa_tl\l_@@_tmpa_seq + \@@_xmp_add_packet_line:nne{xmp}{ModifyDate}{\@@_xmp_print_date:N\l_@@_tmpa_seq} + \pdfmanagement_add:nnx{Info}{ModDate}{(\l_@@_tmpa_tl)} +% \end{macrocode} +% MetadataDate +% \begin{macrocode} + \@@_xmp_date_get:nNN + {hyperref/pdfmetadate}\l_@@_tmpa_tl\l_@@_tmpa_seq + \@@_xmp_add_packet_line:nne{xmp}{MetadataDate}{\@@_xmp_print_date:N\l_@@_tmpa_seq} +% \end{macrocode} +% \begin{macrocode} + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Standards} +% The metadata for standards are taken from the |pdfstandard| key +% of |\DocumentMetadata|. +% The values for A-standards are taken from the property, X and UA are currently +% taken from the document container, this should be changed when merging of +% standards are possible. +% \begin{macro}{\@@_xmp_build_standards:} +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_standards: + { + \@@_xmp_add_packet_line:nne {pdfaid}{part}{\pdfmeta_standard_item:n{level}} + \@@_xmp_add_packet_line:nne + {pdfaid}{conformance}{\pdfmeta_standard_item:n{conformance}} + \@@_xmp_add_packet_line:nne {pdfaid}{year} {\pdfmeta_standard_item:n{year}} + \@@_xmp_add_packet_line:nne + {pdfxid}{GTS_PDFXVersion}{\GetDocumentProperties{document/pdfstandard-X}} + \@@_xmp_add_packet_line:nne + {pdfuaid}{part}{\GetDocumentProperties{document/pdfstandard-UA}} + } +% \end{macrocode} +% \end{macro} +% + +% \subsubsection{Photoshop} +% \begin{macro}{\@@_xmp_build_photoshop:} +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_photoshop: + { +% \end{macrocode} +% pdfauthortitle/photoshop:AuthorsPosition +% \begin{macrocode} + \@@_xmp_add_packet_line:nne{photoshop}{AuthorsPosition} + { \GetDocumentProperties{hyperref/pdfauthortitle} } +% \end{macrocode} +% pdfcaptionwriter/photoshop:CaptionWriter +% \begin{macrocode} + \@@_xmp_add_packet_line:nne{photoshop}{CaptionWriter} + { \GetDocumentProperties{hyperref/pdfcaptionwriter} } +% \end{macrocode} +% \begin{macrocode} + } +% \end{macrocode} +% \end{macro} +% + +% \subsection{XMP Media Management} + +% \begin{macro}{\@@_xmp_build_xmpMM:} +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_xmpMM: + { +% \end{macrocode} +% pdfdocumentid / xmpMM:DocumentID +% \begin{macrocode} + \str_set:Nx\l_@@_tmpa_str {\GetDocumentProperties{hyperref/pdfdocumentid}} + \str_if_empty:NT \l_@@_tmpa_str + { + \@@_xmp_create_uuid:nN + {\jobname\GetDocumentProperties{hyperref/pdftitle}} + \l_@@_tmpa_str + } + \@@_xmp_add_packet_line:nnV{xmpMM}{DocumentID} + \l_@@_tmpa_str +% \end{macrocode} +% pdfinstanceid / xmpMM:InstanceID +% \begin{macrocode} + \str_set:Nx\l_@@_tmpa_str {\GetDocumentProperties{hyperref/pdfinstanceid}} + \str_if_empty:NT \l_@@_tmpa_str + { + \@@_xmp_create_uuid:nN + {\jobname\l_@@_xmp_currentdate_tl} + \l_@@_tmpa_str + } + \@@_xmp_add_packet_line:nnV{xmpMM}{InstanceID} + \l_@@_tmpa_str +% \end{macrocode} +% pdfversionid/xmpMM:VersionID +% \begin{macrocode} + \@@_xmp_add_packet_line:nne{xmpMM}{VersionID} + { \GetDocumentProperties{hyperref/pdfversionid} } +% \end{macrocode} +% pdfrendition/xmpMM:RenditionClass +% \begin{macrocode} + \@@_xmp_add_packet_line:nne{xmpMM}{RenditionClass} + { \GetDocumentProperties{hyperref/pdfrendition} } +% \end{macrocode} +% \begin{macrocode} + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Rest of dublin Core data} +% +% \begin{macro}{\@@_xmp_build_dc:} +% \begin{macro}{ +% dc:creator/pdfauthor, +% dc:subject/pdfkeywords, +% dc:type/pdftype, +% dc:publisher/pdfpublisher, +% dc:description/pdfsubject, +% dc:language/lang/pdflang, +% dc:identifier/pdfidentifier, +% photoshop:AuthorsPosition/pdfauthortitle, +% photoshop:CaptionWriter/pdfcaptionwriter +% } +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_dc: + { +% \end{macrocode} +% pdfauthor/dc:creator +% \begin{macrocode} + \@@_xmp_add_packet_list:nnne {dc}{creator}{Seq} + { \GetDocumentProperties{hyperref/pdfauthor} } + \int_compare:nNnT {0\pdfmeta_standard_item:n{level}}={1} + { \pdfmanagement_remove:nn{Info}{Author} } +% \end{macrocode} +% pdftitle/dc:title. This is rather complex as we want to support a list +% with different languages. +% \begin{macrocode} + \@@_xmp_add_packet_list:nnne {dc}{title}{Alt} + { \GetDocumentProperties{hyperref/pdftitle} } +% \end{macrocode} +% pdfkeywords/dc:subject +% \begin{macrocode} + \@@_xmp_add_packet_list:nnne {dc}{subject}{Bag} + { \GetDocumentProperties{hyperref/pdfkeywords} } + \int_compare:nNnT {0\pdfmeta_standard_item:n{level}}={1} + { \pdfmanagement_remove:nn{Info}{Keywords} } +% \end{macrocode} +% pdftype/dc:type +% \begin{macrocode} + \tl_if_blank:eTF { \GetDocumentProperties{hyperref/pdftype} } + { + \@@_xmp_add_packet_list:nnne {dc}{type}{Bag}{Text} + } + { + \@@_xmp_add_packet_list:nnne {dc}{type}{Bag} + { { \GetDocumentProperties{hyperref/pdftype} }} + } +% \end{macrocode} +% pdfpublisher/dc:publisher +% \begin{macrocode} + \@@_xmp_add_packet_list:nnne {dc}{publisher}{Bag} + { \GetDocumentProperties{hyperref/pdfpublisher} } +% \end{macrocode} +% pdfsubject/dc:description +% \begin{macrocode} + \@@_xmp_add_packet_list:nnne + {dc}{description}{Alt} + {\GetDocumentProperties{hyperref/pdfsubject}} +% \end{macrocode} +% lang/pdflang/dc:language +% \begin{macrocode} + \@@_xmp_add_packet_list:nnne {dc}{language}{Bag} + { \l_@@_xmp_doclang_tl } +% \end{macrocode} +% pdfidentifier/dc:identifier +% \begin{macrocode} + \@@_xmp_add_packet_line:nne{dc}{identifier} + { \GetDocumentProperties{hyperref/pdfidentifier} } +% \end{macrocode} +% pdfdate/dc:date +% \begin{macrocode} + \@@_xmp_date_get:nNN {hyperref/pdfdate}\l_@@_tmpa_tl\l_@@_tmpa_seq + \@@_xmp_add_packet_list:nnne {dc}{date}{Seq} + {\@@_xmp_print_date:N\l_@@_tmpa_seq} +% \end{macrocode} +% The file format +% \begin{macrocode} + \@@_xmp_add_packet_line:nnn{dc}{format}{application/pdf} +% \end{macrocode} +% The source +% \begin{macrocode} + \@@_xmp_add_packet_line_default:nnee + {dc}{source} + { \c_sys_jobname_str.tex } + { \GetDocumentProperties{hyperref/pdfsource} } +% \end{macrocode} +% \begin{macrocode} + \@@_xmp_add_packet_list:nnne{dc}{rights}{Alt} + {\GetDocumentProperties{hyperref/pdfcopyright}} +% \end{macrocode} +% \begin{macrocode} + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{xmpRights} +% \begin{macro}{\@@_xmp_build_xmpRights:} +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_xmpRights: + { + \@@_xmp_add_packet_line:nne + {xmpRights} + {WebStatement} + {\GetDocumentProperties{hyperref/pdflicenseurl}} + } +% \end{macrocode} +% \end{macro} +% +% \subsection{IPTC} +% We want the block and also the resources only if they are actually used. So we pack +% them first in a local variable +% \begin{variable}{\l_@@_xmp_iptc_data_tl} +% \begin{macrocode} +\tl_new:N\l_@@_xmp_iptc_data_tl +% \end{macrocode} +% \end{variable} +% \begin{macro}{\@@_xmp_build_iptc_data:N} +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_iptc_data:N #1 + { + \tl_clear:N #1 + \@@_xmp_incr_indent:\@@_xmp_incr_indent:\@@_xmp_incr_indent:\@@_xmp_incr_indent: + \@@_xmp_add_packet_line:nneN + {Iptc4xmpCore}{CiAdrExtadr} + {\GetDocumentProperties{hyperref/pdfcontactaddress}} + #1 + \@@_xmp_add_packet_line:nneN + {Iptc4xmpCore}{CiAdrCity} + {\GetDocumentProperties{hyperref/pdfcontactcity}} + #1 + \@@_xmp_add_packet_line:nneN + {Iptc4xmpCore}{CiAdrPcode} + {\GetDocumentProperties{hyperref/pdfcontactpostcode}} + #1 + \@@_xmp_add_packet_line:nneN + {Iptc4xmpCore}{CiAdrCtry} + {\GetDocumentProperties{hyperref/pdfcontactcountry}} + #1 + \@@_xmp_add_packet_line:nneN + {Iptc4xmpCore}{CiTelWork} + {\GetDocumentProperties{hyperref/pdfcontactphone}} + #1 + \@@_xmp_add_packet_line:nneN + {Iptc4xmpCore}{CiEmailWork} + {\GetDocumentProperties{hyperref/pdfcontactemail}} + #1 + \@@_xmp_add_packet_line:nneN + {Iptc4xmpCore}{CiUrlWork} + {\GetDocumentProperties{hyperref/pdfcontacturl}} + #1 + \@@_xmp_decr_indent:\@@_xmp_decr_indent:\@@_xmp_decr_indent:\@@_xmp_decr_indent: + } +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@@_xmp_build_iptc:} +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_iptc: + { + \tl_if_empty:NF\l_@@_xmp_iptc_data_tl + { + \@@_xmp_add_packet_open_attr:nnn + {Iptc4xmpCore}{CreatorContactInfo}{rdf:parseType="Resource"} + \tl_gput_right:Nx\g_@@_xmp_packet_tl { \l_@@_xmp_iptc_data_tl } + \@@_xmp_add_packet_close:nn + {Iptc4xmpCore}{CreatorContactInfo} + } + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Prism} +% \begin{macro}{\@@_xmp_build_prism:} +% \begin{macro} +% { +% complianceProfile, +% prism:subtitle/pdfsubtitle, +% } +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_prism: + { +% \end{macrocode} +% The compliance profile is a fix value taken from \pkg{hyperxmp} +% \begin{macrocode} + \@@_xmp_add_packet_line:nnn + {prism}{complianceProfile} + {three} +% \end{macrocode} +% the next two values can take an optional language argument. +% First subtitle +% \begin{macrocode} + \@@_xmp_lang_get:eNN + {\GetDocumentProperties{hyperref/pdfsubtitle}} + \l_@@_tmpa_tl\l_@@_tmpb_tl + \@@_xmp_add_packet_line_attr:nneV + {prism}{subtitle} + {xml:lang="\l_@@_tmpa_tl"} + \l_@@_tmpb_tl +% \end{macrocode} +% Then publicationName +% \begin{macrocode} + \@@_xmp_lang_get:eNN + {\GetDocumentProperties{hyperref/pdfpublication}} + \l_@@_tmpa_tl\l_@@_tmpb_tl + \@@_xmp_add_packet_line_attr:nneV + {prism}{publicationName} + {xml:lang="\l_@@_tmpa_tl"} + \l_@@_tmpb_tl +% \end{macrocode} +% Now the rest +% \begin{macrocode} + \@@_xmp_add_packet_line:nne + {prism}{bookEdition} + {\GetDocumentProperties{hyperref/pdfbookedition}} + \@@_xmp_add_packet_line:nne + {prism}{aggregationType} + {\GetDocumentProperties{hyperref/pdfpubtype}} + \@@_xmp_add_packet_line:nne + {prism}{volume} + {\GetDocumentProperties{hyperref/pdfvolumenum}} + \@@_xmp_add_packet_line:nne + {prism}{number} + {\GetDocumentProperties{hyperref/pdfissuenum}} + \@@_xmp_add_packet_line:nne + {prism}{pageRange} + {\GetDocumentProperties{hyperref/pdfpagerange}} + \@@_xmp_add_packet_line:nne + {prism}{issn} + {\GetDocumentProperties{hyperref/pdfissn}} + \@@_xmp_add_packet_line:nne + {prism}{eIssn} + {\GetDocumentProperties{hyperref/pdfeissn}} + \@@_xmp_add_packet_line:nne + {prism}{doi} + {\GetDocumentProperties{hyperref/pdfdoi}} + \@@_xmp_add_packet_line:nne + {prism}{url} + {\GetDocumentProperties{hyperref/pdfurl}} +% \end{macrocode} +% The page count is take from the previous run or from +% pdfnumpages. +% \begin{macrocode} + \tl_set:Nx \l_@@_tmpa_tl { \GetDocumentProperties{hyperref/pdfnumpages} } + \@@_xmp_add_packet_line:nne + {prism}{pageCount} + {\tl_if_blank:VTF \l_@@_tmpa_tl {\PreviousTotalPages}{\l_@@_tmpa_tl}} +% \end{macrocode} +% \begin{macrocode} + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{User additions} +% +% \begin{variable}{\g_@@_xmp_user_packet_str } +% \begin{macrocode} +\tl_new:N \g_@@_xmp_user_packet_tl +% \end{macrocode} +% \end{variable} +% \begin{macro}{\@@_xmp_build_user: } +% \begin{macrocode} +\cs_new_protected:Npn \@@_xmp_build_user: + { + \int_zero:N \l_@@_xmp_indent_int + \g_@@_xmp_user_packet_tl + \int_set:Nn \l_@@_xmp_indent_int {3} + } +% \end{macrocode} +% \end{macro} +% \subsection{Activating the metadata} +% We don't try to get the byte count. So we can put everything +% in the |shipout/lastpage| hook +% \begin{macrocode} +\AddToHook{shipout/lastpage} + { + \bool_if:NT\g_@@_xmp_bool + { + \file_get_timestamp:nN{\jobname.log}\l_@@_xmp_currentdate_tl + \@@_xmp_date_split:VN\l_@@_xmp_currentdate_tl\l_@@_xmp_currentdate_seq + \@@_xmp_build_packet: + \exp_args:No + \__pdf_backend_metadata_stream:n {\g_@@_xmp_packet_tl} + \pdfmanagement_add:nnx {Catalog} {Metadata}{\pdf_object_ref_last:} + } + } +% \end{macrocode} + +% \subsection{User commands} + +% \begin{macro}{\pdfmeta_xmp_add:n } +% \begin{macrocode} +\cs_new_protected:Npn \pdfmeta_xmp_add:n #1 + { + \tl_gput_right:Nn \g_@@_xmp_user_packet_tl + { + \@@_xmp_add_packet_chunk:n { #1 } + } + } +% \end{macrocode} +% \end{macro} +% \begin{macro}{\pdfmeta_xmp_xmlns_new:nn } +% \begin{macrocode} +\cs_new_protected:Npn \pdfmeta_xmp_xmlns_new:nn #1 #2 + { + \prop_if_in:NnTF \g_@@_xmp_xmlns_prop {#1} + {\msg_warning:nnn{pdfmeta}{namespace-defined}{#1}} + {\@@_xmp_xmlns_new:nn {#1}{#2}} + } +% \end{macrocode} +% \end{macro} % \begin{macrocode} %</package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx index b7bd6a54ed5..c936d36933f 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdftools.dtx @@ -23,10 +23,9 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass[full]{l3doc} -\usepackage{array,booktabs,hyperxmp} +\usepackage{array,booktabs} \hypersetup{pdfauthor=The LaTeX Project,pdftitle=l3pdftools (LaTeX PDF management testphase bundle)} \providecommand\potentialclash{\noindent\llap{\dbend\ }} @@ -50,7 +49,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -152,7 +151,7 @@ % This command adds a BDC marked content operator to the current page stream. % \meta{tag} is the tag of this operator (without the leading slash), % \meta{object name} is a the name of an dictionary object reserved with -% \cs{pdf_object_new:nn} and filled with \cs{pdf_object_write:n} with +% \cs{pdf_object_new:n} and filled with \cs{pdf_object_write:nnn} with % the properties of the BDC. Reusing a predefined object can save space % but the command works correctly % only if the resources management has been activated and should be used only @@ -195,8 +194,8 @@ % It should be on the same page as the bdc-command. % % \begin{verbatim} -% \pdf_object_new:nn {module/objA}{dict} -% \pdf_object_write:nn {module/objA}{/Type/Artifact} +% \pdf_object_new:n {module/objA} +% \pdf_object_write:nnn {module/objA}{dict}{/Type/Artifact} % \pdf_bdc:nn {Span}{module/objA} % text % \pdf_emc: @@ -212,7 +211,7 @@ % % \begin{macrocode} %<*header> -\ProvidesExplPackage{l3pdftools}{2022-08-24}{0.95r} +\ProvidesExplPackage{l3pdftools}{2022-09-26}{0.95s} {candidate commands for l3pdf---LaTeX PDF management testphase bundle} %</header> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx index 3b7d7247101..609ab32e7a4 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/l3pdfxform.dtx @@ -23,10 +23,9 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass[full]{l3doc} -\usepackage{array,booktabs,hyperxmp} +\usepackage{array,booktabs} \hypersetup{pdfauthor=The LaTeX Project,pdftitle=l3pdfxform (LaTeX PDF management testphase bundle)} \begin{document} @@ -49,7 +48,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -133,7 +132,7 @@ % \begin{macrocode} %<@@=pdf> %<*header> -\ProvidesExplPackage{l3pdfxform}{2022-08-24}{0.95r} +\ProvidesExplPackage{l3pdfxform}{2022-09-26}{0.95s} {command to create xforms (beta)---LaTeX PDF management testphase bundle} %</header> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx index ed9fda6588e..0142b337b6c 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/ltdocinit.dtx @@ -23,10 +23,9 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass[full]{l3doc} -\usepackage{array,booktabs,hyperxmp} +\usepackage{array,booktabs} \hypersetup{pdfauthor=The LaTeX Project,pdftitle=ltdocinit (LaTeX PDF management testphase bundle)} \begin{document} @@ -48,7 +47,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -131,6 +130,9 @@ % \item[\texttt{colorprofiles}] This allows to load icc-colorprofiles. Details % are described in the documentation of \pkg{l3pdfmeta}. % +% \item[\texttt{xmp}] A boolean, if set to false no XMP metadata are added to the PDF. +% The default is true. Details are described in the documentation of \pkg{l3pdfmeta}. +% % \item[\texttt{testphase}] This key is used to load testphase code. The values it accepts % and their effect will change over time, when testphase packages are added or % removed or when the code is moved into the kernel. @@ -217,7 +219,7 @@ % \begin{macrocode} %<@@=pdfmanagement> %<*header> -\ProvidesExplPackage{ltdocinit}{2022-08-24}{0.95r} +\ProvidesExplPackage{ltdocinit}{2022-09-26}{0.95s} {Initialize document metadata} %</header> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx index f02cc7ec553..e7d445088c3 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-firstaid.dtx @@ -23,10 +23,9 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass[full]{l3doc} -\usepackage{array,booktabs,hyperxmp} +\usepackage{array,booktabs} \hypersetup{pdfauthor=The LaTeX Project,pdftitle=pdfmanagement-firstaid (LaTeX PDF management testphase bundle)} \begin{document} @@ -48,7 +47,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -64,11 +63,11 @@ % |debug={firstaidoff={name1,name2,...},...}|. % \begin{macrocode} %<*package> -\ProvidesExplPackage{pdfmanagement-firstaid}{2022-08-24}{0.95r} +\ProvidesExplPackage{pdfmanagement-firstaid}{2022-09-26}{0.95s} {LaTeX PDF management testphase bundle / firstaid-patches} %<@@=pdfmanagement> -\clist_map_inline:nn {pgf,transparent,hyperxmp,pdflscape,xcolor,color,beamer,output,colorspace,fontspec} +\clist_map_inline:nn {pgf,transparent,xmp,pdflscape,xcolor,color,beamer,output,colorspace,fontspec} { \bool_new:c { g_@@_firstaid_#1_bool } \bool_gset_true:c { g_@@_firstaid_#1_bool } @@ -84,6 +83,10 @@ { loading~pdfmanagement~firstaid~code~for~#1 } \msg_new:nnn { pdfmanagement } { firstaid-changed } { package~#1~has~changed.~Check~if~patch~is~still~valid! } +\msg_new:nnn { pdfmanagement } { firstaid-disabled } + { The~loading~of~package~#1~is~disabled.\\ + It~is~not~compatible~with~the~PDF~management. } + % \end{macrocode} % \subsection{Fontspec} % When using luaLaTeX opacity is broken (issue \#30) as @@ -308,16 +311,25 @@ \declare@file@substitution{pdflscape.sty}{pdflscape-ltx.sty} } % \end{macrocode} -% \subsection{hyperxmp} -% We add some code at the end of hyperxmp.sty. +% +% \subsection{xmp} +% This handles the new xmp code. % \begin{macrocode} -\bool_if:NT \g_@@_firstaid_hyperxmp_bool +\bool_if:NT \g_@@_firstaid_xmp_bool { - \AddToHook - { - file/hyperxmp.sty/after - } - {\RequirePackage{hyperxmp-patches-tmp-ltx}} + \disable@package@load{hyperxmp}{\msg_warning:nnn{pdfmanagement}{firstaid-disabled}{hyperxmp}} + \disable@package@load{pdfx} {\msg_warning:nnn{pdfmanagement}{firstaid-disabled}{pdfx}} + \AddToHook + { + file/doclicense.sty/after + } + { + \hypersetup + { + pdfcopyright = {\doclicenseLongTextForHyperref}, + pdflicenseurl = {\doclicenseURL}, + } + } } %</package> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx index 22f0445ac03..ffc2dca20c9 100644 --- a/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx +++ b/Master/texmf-dist/source/latex/pdfmanagement-testphase/pdfmanagement-testphase.dtx @@ -23,10 +23,9 @@ % for those people who are interested. % %<*driver> -\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{pdfstandard=A-2b} \documentclass{l3doc} -\usepackage{tabularx,array,booktabs,hyperxmp} +\usepackage{tabularx,array,booktabs} \hypersetup{pdfauthor=The LaTeX Project,pdftitle=LaTeX PDF management testphase bundle} \newcommand\potentialclash{\noindent\llap{\dbend\ }} \raggedbottom @@ -48,7 +47,7 @@ % }^^A % } % -% \date{Version 0.95r, released 2022-08-24} +% \date{Version 0.95s, released 2022-09-26} % % \maketitle % \begin{documentation} @@ -326,20 +325,21 @@ % see the documentation of \pkg{l3pdfmeta}. % % \subsection{hyperxmp} -% \pkg{hyperxmp} uses \cs{pdfcatalog} to insert the \texttt{/MetaData} reference. This -% makes it incompatible, but adjusting this is even possible with external -% patches. \pkg{hyperxmp} also relies on some \pkg{hyperref} internals, so -% changes in \pkg{hyperref} must be coordinated. +% \pkg{hyperxmp} uses \cs{pdfcatalog} to insert the \texttt{/MetaData} reference +% and also relies on some \pkg{hyperref} internals which are not present in the new +% generic driver used by \pkg{hyperref} when the pdfmanagement is active. +% This makes \pkg{hyperxmp} incompatible. % -% Some patch code is provided by the bundle and loaded automatically, -% but it is not complete currently. Failures are e.g. possible with complicated -% author or title settings. The handling of dates isn't correct either yet. -% The patch code can be disabled by using |debug={firstaidoff=hyperxmp}| in \cs{DocumentMetadata} +% For some time some patch code was provided by the bundle to keep \pkg{hyperxmp} +% working but starting with version 0.95s XMP-metadata are handled directly +% by the \pkg{pdfmanagement-testphase} bundle (see the documentation of \pkg{l3pdfmeta}) +% and the patch code has been removed and the loading of +% \pkg{hyperxmp} has been disabled. % % \subsection{tikz/pgf} % \pkg{pgf} writes to the page resources too and so is incompatible. The needed % changes are rather small and will be done in coordination with the maintainer. -% Until this works, \pkg{pagemanagement} will load the patches automatically. +% Until this works, \pkg{pdfmanagement-testphase} will load the patches automatically. % This can be disabled by using |debug={firstaidoff=pgf}| in \cs{DocumentMetadata} % % \subsection{transparent} @@ -356,7 +356,7 @@ % The package is incompatible. Some patches % have been added to \pkg{pdfmanagement-firstaid}. % Alternative code for spot colors is -% in the \pkg{l3color} package which has now been add to \pkg{l3kernel}. +% in the \pkg{l3color} package which has now been added to \pkg{l3kernel}. % % \subsection{embedfile, attachfile, attachfile2} % Tools needed to be able to write a replacement @@ -386,7 +386,7 @@ % \begin{macrocode} %<@@=pdf> %<*package> -\ProvidesExplPackage{pdfmanagement-testphase}{2022-08-24}{0.95r} +\ProvidesExplPackage{pdfmanagement-testphase}{2022-09-26}{0.95s} {LaTeX PDF management testphase bundle} \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \IfFormatAtLeastTF{2020-10-01}{}{ @@ -414,7 +414,7 @@ % to allow to set it in the document. % \begin{macrocode} %<*header> -\ProvidesExplFile{pdfmanagement-testphase.ltx}{2022-08-24}{0.95r} +\ProvidesExplFile{pdfmanagement-testphase.ltx}{2022-09-26}{0.95s} {PDF~management~code~(testphase)} %</header> %<*package> |