%%
%% This is file `atfipdftex.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% attachfile2.dtx  (with options: `pdftex')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2005-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
%% version 1.3 of this license or (at your option) any later
%% version. The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% This Current Maintainer of this work is Heiko Oberdiek.
%% 
%% This work consists of the main source file attachfile2.dtx
%% and the derived files
%%    attachfile2.sty, attachfile2.pdf, attachfile2.ins, attachfile2.drv,
%%    atfidvips.def, atfipdftex.def, pdfatfi.pl.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{atfipdftex.def}%
  [2009/09/25 v2.5 attachfile2 driver for pdfTeX (HO)]%
\let\atfi@literal\pdfliteral


\def\atfi@GSAVE{q }
\def\atfi@GRESTORE{Q }
\def\atfi@SETLINEWIDTH{w }
\def\atfi@LINETO{l }
\def\atfi@MOVETO{m }
\def\atfi@STROKE{S }
\def\atfi@FILL{f }
\def\atfi@FILLSTROKE#1#2{#1#2B }
\def\atfi@SETRGBCOLORSTROKE{RG }
\def\atfi@SETRGBCOLORFILL{rg }
\def\atfi@SETGRAYSTROKE{G }
\def\atfi@SETGRAYFILL{g }
\def\atfi@SETCMYKCOLORSTROKE{K }
\def\atfi@SETCMYKCOLORFILL{k }
\def\atfi@RECTFILL{re f }
\def\atfi@RECTSTROKEFILL#1#2#3{#1#2#3re B }
\def\atfi@SETMITERLIMIT{M }
\def\atfi@SETFLAT{i }
\def\atfi@SETLINECAP{J }
\def\atfi@CURVETO{c }
\def\atfi@CURVETOV{v }
\def\atfi@CURVETOY{y }
\def\atfi@CLOSEPATH{h }
\def\atfi@SETLINEJOIN{j }


\define@key{AtFi@file}{Size}{%
  \edef\atfi@params{\atfi@params/Size #1}%
}

\def\atfi@embedfile#1{%
  \@ifundefined{atfi@fileobj@#1}{%
    \begingroup
      \let\atfi@params\@empty
      \@ifundefined{atfi@file@#1}{}{%
        \edef\x{\noexpand\setkeys{AtFi@file}{\@nameuse{atfi@file@#1}}}%
        \x
      }%
      \ifx\atfi@params\@empty
      \else
        \edef\atfi@params{/Params<<\atfi@params>>}%
      \fi
      \immediate\pdfobj stream attr {%
        /Type/EmbeddedFile%
        \atfi@mimetype
        \atfi@params
      } file {#1}%
      \expandafter\xdef\csname atfi@fileobj@#1\endcsname{\the\pdflastobj}%
    \endgroup
  }{%
    % file already embedded
  }%
}


\def\atfi@xform{%
  \immediate\pdfxform\atfi@appearancebox
  \edef\atfi@appearanceobj{\the\pdflastxform}%
}
\let\atfi@xform@icon\atfi@xform

\def\atfi@refxform#1{%
  \pdfrefxform#1\relax
}


\def\atfi@insert@file@annot#1{%
  \rule{0pt}{0pt}%
  \ifatfi@appearance
    \def\atfi@appearance@dict{%
      /AP<<%
        /N \atfi@appearanceobj\space 0 R%
        /R \atfi@appearanceobj\space 0 R%
        /D \atfi@appearanceobj\space 0 R%
      >>%
    }%
  \else
    \let\atfi@appearance@dict\@empty
  \fi
  \@ifundefined{atfi@fsobj@#1}{%
    \begingroup
      \hypersetup{unicode=false}%
      \atfi@pdfstringdef\atfi@file{#1}%
      \immediate\pdfobj{%
        <<%
          /Type/Filespec%
          /F(\atfi@file)%
          \ifx\atfi@ucfilespec\@empty
          \else
            /UF(\atfi@ucfilespec)%
          \fi
          /EF<<%
            /F \@nameuse{atfi@fileobj@#1} 0 R%
          >>%
        >>%
      }%
      \expandafter\xdef\csname atfi@fsobj@#1\endcsname{%
        \the\pdflastobj
      }%
    \endgroup
  }{%
  }%
  \pdfannot width \atfi@scale\atfi@appearancewidth
            height \atfi@scale\atfi@appearanceheight
            depth \atfi@scale\atfi@appearancedepth {%
    /Subtype/FileAttachment%
    \atfi@icon
    \atfi@color@annot
    \atfi@author
    \atfi@date
    \atfi@annotname
    \atfi@description
    \atfi@subject
    \atfi@appearance@dict
    /F \theatfi@flags
    /FS \@nameuse{atfi@fsobj@#1} 0 R%
  }%
  \rule{0pt}{\atfi@appearanceheight}%
  \rule[-\atfi@appearancedepth]{0pt}{\atfi@appearancedepth}%
  \rule{\atfi@appearancewidth}{0pt}%
}

\endinput
%%
%% End of file `atfipdftex.def'.
