From cb37e5a6b26541a5c9e4c66cf287d2179c698d23 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 17 Mar 2021 21:51:54 +0000 Subject: intopdf (17mar21) (branch) git-svn-id: svn://tug.org/texlive/branches/branch2020.0@58488 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/intopdf/intopdf.sty | 47 ++++++++++--------------- 1 file changed, 19 insertions(+), 28 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/intopdf/intopdf.sty b/Master/texmf-dist/tex/latex/intopdf/intopdf.sty index 42c0b6c3ab8..d2dad029939 100644 --- a/Master/texmf-dist/tex/latex/intopdf/intopdf.sty +++ b/Master/texmf-dist/tex/latex/intopdf/intopdf.sty @@ -21,37 +21,28 @@ \RequirePackage{expl3,xparse} \ProvidesExplPackage {intopdf} - {2020/03/13} - {0.3.0} + {2021/02/26} + {0.4.0} {Embed non-PDF files into PDF with hyperlink} -\RequirePackage{l3pdf,hyperref} -\msg_new:nnnn{intopdf}{engine-unsupported} - {Your~TeX~engine~is~not~supported~by~intopdf.} - {To~use~intopdf,~you~have~to~use~pdfLaTeX~or~LuaLaTeX.} -\cs_generate_variant:Nn\str_case:nnF{VnF} -\str_case:VnF\c_sys_engine_str{ - {pdftex}{ - \cs_new:Nn\__intopdf_escape_name:n{\pdfescapename{#1}} - \cs_new:Nn\__intopdf_escape_string:n{(\pdfescapestring{#1})} - } - {luatex}{ - \RequirePackage{pdftexcmds} - \cs_new:Nn\__intopdf_escape_name:n{\pdf@escapename{#1}} - \cs_new:Nn\__intopdf_escape_string:n{(\pdf@escapestring{#1})} - } -}{ - \msg_critical:nn{intopdf}{engine-unsupported} -} +\RequirePackage{hyperref} +\str_new:N \l__intopdf_mime_str +\str_new:N \l__intopdf_filename_str +\str_new:N \l__intopdf_description_str + \cs_new_protected:Nn\intopdf_attach_link:nnnnn{ - \pdf_object_now:nx {fstream} { { - /Subtype /\__intopdf_escape_name:n { #3 } + \leavevmode + \str_set_convert:Nnnn \l__intopdf_mime_str { #3 } { default } { utf8/name } + \pdf_object_unnamed_write:nx {fstream} { { + /Subtype /\l__intopdf_mime_str } { #2 } } - \pdf_object_now:nx {dict} { + \str_set_convert:Nnnn \l__intopdf_filename_str { #1 } { default } { utf16/string } + \str_set_convert:Nnnn \l__intopdf_description_str { #4 } { default } { utf16/string } + \pdf_object_unnamed_write:nx {dict} { /Type /Filespec - /F \__intopdf_escape_string:n { #1 } - /EF << /F~\pdf_object_last: >> - /Desc \__intopdf_escape_string:n { #4 } + /F (\l__intopdf_filename_str) + /EF << /F~\pdf_object_ref_last: >> + /Desc (\l__intopdf_description_str) } \__pdf_backend_link_begin_user:nnw { \Hy@setpdfborder @@ -66,10 +57,10 @@ } \__pdf_backend_link_begin_user:nnw { } { /Subtype /FileAttachment - /FS~\pdf_object_last: + /FS~\pdf_object_ref_last: /F~416 /CA~0 - /Contents \__intopdf_escape_string:n{#4} + /Contents (\l__intopdf_description_str) } #5 \__pdf_backend_link_end: -- cgit v1.2.3