summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/oberdiek/atfi-dvipdfmx.def
blob: dea3529fa36fb9bc564814c80c3f5ab19da8b137 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
%%
%% This is file `atfi-dvipdfmx.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% attachfile2.dtx  (with options: `dvipdfmx')
%% 
%% This is a generated file.
%% 
%% Project: attachfile2
%% Version: 2012/04/18 v2.7
%% 
%% Copyright (C) 2005-2010, 2012 by
%%    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%%    http://www.latex-project.org/lppl/lppl-1-3c.txt
%% and 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,
%%    atfi-dvips.def, atfi-pdftex.def, atfi-dvipdfmx.def,
%%    pdfatfi.pl.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{atfi-dvipdfmx.def}%
  [2012/04/18 v2.7 attachfile2 driver for dvipdfmx/XeTeX (HO)]%
\def\atfi@special#1{%
  \special{pdf:#1}%
}
\def\atfi@literal#1{%
  \atfi@special{content #1}%
}
\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 }
\newcounter{atfi@obj}
\renewcommand*{\theatfi@obj}{%
  @atfi_obj_\number\c@atfi@obj
}
\define@key{AtFi@file}{Size}{%
  \edef\atfi@params{\atfi@params/Size #1}%
}
\def\atfi@embedfile#1{%
  \ltx@IfUndefined{atfi@fileobj@#1}{%
    \stepcounter{atfi@obj}%
    \begingroup
      \let\atfi@params\ltx@empty
      \expandafter\let\expandafter\atfi@temp
          \csname atfi@file@#1\endcsname
      \ifx\atfi@temp\ltx@empty
        \let\atfi@temp\relax
      \fi
      \ifx\atfi@temp\relax
        \atfi@pdftexdata{#1}%
      \else
        \edef\x{%
          \noexpand\setkeys{AtFi@file}{\@nameuse{atfi@file@#1}}%
        }%
        \x
      \fi
      \ifx\atfi@params\ltx@empty
      \else
        \edef\atfi@params{/Params<<\atfi@params>>}%
      \fi
      \edef\atfi@FILE{#1}%
      \filename@parse\atfi@FILE
      \ifx\filename@area\ltx@empty
        \edef\atfi@FILE{./\atfi@FILE}%
      \fi
      \EdefEscapeString\atfi@FILE{\atfi@FILE}%
      \atfi@special{fstream %
        \theatfi@obj
        (\atfi@FILE)%
        <<%
          /Type/EmbeddedFile%
          \atfi@mimetype
          \atfi@params
        >>%
      }%
      \atfi@special{close \theatfi@obj}%
      \expandafter
      \xdef\csname atfi@fileobj@#1\endcsname{\theatfi@obj}%
    \endgroup
  }{%
    % file already embedded
  }%
}
\def\atfi@xform{%
  \stepcounter{atfi@obj}%
  \smash{%
    \rlap{%
      \atfi@special{bxobj \theatfi@obj\space
        width \the\wd\atfi@appearancebox\space
        height \the\ht\atfi@appearancebox\space
        depth \the\dp\atfi@appearancebox
      }%
      \usebox\atfi@appearancebox
      \atfi@special{exobj}%
    }%
  }%
  \edef\atfi@appearanceobj{\theatfi@obj}%
}
\let\atfi@xform@icon\atfi@xform
\def\atfi@refxform#1{%
  \leavevmode
  \atfi@special{uxobj #1}%
}
\def\atfi@insert@file@annot#1{%
  \rule{0pt}{0pt}%
  \ifatfi@appearance
    \def\atfi@appearance@dict{%
      /AP<<%
        /N \atfi@appearanceobj
        /R \atfi@appearanceobj
        /D \atfi@appearanceobj
      >>%
    }%
  \else
    \let\atfi@appearance@dict\ltx@empty
  \fi
  \ltx@IfUndefined{atfi@fsobj@#1}{%
    \begingroup
      \ifxetex
        \let\atfi@temp\Hy@Warning
        \let\Hy@Warning\ltx@gobble
      \fi
      \hypersetup{unicode=false}%
      \ifxetex
        \let\Hy@Warning\atfi@temp
      \fi
      \atfi@pdfstringdef\atfi@file{#1}%
      \stepcounter{atfi@obj}%
      \atfi@special{obj \theatfi@obj <<%
          /Type/Filespec%
          /F(\atfi@file)%
          \ifx\atfi@ucfilespec\ltx@empty
          \else
            /UF(\atfi@ucfilespec)%
          \fi
          /EF<<%
            /F \@nameuse{atfi@fileobj@#1}%
          >>%
        >>%
      }%
      \expandafter\xdef\csname atfi@fsobj@#1\endcsname{%
        \theatfi@obj
      }%
    \endgroup
  }{%
  }%
  \begingroup
    \dimen@=\atfi@scale\atfi@appearancewidth
    \edef\atfi@rule{width \the\dimen@}%
    \dimen@=\atfi@scale\atfi@appearanceheight
    \edef\atfi@rule{\atfi@rule\space height \the\dimen@}%
    \dimen@=\atfi@scale\atfi@appearancedepth
    \edef\atfi@rule{\atfi@rule\space depth \the\dimen@}%
    \atfi@special{ann \atfi@rule
      <<%
        /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}%
      >>%
    }%
  \endgroup
  \rule{0pt}{\atfi@appearanceheight}%
  \rule[-\atfi@appearancedepth]{0pt}{\atfi@appearancedepth}%
  \rule{\atfi@appearancewidth}{0pt}%
}
\endinput
%%
%% End of file `atfi-dvipdfmx.def'.