diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/embedfile.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/embedfile.sty | 113 |
1 files changed, 66 insertions, 47 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/embedfile.sty b/Master/texmf-dist/tex/latex/oberdiek/embedfile.sty index 7adb01628bb..a7ff7208a83 100644 --- a/Master/texmf-dist/tex/latex/oberdiek/embedfile.sty +++ b/Master/texmf-dist/tex/latex/oberdiek/embedfile.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2006, 2007 by Heiko Oberdiek <oberdiek@uni-freiburg.de> +%% Copyright (C) 2006-2009 by Heiko Oberdiek <oberdiek@uni-freiburg.de> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either @@ -89,7 +89,7 @@ \fi \expandafter\x\csname ver@embedfile.sty\endcsname \ProvidesPackage{embedfile}% - [2007/11/25 v2.3 embed files into PDF (HO)] + [2009/09/25 v2.4 embed files into PDF (HO)] \begingroup \catcode123 1 % { \catcode125 2 % } @@ -151,6 +151,7 @@ \expandafter\endinput \fi \EmFi@RequirePackage{pdftexcmds}[2007/11/11] +\EmFi@RequirePackage{ltxcmds}[2009/08/05] \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname pdf@filesize\endcsname\relax \EmFi@Error{% @@ -181,7 +182,6 @@ \EmFi@temp{true} \EmFi@temp{false} \newif\ifEmFi@collection -\newif\ifEmFi@initialfile \newif\ifEmFi@sort \newif\ifEmFi@visible \newif\ifEmFi@edit @@ -280,6 +280,7 @@ } \EmFi@DefineKey{mimetype}{} \EmFi@DefineKey{filespec}{\EmFi@file} +\EmFi@DefineKey{ucfilespec}{} \EmFi@DefineKey{filesystem}{} \EmFi@DefineKey{desc}{} \EmFi@DefineKey{stringmethod}{% @@ -306,17 +307,11 @@ } \def\embedfileifobjectexists#1#2{% \expandafter\ifx\csname EmFi@#2@#1\endcsname\relax - \expandafter\@secondoftwo + \expandafter\ltx@secondoftwo \else - \expandafter\@firstoftwo + \expandafter\ltx@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 @@ -329,7 +324,7 @@ \def\EmFi@next{% \global\EmFi@collectiontrue }% - \ifx\EmFi@temp\empty + \ifx\EmFi@temp\ltx@empty \let\EmFi@view\EmFi@S@details \else\ifx\EmFi@temp\EmFi@S@details \let\EmFi@view\EmFi@S@details @@ -465,13 +460,13 @@ `\EmFi@S@descending }\@ehc \fi\fi - \ifx\EmFi@temp\empty + \ifx\EmFi@temp\ltx@empty \else \xdef\EmFi@sortkeys{% \EmFi@sortkeys /\pdf@escapename{#1}% }% - \ifx\EmFi@sortorders\empty + \ifx\EmFi@sortorders\ltx@empty \global\let\EmFi@sortorders\EmFi@temp \gdef\EmFi@sortcase{1}% \else @@ -561,9 +556,6 @@ \else \begingroup \def\EmFi@file{#2}% - \ifx\EmFi@file\EmFi@initialfile - \global\EmFi@initialfiletrue - \fi \setkeys{EmFi}{#1}% \expandafter\expandafter\expandafter \ifx\expandafter\expandafter\expandafter @@ -574,9 +566,16 @@ The unknown file is not embedded.% }% \else - \EmFi@convert\EmFi@filespec\EmFi@@filespec - \ifx\EmFi@desc\empty - \let\EmFi@@desc\empty + \edef\EmFi@@filespec{% + \pdf@escapestring{\EmFi@filespec}% + }% + \ifx\EmFi@ucfilespec\ltx@empty + \let\EmFi@@ucfilespec\ltx@empty + \else + \EmFi@convert\EmFi@ucfilespec\EmFi@@ucfilespec + \fi + \ifx\EmFi@desc\ltx@empty + \let\EmFi@@desc\ltx@empty \else \EmFi@convert\EmFi@desc\EmFi@@desc \fi @@ -591,7 +590,7 @@ \fi \immediate\pdfobj stream attr{% /Type/EmbeddedFile% - \ifx\EmFi@mimetype\empty + \ifx\EmFi@mimetype\ltx@empty \else /Subtype/\pdf@escapename{\EmFi@mimetype}% \fi @@ -605,12 +604,16 @@ \immediate\pdfobj{% <<% /Type/Filespec% - \ifx\EmFi@filesystem\empty + \ifx\EmFi@filesystem\ltx@empty \else /FS/\pdf@escapename{\EmFi@filesystem}% \fi /F(\EmFi@@filespec)% - \ifx\EmFi@@desc\empty + \ifx\EmFi@@ucfilespec\ltx@empty + \else + /UF(\EmFi@@ucfilespec)% + \fi + \ifx\EmFi@@desc\ltx@empty \else /Desc(\EmFi@@desc)% \fi @@ -654,19 +657,18 @@ \edef#2{\pdf@escapestring{#1}}% \fi } -\global\let\EmFi@list\empty +\global\let\EmFi@list\ltx@empty \def\EmFi@add#1#2{% \begingroup - \edef\key{\pdf@escapehex{#1}}% - \ifx\EmFi@list\empty - \xdef\EmFi@list{\noexpand\do{\key}{#2}}% + \ifx\EmFi@list\ltx@empty + \xdef\EmFi@list{\noexpand\do{#1}{#2}}% \else \def\do##1##2{% - \ifnum\pdf@strcmp{##1}{\key}>0 % + \ifnum\pdf@strcmp{##1}{#1}>0 % \edef\x{% \toks@{% \the\toks@% - \noexpand\do{\key}{#2}% + \noexpand\do{#1}{#2}% \noexpand\do{##1}{##2}% }% }% @@ -682,7 +684,7 @@ \fi }% \def\stop{% - \xdef\EmFi@list{\the\toks@\noexpand\do{\key}{#2}}% + \xdef\EmFi@list{\the\toks@\noexpand\do{#1}{#2}}% }% \toks@{}% \EmFi@list\stop @@ -697,12 +699,12 @@ The list of embedded files is already written.% }% \else - \ifx\EmFi@list\empty + \ifx\EmFi@list\ltx@empty \else \global\EmFi@finishedtrue \begingroup \def\do##1##2{% - <##1>##2% + (##1)##2% }% \immediate\pdfobj{% <<% @@ -713,21 +715,37 @@ /EmbeddedFiles \the\pdflastobj\space 0 R% }% \endgroup - \ifEmFi@initialfile + \ifx\EmFi@initialfile\ltx@empty + \else \EmFi@collectiontrue \fi \ifEmFi@collection - \ifEmFi@initialfile + \ifx\EmFi@initialfile\ltx@empty + \let\EmFi@@initialfile\ltx@empty \else - \ifx\EmFi@initialfile\empty - \EmFi@convert\EmFi@initialfile\EmFi@initialfile - \else - \@PackageWarningNoLine{embedfile}{% - Missing initial file `\EmFi@initialfile'\MessageBreak - among the embedded files% - }% - \EmFi@initialfilefalse - \fi + \edef\EmFi@@initialfile{% + \pdf@escapestring{\EmFi@initialfile}% + }% + \fi + \begingroup + \let\f=N% + \def\do##1##2{% + \def\x{##1}% + \ifx\x\EmFi@@initialfile + \let\f=Y% + \let\do\ltx@gobbletwo + \fi + }% + \EmFi@list + \expandafter\endgroup + \ifx\f Y% + \else + \@PackageWarningNoLine{embedfile}{% + Missing initial file `\EmFi@initialfile'\MessageBreak + among the embedded files% + }% + \let\EmFi@initialfile\ltx@empty + \let\EmFi@@initialfile\ltx@empty \fi \ifcase\EmFi@sortcase \def\EmFi@temp{}% @@ -749,19 +767,20 @@ }% \immediate\pdfobj{% <<% - \ifx\EmFi@schema\empty + \ifx\EmFi@schema\ltx@empty \else /Schema<<\EmFi@schema>>% \fi - \ifEmFi@initialfile - /D(\EmFi@initialfile)% + \ifx\EmFi@@initialfile\ltx@empty + \else + /D(\EmFi@@initialfile)% \fi \ifx\EmFi@view\EmFi@S@tile /View/T% \else\ifx\EmFi@view\EmFi@S@hidden /View/H% \fi\fi - \ifx\EmFi@temp\empty + \ifx\EmFi@temp\ltx@empty \EmFi@temp \else /Sort<<\EmFi@temp>>% |