diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/intopdf/intopdf.pdf | bin | 398683 -> 396617 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/intopdf/intopdf.dtx | 94 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/intopdf/intopdf.sty | 90 |
3 files changed, 45 insertions, 139 deletions
diff --git a/Master/texmf-dist/doc/latex/intopdf/intopdf.pdf b/Master/texmf-dist/doc/latex/intopdf/intopdf.pdf Binary files differindex 32099b778d9..e5695314923 100644 --- a/Master/texmf-dist/doc/latex/intopdf/intopdf.pdf +++ b/Master/texmf-dist/doc/latex/intopdf/intopdf.pdf diff --git a/Master/texmf-dist/source/latex/intopdf/intopdf.dtx b/Master/texmf-dist/source/latex/intopdf/intopdf.dtx index 903e295b801..64878391d8d 100644 --- a/Master/texmf-dist/source/latex/intopdf/intopdf.dtx +++ b/Master/texmf-dist/source/latex/intopdf/intopdf.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% Copyright (C) 2018 by Marcel Krueger +%% Copyright (C) 2020 by Marcel Krueger %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -20,6 +20,7 @@ %</gobble> \input l3docstrip.tex \keepsilent +\askforoverwritefalse \preamble \endpreamble \generate{\file{intopdf.sty}{\from{intopdf.dtx}{package}}} @@ -46,7 +47,7 @@ % % \GetFileInfo{intopdf.dtx} % \title{The \pkg{intopdf} package\thanks{This document -% corresponds to \pkg{intopdf}~0.2.1, dated~2019/05/28.}} +% corresponds to \pkg{intopdf}~0.3.0, dated~2020/03/13.}} % \author{Marcel Kr\"uger \\ \href{mailto:tex@2krueger.de}{tex@2krueger.de}} % % \maketitle @@ -89,11 +90,11 @@ \RequirePackage{expl3,xparse} \ProvidesExplPackage {intopdf} - {2019/05/28} - {0.2.1} + {2020/03/13} + {0.3.0} {Embed non-PDF files into PDF with hyperlink} -\RequirePackage{hyperref} +\RequirePackage{l3pdf,hyperref} %</package> % \fi % \changes{v0.1.0}{2018/03/15}{Added \LuaLaTeX\ support} @@ -111,79 +112,32 @@ {pdftex}{ \cs_new:Nn\__intopdf_escape_name:n{\pdfescapename{#1}} \cs_new:Nn\__intopdf_escape_string:n{(\pdfescapestring{#1})} - \cs_new:Nn\__intopdf_pdfobj:n{ - \tex_immediate:D\pdftex_pdfobj:D{<<#1>>} - } - \cs_new:Nn\__intopdf_pdfstream_file:nn{ - \tex_immediate:D\pdftex_pdfobj:D stream attr {#1} file {#2} - } - \cs_new:Nn\__intopdf_lastobj_ref:{ - \c_space_tl - \int_use:N\pdftex_pdflastobj:D - \c_space_tl - 0 - \c_space_tl - R - } - \cs_new:Npn\__intopdf_annot:nnw#1#2{ - \leavevmode - \pdftex_pdfstartlink:D attr{#1} user {#2} - } - \cs_new:Nn\__intopdf_annot_end:{ - \pdftex_pdfendlink:D - } } {luatex}{ \RequirePackage{pdftexcmds} \cs_new:Nn\__intopdf_escape_name:n{\pdf@escapename{#1}} \cs_new:Nn\__intopdf_escape_string:n{(\pdf@escapestring{#1})} - \cs_new:Nn\__intopdf_pdfobj:n{ - \tex_immediate:D\luatex_pdfextension:D obj{<<#1>>} - } - \cs_new:Nn\__intopdf_pdfstream_file:nn{ - \tex_immediate:D\luatex_pdfextension:D obj stream attr {#1} file {#2} - } - \cs_new:Nn\__intopdf_lastobj_ref:{ - \c_space_tl - \luatex_pdffeedback:D lastobj - \c_space_tl - 0 - \c_space_tl - R - } - \cs_new:Npn\__intopdf_annot:nnw#1#2{ - \leavevmode - \luatex_pdfextension:D startlink attr{#1} user {#2} - } - \cs_new:Nn\__intopdf_annot_end:{ - \luatex_pdfextension:D endlink - \scan_stop: - } } }{ \msg_critical:nn{intopdf}{engine-unsupported} } -\cs_new:Nn\__intopdf_annot:nnn{ - \__intopdf_annot:nnw{#1}{#2} - #3 - \__intopdf_annot_end: -} % \end{macrocode} % \begin{macro}{\attachandlink,\intopdf_attach_link:nnnnn,\intopdf_attach_link:nnnn} % \changes{v0.2.0}{2019/05/21}{Added filespec support. (The first optional argument) Added \cs{intopdf_attach_link:nnnnn}.} +% \changes{v0.3.0}{2020/03/13}{Switched to \texttt{l3pdf} instead of using primitives directly. Currently some internal functions from \texttt{l3backend} are needed too for handling links.} % The main functionality. % \begin{macrocode} \cs_new_protected:Nn\intopdf_attach_link:nnnnn{ - \__intopdf_pdfstream_file:nn{ - /Subtype /\__intopdf_escape_name:n{#3} - }{#2} - \__intopdf_pdfobj:n{ + \pdf_object_now:nx {fstream} { { + /Subtype /\__intopdf_escape_name:n { #3 } + } { #2 } } + \pdf_object_now:nx {dict} { /Type /Filespec - /F \__intopdf_escape_string:n{#1} - /EF << /F \__intopdf_lastobj_ref: >> - /Desc \__intopdf_escape_string:n{#4} - }% - \__intopdf_annot:nnn{ + /F \__intopdf_escape_string:n { #1 } + /EF << /F~\pdf_object_last: >> + /Desc \__intopdf_escape_string:n { #4 } + } + \__pdf_backend_link_begin_user:nnw { \Hy@setpdfborder \tl_if_empty:NF\@pdfhighlight{ /H\@pdfhighlight @@ -193,17 +147,17 @@ } }{ /Subtype /Link - }{ - \__intopdf_annot:nnn{}{ + } + \__pdf_backend_link_begin_user:nnw { } { /Subtype /FileAttachment - /FS \__intopdf_lastobj_ref: - /F\c_space_tl 416 - /CA\c_space_tl 0 + /FS~\pdf_object_last: + /F~416 + /CA~0 /Contents \__intopdf_escape_string:n{#4} - }{ - #5 } - } + #5 + \__pdf_backend_link_end: + \__pdf_backend_link_end: } \cs_new_protected:Npn \intopdf_attach_link:nnnn #1{ \intopdf_attach_link:nnnnn{#1}{#1} diff --git a/Master/texmf-dist/tex/latex/intopdf/intopdf.sty b/Master/texmf-dist/tex/latex/intopdf/intopdf.sty index 311ee82a403..42c0b6c3ab8 100644 --- a/Master/texmf-dist/tex/latex/intopdf/intopdf.sty +++ b/Master/texmf-dist/tex/latex/intopdf/intopdf.sty @@ -6,7 +6,7 @@ %% %% intopdf.dtx (with options: `package') %% -%% Copyright (C) 2018 by Marcel Krueger +%% Copyright (C) 2020 by Marcel Krueger %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -21,11 +21,11 @@ \RequirePackage{expl3,xparse} \ProvidesExplPackage {intopdf} - {2019/05/28} - {0.2.1} + {2020/03/13} + {0.3.0} {Embed non-PDF files into PDF with hyperlink} -\RequirePackage{hyperref} +\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.} @@ -34,74 +34,26 @@ {pdftex}{ \cs_new:Nn\__intopdf_escape_name:n{\pdfescapename{#1}} \cs_new:Nn\__intopdf_escape_string:n{(\pdfescapestring{#1})} - \cs_new:Nn\__intopdf_pdfobj:n{ - \tex_immediate:D\pdftex_pdfobj:D{<<#1>>} - } - \cs_new:Nn\__intopdf_pdfstream_file:nn{ - \tex_immediate:D\pdftex_pdfobj:D stream attr {#1} file {#2} - } - \cs_new:Nn\__intopdf_lastobj_ref:{ - \c_space_tl - \int_use:N\pdftex_pdflastobj:D - \c_space_tl - 0 - \c_space_tl - R - } - \cs_new:Npn\__intopdf_annot:nnw#1#2{ - \leavevmode - \pdftex_pdfstartlink:D attr{#1} user {#2} - } - \cs_new:Nn\__intopdf_annot_end:{ - \pdftex_pdfendlink:D - } } {luatex}{ \RequirePackage{pdftexcmds} \cs_new:Nn\__intopdf_escape_name:n{\pdf@escapename{#1}} \cs_new:Nn\__intopdf_escape_string:n{(\pdf@escapestring{#1})} - \cs_new:Nn\__intopdf_pdfobj:n{ - \tex_immediate:D\luatex_pdfextension:D obj{<<#1>>} - } - \cs_new:Nn\__intopdf_pdfstream_file:nn{ - \tex_immediate:D\luatex_pdfextension:D obj stream attr {#1} file {#2} - } - \cs_new:Nn\__intopdf_lastobj_ref:{ - \c_space_tl - \luatex_pdffeedback:D lastobj - \c_space_tl - 0 - \c_space_tl - R - } - \cs_new:Npn\__intopdf_annot:nnw#1#2{ - \leavevmode - \luatex_pdfextension:D startlink attr{#1} user {#2} - } - \cs_new:Nn\__intopdf_annot_end:{ - \luatex_pdfextension:D endlink - \scan_stop: - } } }{ \msg_critical:nn{intopdf}{engine-unsupported} } -\cs_new:Nn\__intopdf_annot:nnn{ - \__intopdf_annot:nnw{#1}{#2} - #3 - \__intopdf_annot_end: -} \cs_new_protected:Nn\intopdf_attach_link:nnnnn{ - \__intopdf_pdfstream_file:nn{ - /Subtype /\__intopdf_escape_name:n{#3} - }{#2} - \__intopdf_pdfobj:n{ + \pdf_object_now:nx {fstream} { { + /Subtype /\__intopdf_escape_name:n { #3 } + } { #2 } } + \pdf_object_now:nx {dict} { /Type /Filespec - /F \__intopdf_escape_string:n{#1} - /EF << /F \__intopdf_lastobj_ref: >> - /Desc \__intopdf_escape_string:n{#4} - }% - \__intopdf_annot:nnn{ + /F \__intopdf_escape_string:n { #1 } + /EF << /F~\pdf_object_last: >> + /Desc \__intopdf_escape_string:n { #4 } + } + \__pdf_backend_link_begin_user:nnw { \Hy@setpdfborder \tl_if_empty:NF\@pdfhighlight{ /H\@pdfhighlight @@ -111,17 +63,17 @@ } }{ /Subtype /Link - }{ - \__intopdf_annot:nnn{}{ + } + \__pdf_backend_link_begin_user:nnw { } { /Subtype /FileAttachment - /FS \__intopdf_lastobj_ref: - /F\c_space_tl 416 - /CA\c_space_tl 0 + /FS~\pdf_object_last: + /F~416 + /CA~0 /Contents \__intopdf_escape_string:n{#4} - }{ - #5 } - } + #5 + \__pdf_backend_link_end: + \__pdf_backend_link_end: } \cs_new_protected:Npn \intopdf_attach_link:nnnn #1{ \intopdf_attach_link:nnnnn{#1}{#1} |