summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/intopdf
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-03-17 21:44:35 +0000
committerKarl Berry <karl@freefriends.org>2021-03-17 21:44:35 +0000
commitf06e79bd309afbadc3fac255ad00b59ea6eb1652 (patch)
tree866611e32154b7b922bd035c9778da332d4418e3 /Master/texmf-dist/tex/latex/intopdf
parentda7eca05783b516162ded12b53f47f1a01b663de (diff)
intopdf (17mar21)
git-svn-id: svn://tug.org/texlive/trunk@58474 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/intopdf')
-rw-r--r--Master/texmf-dist/tex/latex/intopdf/intopdf.sty47
1 files changed, 19 insertions, 28 deletions
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: