diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/embedfile.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/embedfile.sty | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/embedfile.sty b/Master/texmf-dist/tex/latex/oberdiek/embedfile.sty index 4a9d4a72c6d..833c0c2215f 100644 --- a/Master/texmf-dist/tex/latex/oberdiek/embedfile.sty +++ b/Master/texmf-dist/tex/latex/oberdiek/embedfile.sty @@ -81,7 +81,7 @@ \fi \expandafter\x\csname ver@embedfile.sty\endcsname \ProvidesPackage{embedfile}% - [2007/10/28 v2.0 embed files into PDF (HO)] + [2007/10/29 v2.1 embed files into PDF (HO)] \expandafter\edef\csname EmFi@AtEnd\endcsname{% \catcode64 \the\catcode64\relax } @@ -166,6 +166,7 @@ \newif\ifEmFi@edit \newif\ifEmFi@item \newif\ifEmFi@finished +\newif\ifEmFi@id \expandafter\ifx\csname define@key\endcsname\relax \chardef\EmFi@plain=\z@ \def\EmFi@temp#1{% @@ -271,6 +272,37 @@ \fi \fi } +\define@key{EmFi}{id}{% + \def\EmFi@id{#1}% + \EmFi@idtrue +} +\def\EmFi@defobj#1{% + \ifEmFi@id + \expandafter\xdef\csname EmFi@#1@\EmFi@id\endcsname{% + \the\pdflastobj\space 0 R% + }% + \fi +} +\def\embedfileifobjectexists#1#2{% + \expandafter\ifx\csname EmFi@#2@#1\endcsname\relax + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi +} +\expandafter\ifx\csname @firstoftwo\endcsname\relax + \long\def\@firstoftwo#1#2{#1}% +\fi +\expandafter\ifx\csname @secondoftwo\endcsname\relax + \long\def\@secondoftwo#1#2{#2}% +\fi +\def\embedfilegetobject#1#2{% + \embedfileifobjectexists{#1}{#2}{% + \csname EmFi@#2@#1\endcsname + }{% + 0 0 R% + }% +} \define@key{EmFi}{view}[]{% \EdefSanitize\EmFi@temp{#1}% \def\EmFi@next{% @@ -546,6 +578,7 @@ /CheckSum<\pdfmdfivesum file{\EmFi@file}>% >>% }file{\EmFi@file}\relax + \EmFi@defobj{EmbeddedFile}% \immediate\pdfobj{% <<% /Type/Filespec% @@ -566,6 +599,7 @@ \fi >>% }% + \EmFi@defobj{Filespec}% \EmFi@add{% \EmFi@@filespec }{\the\pdflastobj\space 0 R}% |