texlive[51247] Master/texmf-dist: intopdf (28may19)
commits+karl at tug.org
commits+karl at tug.org
Tue May 28 23:23:18 CEST 2019
Revision: 51247
http://tug.org/svn/texlive?view=revision&revision=51247
Author: karl
Date: 2019-05-28 23:23:18 +0200 (Tue, 28 May 2019)
Log Message:
-----------
intopdf (28may19)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/intopdf/intopdf.pdf
trunk/Master/texmf-dist/source/latex/intopdf/intopdf.dtx
trunk/Master/texmf-dist/tex/latex/intopdf/intopdf.sty
Modified: trunk/Master/texmf-dist/doc/latex/intopdf/intopdf.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/intopdf/intopdf.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/intopdf/intopdf.dtx 2019-05-28 21:22:35 UTC (rev 51246)
+++ trunk/Master/texmf-dist/source/latex/intopdf/intopdf.dtx 2019-05-28 21:23:18 UTC (rev 51247)
@@ -46,7 +46,7 @@
%
% \GetFileInfo{intopdf.dtx}
% \title{The \pkg{intopdf} package\thanks{This document
-% corresponds to \pkg{intopdf}~0.1.0, dated~2018/03/15.}}
+% corresponds to \pkg{intopdf}~0.2.1, dated~2019/05/28.}}
% \author{Marcel Kr\"uger \\ \href{mailto:tex at 2krueger.de}{tex at 2krueger.de}}
%
% \maketitle
@@ -58,12 +58,14 @@
% \section{Usage}
% \begin{function}{\attachandlink}
% \begin{syntax}
-% |\attachandlink| \Arg{filename}[\meta{mime-type}]\Arg{Description}\Arg{link text}
+% |\attachandlink| [\meta{filespec}]\Arg{filename}[\meta{mime-type}]\Arg{Description}\Arg{link text}
% \end{syntax}
% The text \meta{link text} is inserted, linking to the file \meta{filename} which is attached to the document.
%
% \meta{Description} should be a description of the file and will be shown by the PDF viewer in the atttached files section and sometimes in a mouseover tooltip.\\
% \meta{mime-type} should be the MIME-Type of \meta{filename}. Currently \meta{mime-type} is mandatory but I hope to make it optional in a later release.
+% Additionally \meta{filespec} can be used to specify the filename which will be shown in the PDF viewer.
+% If this is not given, it will default to \meta{filename}.
% \end{function}
% \section{Example}
% The source of the document is attached
@@ -84,11 +86,11 @@
% \iffalse
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\RequirePackage{expl3}
+\RequirePackage{expl3,xparse}
\ProvidesExplPackage
{intopdf}
- {2018/03/15}
- {0.1.0}
+ {2019/05/28}
+ {0.2.1}
{Embed non-PDF files into PDF with hyperlink}
\RequirePackage{hyperref}
@@ -167,18 +169,19 @@
\__intopdf_annot_end:
}
% \end{macrocode}
-% \begin{macro}{\intopdf_attach_link:nnnn,\attachandlink}
+% \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}.}
% The main functionality.
% \begin{macrocode}
-\cs_new_protected:Nn\intopdf_attach_link:nnnn{
+\cs_new_protected:Nn\intopdf_attach_link:nnnnn{
\__intopdf_pdfstream_file:nn{
- /Subtype /\__intopdf_escape_name:n{#2}
- }{#1}
+ /Subtype /\__intopdf_escape_name:n{#3}
+ }{#2}
\__intopdf_pdfobj:n{
/Type /Filespec
/F \__intopdf_escape_string:n{#1}
/EF << /F \__intopdf_lastobj_ref: >>
- /Desc \__intopdf_escape_string:n{#3}
+ /Desc \__intopdf_escape_string:n{#4}
}%
\__intopdf_annot:nnn{
\Hy at setpdfborder
@@ -196,15 +199,18 @@
/FS \__intopdf_lastobj_ref:
/F\c_space_tl 416
/CA\c_space_tl 0
- /Contents \__intopdf_escape_string:n{#3}
+ /Contents \__intopdf_escape_string:n{#4}
}{
- #4
+ #5
}
}
}
-\cs_new_protected:Npn\attachandlink#1[#2]#3#4{
- \intopdf_attach_link:nnnn{#1}{#2}{#3}{#4}
+\cs_new_protected:Npn \intopdf_attach_link:nnnn #1{
+ \intopdf_attach_link:nnnnn{#1}{#1}
}
+\NewDocumentCommand\attachandlink{O{#2}mr[]mm}{
+ \intopdf_attach_link:nnnnn{#1}{#2}{#3}{#4}{#5}
+}
% \end{macrocode}
% \end{macro}
% \end{implementation}
Modified: trunk/Master/texmf-dist/tex/latex/intopdf/intopdf.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/intopdf/intopdf.sty 2019-05-28 21:22:35 UTC (rev 51246)
+++ trunk/Master/texmf-dist/tex/latex/intopdf/intopdf.sty 2019-05-28 21:23:18 UTC (rev 51247)
@@ -18,11 +18,11 @@
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
\NeedsTeXFormat{LaTeX2e}
-\RequirePackage{expl3}
+\RequirePackage{expl3,xparse}
\ProvidesExplPackage
{intopdf}
- {2018/03/15}
- {0.1.0}
+ {2019/05/28}
+ {0.2.1}
{Embed non-PDF files into PDF with hyperlink}
\RequirePackage{hyperref}
@@ -91,15 +91,15 @@
#3
\__intopdf_annot_end:
}
-\cs_new_protected:Nn\intopdf_attach_link:nnnn{
+\cs_new_protected:Nn\intopdf_attach_link:nnnnn{
\__intopdf_pdfstream_file:nn{
- /Subtype /\__intopdf_escape_name:n{#2}
- }{#1}
+ /Subtype /\__intopdf_escape_name:n{#3}
+ }{#2}
\__intopdf_pdfobj:n{
/Type /Filespec
/F \__intopdf_escape_string:n{#1}
/EF << /F \__intopdf_lastobj_ref: >>
- /Desc \__intopdf_escape_string:n{#3}
+ /Desc \__intopdf_escape_string:n{#4}
}%
\__intopdf_annot:nnn{
\Hy at setpdfborder
@@ -117,15 +117,18 @@
/FS \__intopdf_lastobj_ref:
/F\c_space_tl 416
/CA\c_space_tl 0
- /Contents \__intopdf_escape_string:n{#3}
+ /Contents \__intopdf_escape_string:n{#4}
}{
- #4
+ #5
}
}
}
-\cs_new_protected:Npn\attachandlink#1[#2]#3#4{
- \intopdf_attach_link:nnnn{#1}{#2}{#3}{#4}
+\cs_new_protected:Npn \intopdf_attach_link:nnnn #1{
+ \intopdf_attach_link:nnnnn{#1}{#1}
}
+\NewDocumentCommand\attachandlink{O{#2}mr[]mm}{
+ \intopdf_attach_link:nnnnn{#1}{#2}{#3}{#4}{#5}
+}
\endinput
%%
%% End of file `intopdf.sty'.
More information about the tex-live-commits
mailing list