From 66c778ee5fd3d9e8bad5207c01ec4de43e6217b5 Mon Sep 17 00:00:00 2001 From: Ulrike Fischer Date: Fri, 20 Dec 2024 11:11:11 +0100 Subject: [PATCH] update and test new pdfmanagement --- .../pdfmanagement-testphase/color-ltx.sty | 2 +- .../colorspace-patches-tmp-ltx.sty | 2 +- .../hgeneric-testphase.def | 10 +- .../l3backend-testphase-dvipdfmx.def | 2 +- .../l3backend-testphase-dvips.def | 2 +- .../l3backend-testphase-dvisvgm.def | 2 +- .../l3backend-testphase-luatex.def | 2 +- .../l3backend-testphase-pdftex.def | 2 +- .../l3backend-testphase-xetex.def | 2 +- .../l3pdffield-testphase.sty | 12 +- .../pdfmanagement-firstaid.sty | 2 +- .../pdfmanagement-testphase.ltx | 151 ++++++++++++++---- .../pdfmanagement-testphase.sty | 2 +- .../xcolor-patches-tmp-ltx.sty | 2 +- 14 files changed, 146 insertions(+), 49 deletions(-) diff --git a/texmf/tex/latex/pdfmanagement-testphase/color-ltx.sty b/texmf/tex/latex/pdfmanagement-testphase/color-ltx.sty index 1716e9f9b..7dbb99bc1 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/color-ltx.sty +++ b/texmf/tex/latex/pdfmanagement-testphase/color-ltx.sty @@ -24,7 +24,7 @@ %% This file has the LPPL maintenance status "maintained". %% \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{color-ltx}[2024-10-27 v0.96n +\ProvidesPackage{color-ltx}[2024-12-20 v0.96o Standard LaTeX Color (patched for l3color, part of pdfmanagement-testphase, original version 2022/01/06 v1.3d) (DPC)] \edef\Gin@codes{% \catcode`\noexpand\^^A\the\catcode`\^^A\relax diff --git a/texmf/tex/latex/pdfmanagement-testphase/colorspace-patches-tmp-ltx.sty b/texmf/tex/latex/pdfmanagement-testphase/colorspace-patches-tmp-ltx.sty index 599680b6c..c0a4cf94a 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/colorspace-patches-tmp-ltx.sty +++ b/texmf/tex/latex/pdfmanagement-testphase/colorspace-patches-tmp-ltx.sty @@ -19,7 +19,7 @@ % % for those people who are interested. \NeedsTeXFormat{LaTeX2e}[2020/10/01] -\ProvidesExplPackage{colorspace-patches-tmp-ltx}{2024-10-27}{0.96n} +\ProvidesExplPackage{colorspace-patches-tmp-ltx}{2024-12-20}{0.96o} {temporary patches for the colorspace package to test pdfresource management ... UF} diff --git a/texmf/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def b/texmf/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def index dcaffb96f..bd7939ac6 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def +++ b/texmf/tex/latex/pdfmanagement-testphase/hgeneric-testphase.def @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: hyperref-generic.dtx -\ProvidesFile{hgeneric-testphase.def}[2024-10-27 v0.96n % +\ProvidesFile{hgeneric-testphase.def}[2024-12-20 v0.96o % generic Hyperref driver for the LaTeX PDF management testphase bundle] \RequirePackage{etoolbox} %why? @@ -526,6 +526,8 @@ { Go~to~destination~#1 } { \l__hyp_text_enc_info_print_tl } \l__hyp_link_Contents_tl + \pdfannot_dict_put:nne {link/GoTo}{Contents} + {\l__hyp_link_Contents_tl} } \socket_new_plug:nnn {hyp/link/URI/Contents}{default} { @@ -533,6 +535,8 @@ { #1 } { \l__hyp_text_enc_info_print_tl } \l__hyp_link_Contents_tl + \pdfannot_dict_put:nne {link/URI}{Contents} + {\l__hyp_link_Contents_tl} } \socket_assign_plug:nn{hyp/link/GoTo/Contents}{default} \socket_assign_plug:nn{hyp/link/URI/Contents}{default} @@ -726,8 +730,6 @@ \group_begin: \tl_set:Nn \l_hyp_current_dest_name_tl {#2} \socket_use:nnn{hyp/link/GoTo/Contents}{#2}{#3} - \pdfannot_dict_put:nne {link/GoTo}{Contents} - {\l__hyp_link_Contents_tl} \hook_use:n {hyp/link/#1} \__hyp_link_goto_begin:nw {#2}#3\Hy@xspace@end \__hyp_link_goto_end: @@ -751,6 +753,7 @@ \Hy@VerboseLinkStart{#1}{#2}% only for debug \group_begin: \tl_set:Nn \l_hyp_current_dest_name_tl {#2} + \socket_use:nnn{hyp/link/GoTo/Contents}{#2}{} \hook_use:n {hyp/link/#1} \__hyp_link_goto_begin:nw {#2} } @@ -798,7 +801,6 @@ \pdfdict_put:nnn{l_hyp/annot/A/URI}{IsMap}{true} } \socket_use:nn{hyp/link/URI/Contents}{#2} - \pdfannot_dict_put:nne {link/URI}{Contents}{\l__hyp_link_Contents_tl} \cs_set_eq:NN \# \c_hash_str \cs_set_eq:NN \% \c_percent_str \Hy@safe@activestrue diff --git a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def index 178df5a68..2e481a08b 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def +++ b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvipdfmx.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-dvipdfmx.def}{2024-10-27}{} + {l3backend-testphase-dvipdfmx.def}{2024-12-20}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvipdfmx} \cs_generate_variant:Nn \__kernel_backend_literal:n { e } \cs_generate_variant:Nn \__pdf_backend:n { e } diff --git a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def index 3b3211a42..73c61b79d 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def +++ b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvips.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-dvips.def}{2024-10-27}{} + {l3backend-testphase-dvips.def}{2024-12-20}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvips} \cs_generate_variant:Nn \__kernel_backend_postscript:n { e } \cs_generate_variant:Nn \__pdf_backend_pdfmark:n { e } diff --git a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def index 1b2c0adb4..51e50756d 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def +++ b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-dvisvgm.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-dvisvgm.def}{2024-10-27}{} + {l3backend-testphase-dvisvgm.def}{2024-12-20}{} {LaTeX~PDF~management~testphase~bundle~backend~support: dvisvgm} \bool_if:NT \l__pdfmanagement_delayed_shipout_bool { diff --git a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def index d56136ad8..048b06b69 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def +++ b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-luatex.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-luatex.def}{2024-10-27}{} + {l3backend-testphase-luatex.def}{2024-12-20}{} {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (LuaTeX)} \cs_generate_variant:Nn \__kernel_backend_literal_page:n { e } \bool_if:NT \l__pdfmanagement_delayed_shipout_bool diff --git a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def index 9b694bcbb..77c0eb009 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def +++ b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-pdftex.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-pdftex.def}{2024-10-27}{} + {l3backend-testphase-pdftex.def}{2024-12-20}{} {LaTeX~PDF~management~testphase~bundle~backend~support: PDF output (pdfTeX)} \cs_generate_variant:Nn \__kernel_backend_literal_page:n { e } \bool_if:NT \l__pdfmanagement_delayed_shipout_bool diff --git a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def index 3f8858d58..996609e7a 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def +++ b/texmf/tex/latex/pdfmanagement-testphase/l3backend-testphase-xetex.def @@ -20,7 +20,7 @@ %% %% File: l3backend-testphase.dtx \ProvidesExplFile - {l3backend-testphase-xetex.def}{2024-10-27}{} + {l3backend-testphase-xetex.def}{2024-12-20}{} {LaTeX~PDF~management~testphase~bundle~backend~support: XeTeX} \cs_generate_variant:Nn \__kernel_backend_literal:n { e } \cs_generate_variant:Nn \__pdf_backend:n { e } diff --git a/texmf/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty b/texmf/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty index 5580ee0e2..128212d47 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty +++ b/texmf/tex/latex/pdfmanagement-testphase/l3pdffield-testphase.sty @@ -27,7 +27,7 @@ %% File: l3pdffield.dtx \NeedsTeXFormat{LaTeX2e} -\ProvidesExplPackage{l3pdffield-testphase}{2024-10-27}{0.96n}% +\ProvidesExplPackage{l3pdffield-testphase}{2024-12-20}{0.96o}% {form fields} \csname HyField@NeedAppearancesfalse\endcsname % suppress NeedAppearances \str_new:N \l__pdffield_tmpa_str @@ -1016,7 +1016,7 @@ { \__pdffield_field:n { __pdffield/checkbox/#1 } } - \keys_set:nn {pdffield}{parent=__pdffield/checkbox/#1} + \keys_set:nn {pdffield}{parent={__pdffield/checkbox/#1}} } \cs_generate_variant:Nn \__pdffield_checkbox_field:n {V} \cs_new_protected:Npn \__pdffield_checkbox:n #1 @@ -1215,7 +1215,7 @@ } } } - \keys_set:nn {pdffield}{parent=__pdffield/radio/#1} + \keys_set:nn {pdffield}{parent={__pdffield/radio/#1}} } \cs_generate_variant:Nn \__pdffield_radio_field:n {V} \cs_new_protected:Npn \__pdffield_radio:n #1 @@ -1359,7 +1359,7 @@ { \__pdffield_field:n { __pdffield/textfield/#1 } } - \keys_set:nn {pdffield}{parent=__pdffield/textfield/#1} + \keys_set:nn {pdffield}{parent={__pdffield/textfield/#1}} } \cs_generate_variant:Nn \__pdffield_textfield_field:n {V} \cs_new_protected:Npn \__pdffield_textfield:n #1 @@ -1699,7 +1699,7 @@ { \__pdffield_field:n { __pdffield/pushbutton/#1 } } - \keys_set:nn {pdffield}{parent=__pdffield/pushbutton/#1} + \keys_set:nn {pdffield}{parent={__pdffield/pushbutton/#1}} } \cs_generate_variant:Nn \__pdffield_pushbutton_field:n {V} \cs_new_protected:Npn \__pdffield_pushbutton:n #1 @@ -1809,7 +1809,7 @@ } \__pdffield_field:n { __pdffield/choice/#1 } } - \keys_set:nn {pdffield}{parent=__pdffield/choice/#1} + \keys_set:nn {pdffield}{parent={__pdffield/choice/#1}} } \cs_generate_variant:Nn \__pdffield_choice_field:n {V} \cs_new_protected:Npn \__pdffield_choice:n #1 diff --git a/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty b/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty index 0ed1866d0..5ef6268db 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty +++ b/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-firstaid.sty @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: pdfmanagement-firstaid.dtx -\ProvidesExplPackage{pdfmanagement-firstaid}{2024-10-27}{0.96n} +\ProvidesExplPackage{pdfmanagement-firstaid}{2024-12-20}{0.96o} {LaTeX PDF management testphase bundle / firstaid-patches} \clist_map_inline:nn diff --git a/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx b/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx index 63aa929d3..cfe8df485 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx +++ b/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.ltx @@ -27,7 +27,7 @@ %% and all files in that bundle must be distributed together. %% %% File: pdfmanagement-testphase.dtx -\ProvidesExplFile{pdfmanagement-testphase.ltx}{2024-10-27}{0.96n} +\ProvidesExplFile{pdfmanagement-testphase.ltx}{2024-12-20}{0.96o} {PDF~management~code~(testphase)} \bool_new:N\l__pdfmanagement_delayed_shipout_bool \msg_new:nnn {pdfmanagement}{delayed-shipout} @@ -1038,6 +1038,22 @@ { \clist_new:N \g__pdfmanagement_firstaidoff_clist } \tl_if_exist:NF \g__pdfmanagement_testphase_tl { \tl_new:N \g__pdfmanagement_testphase_tl } +\msg_new:nnn { meta } { testphase-latest-loading-temp } + { + Loading~testphase~modules\\ + #1 + } +\keys_define:nn { document / metadata } + { + ,testphase / latest .code:n = + { + \keys_set:nn + {document / metadata} + {testphase={phase-III,title,table,math,firstaid}} + \msg_note:nnn { meta } { testphase-latest-loading-temp } + { phase-III,~title,~table,~math,~firstaid } + } + } \NewCommandCopy\DeclareDocumentMetadata\DocumentMetadata \prop_new:N \g__pdfmanagement_documentproperties_prop % \NewDocumentCommand\AddToDocumentProperties{O{\@currname}mm} @@ -1324,6 +1340,11 @@ \msg_new:nnn {pdf }{unknown-standard}{The~standard~'#1'~is~unknown~and~has~been~ignored} \msg_new:nnn {pdf }{wrong-pdfversion} {PDF~version~#1~is~too~#2~for~standard~'#3'.} +\msg_new:nnn {pdf }{validation-failure} + { + PDF~standard~validation~failure.\\ + #1 + } \tl_new:N \l__pdfmeta_tmpa_tl \tl_new:N \l__pdfmeta_tmpb_tl \str_new:N \l__pdfmeta_tmpa_str @@ -1518,7 +1539,11 @@ { g__pdfmeta_standard_pdf/A-2B_prop }{level}{2} \prop_gremove:cn { g__pdfmeta_standard_pdf/A-2B_prop } - { embed_content} + { no_embed_content } +\prop_gput:cnn + { g__pdfmeta_standard_pdf/A-2B_prop } + { only_pdfa_embed_content } + {} \prop_gput:cnn { g__pdfmeta_standard_pdf/A-2B_prop }{max_pdf_version}{1.7} \prop_gput:cnn @@ -1562,7 +1587,7 @@ { g__pdfmeta_standard_pdf/A-3B_prop }{level}{3} \prop_gremove:cn { g__pdfmeta_standard_pdf/A-3B_prop } - { embed_content} + { only_pdfa_embed_content } \prop_new:c { g__pdfmeta_standard_pdf/A-3U_prop } \prop_gset_eq:cc { g__pdfmeta_standard_pdf/A-3U_prop } @@ -1601,6 +1626,8 @@ { g__pdfmeta_standard_pdf/A-4_prop }{no_CharSet}{} \prop_gput:cnn { g__pdfmeta_standard_pdf/A-4_prop }{Trailer_no_Info}{} +\prop_gput:cnn + { g__pdfmeta_standard_pdf/A-4_prop }{only_pdfa_embed_content}{} \prop_gremove:cn { g__pdfmeta_standard_pdf/A-4_prop }{conformance} \prop_gremove:cn @@ -1615,6 +1642,8 @@ { g__pdfmeta_standard_pdf/A-4F_prop }{conformance}{F} \prop_gput:cnn { g__pdfmeta_standard_pdf/A-4F_prop }{Catalog_EmbeddedFiles}{} +\prop_gremove:cn + { g__pdfmeta_standard_pdf/A-4F_prop }{only_pdfa_embed_content} \AddToHook{begindocument/end} { \pdfmeta_standard_verify:nF{Catalog_EmbeddedFiles} @@ -1628,14 +1657,64 @@ \group_begin: \pdfdict_put:nne {l_pdffile/Filespec} {Desc}{(note~about~PDF/A-4F)} \pdfdict_put:nnn { l_pdffile/Filespec }{AFRelationship} { /Unspecified } - \pdffile_embed_stream:nnN {PDF~standard~A-4F~requires~a~file}{readme.txt}\l__pdfmeta_tmpa_tl - \exp_args:Nne \__pdf_backend_Names_gpush:nn{EmbeddedFiles}{(readme)~\l__pdfmeta_tmpa_tl} + \pdffile_embed_stream:nnN + {The~document~was~declared~to~be~of~type~PDF/A-4f~but~hasn't~any~attachments.~ + LaTeX~therefore~added~this~dummy~file.} + {pdf-A4f.txt} + \l__pdfmeta_tmpa_tl + \exp_args:Nne \__pdf_backend_Names_gpush:nn{EmbeddedFiles}{(pdf-A4f)~\l__pdfmeta_tmpa_tl} \group_end: } } } } } +\AddToHook{pdfmeta/xmp} + { + \pdfmeta_standard_verify:nF{no_embed_content} + { + \bool_lazy_or:nnT + { ! \int_if_zero_p:n { \g_pdffile_embed_pdfa_int } } + { ! \int_if_zero_p:n { \g_pdffile_embed_nonpdfa_int } } + { + \prop_get:NnNT\g__pdfmeta_standard_prop { name }\l__pdfmeta_tmpa_tl + { + \msg_warning:nne { pdf } { validation-failure } + { + Embedded~files~detected.\iow_newline: + This~is~not~allowed~in~standard~\l__pdfmeta_tmpa_tl + } + } + } + } + \pdfmeta_standard_verify:nF {only_pdfa_embed_content} + { + \int_if_zero:nF { \g_pdffile_embed_nonpdfa_int } + { + \prop_get:NnNT\g__pdfmeta_standard_prop { name }\l__pdfmeta_tmpa_tl + { + \str_if_eq:VnTF {\l__pdfmeta_tmpa_tl} { pdf/A-4 } + { + \prop_gset_eq:cc + { g__pdfmeta_standard_prop } + { g__pdfmeta_standard_pdf/A-4F_prop } + \msg_warning:nne { pdf } { validation-failure } + { + Embedded~non-PDF~files~detected.\iow_newline: + Switching~standard~from~PDF/A-4~to~PDF/A-4F + } + } + { + \msg_warning:nne { pdf } { validation-failure } + { + Embedded~non-PDF~files~detected.\iow_newline: + This~is~not~allowed~in~standard~\l__pdfmeta_tmpa_tl + } + } + } + } + } + } \prop_new:N \g__pdfmeta_outputintents_prop \keys_define:nn { document / metadata } { @@ -2828,6 +2907,7 @@ \g__pdfmeta_xmp_user_packet_tl \int_set:Nn \l__pdfmeta_xmp_indent_int {3} } +\hook_new:n { pdfmeta/xmp } \AddToHook{shipout/lastpage} { \bool_if:NT\g__pdfmeta_xmp_bool @@ -2840,6 +2920,7 @@ \file_get_timestamp:nN{\jobname.log}\l__pdfmeta_xmp_currentdate_tl } \__pdfmeta_xmp_date_split:VN\l__pdfmeta_xmp_currentdate_tl\l__pdfmeta_xmp_currentdate_seq + \hook_use:n { pdfmeta/xmp } \__pdfmeta_xmp_build_packet: \exp_args:No \__pdf_backend_metadata_stream:n {\g__pdfmeta_xmp_packet_tl} @@ -3123,6 +3204,8 @@ ,.sty = text/plain ,.xml = application/xml } +\int_new:N\g_pdffile_embed_pdfa_int +\int_new:N\g_pdffile_embed_nonpdfa_int \str_new:N \l_pdffile_source_name_str \pdfdict_new:n { l_pdffile } \pdfdict_put:nnn { l_pdffile }{Type}{/EmbeddedFile} @@ -3159,33 +3242,41 @@ \prop_map_function:NN {\g_pdffile_embed_prop} \msg_show_item:nn } } -\cs_new_protected:Npn \__pdffile_mimetype_set:nN #1 #2 +\cs_new_protected:Npn \__pdffile_mimetype_set:nNN #1 #2 #3 { \file_parse_full_name:nNNN {#1} \l__pdffile_tmpa_str %unused \l__pdffile_tmpb_str %unused \l__pdffile_ext_str - %check if Subtype has been set - \pdfdict_get:nnN { l_pdffile}{Subtype}\l__pdffile_tmpa_tl - %if not look up in the prop: - \quark_if_no_value:NT \l__pdffile_tmpa_tl + %check if Subtype has been set + \pdfdict_get:nnN { l_pdffile}{Subtype}\l__pdffile_tmpa_tl + %if not look up in the prop: + \quark_if_no_value:NT \l__pdffile_tmpa_tl + { + \prop_get:NVNTF + \g_pdffile_mimetypes_prop + \l__pdffile_ext_str + \l__pdffile_tmpb_tl { - \prop_get:NVNTF - \g_pdffile_mimetypes_prop - \l__pdffile_ext_str - \l__pdffile_tmpb_tl - { - \tl_set:Ne #2 {/Subtype~\pdf_name_from_unicode_e:V \l__pdffile_tmpb_tl} - } - { - \msg_warning:nne { pdffile }{ mimetype-missing} {#1} - \tl_clear:N #2 - } + \tl_set:Ne #2 {/Subtype~\pdf_name_from_unicode_e:V \l__pdffile_tmpb_tl} } - } + { + \msg_warning:nne { pdffile }{ mimetype-missing} {#1} + \tl_clear:N #2 + } + } + \tl_set_eq:NN #3 \l__pdffile_ext_str + } + +\cs_generate_variant:Nn \__pdffile_mimetype_set:nNN {VNN} -\cs_generate_variant:Nn \__pdffile_mimetype_set:nN {VN} +\cs_new_protected:Npn \__pdffile_count_embed:N #1 + { + \str_if_eq:VnTF #1 {.pdf} + {\int_gincr:N \g_pdffile_embed_pdfa_int } + {\int_gincr:N \g_pdffile_embed_nonpdfa_int } + } \cs_new_protected:Npn \__pdffile_fstream_write:nN #1 #2 { @@ -3298,9 +3389,11 @@ { \file_get_full_name:nNTF {#1} \l_pdffile_source_name_str { - \__pdffile_mimetype_set:VN + \__pdffile_mimetype_set:VNN \l_pdffile_source_name_str \l__pdffile_automimetype_tl + \l__pdffile_tmpa_tl + \__pdffile_count_embed:N \l__pdffile_tmpa_tl \__pdffile_fstream_write:VN \l_pdffile_source_name_str \l__pdffile_automimetype_tl @@ -3358,8 +3451,9 @@ { #3 } {{stream}{}{\tl_if_blank:nTF {#2}{stream.txt}{\exp_not:n{#2}}}} \tl_if_blank:nTF {#2} - { \__pdffile_mimetype_set:nN {stream.txt}\l__pdffile_automimetype_tl} - { \__pdffile_mimetype_set:nN { #2 } \l__pdffile_automimetype_tl } + { \__pdffile_mimetype_set:nNN {stream.txt}\l__pdffile_automimetype_tl \l__pdffile_tmpa_tl} + { \__pdffile_mimetype_set:nNN { #2 } \l__pdffile_automimetype_tl \l__pdffile_tmpa_tl } + \__pdffile_count_embed:N \l__pdffile_tmpa_tl \__pdffile_stream_write:nN { #1 } \l__pdffile_automimetype_tl @@ -3377,8 +3471,9 @@ \cs_new_protected:Npn \pdffile_embed_stream:nnN #1 #2 #3 { \tl_if_blank:nTF {#2} - { \__pdffile_mimetype_set:nN {stream.txt}\l__pdffile_automimetype_tl} - { \__pdffile_mimetype_set:nN { #2 } \l__pdffile_automimetype_tl } + { \__pdffile_mimetype_set:nNN {stream.txt}\l__pdffile_automimetype_tl \l__pdffile_tmpa_tl} + { \__pdffile_mimetype_set:nNN { #2 } \l__pdffile_automimetype_tl \l__pdffile_tmpa_tl } + \__pdffile_count_embed:N\l__pdffile_tmpa_tl \__pdffile_stream_write:nN { #1 } \l__pdffile_automimetype_tl diff --git a/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty b/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty index 0d31a57e4..a97dd03f4 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty +++ b/texmf/tex/latex/pdfmanagement-testphase/pdfmanagement-testphase.sty @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: pdfmanagement-testphase.dtx -\ProvidesExplPackage{pdfmanagement-testphase}{2024-10-27}{0.96n} +\ProvidesExplPackage{pdfmanagement-testphase}{2024-12-20}{0.96o} {LaTeX PDF management testphase bundle} \providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} \IfFormatAtLeastTF{2020-10-01}{}{ diff --git a/texmf/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty b/texmf/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty index bde07318f..421ee2f34 100644 --- a/texmf/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty +++ b/texmf/tex/latex/pdfmanagement-testphase/xcolor-patches-tmp-ltx.sty @@ -1,6 +1,6 @@ %% LaTeX2e file `xcolor-patches-tmp-ltx.sty' %% -\ProvidesPackage{xcolor-patches-tmp-ltx}[2024-10-27 v0.96n patch xcolor for l3color] +\ProvidesPackage{xcolor-patches-tmp-ltx}[2024-12-20 v0.96o patch xcolor for l3color] \@ifundefined{color_set:nn}{\RequirePackage{l3color}}{} \ExplSyntaxOn