Don't allow comctl32 controls to access their infoPtr before it has
[wine.git] / documentation / printing.sgml
blob971ed5006fe4677c62e4689bc7b104a50711f91e
1 <chapter id="printing">
2 <title>Printing in Wine</title>
3 <para>How to print documents in Wine...</para>
5 <sect1 id="wine-printing">
6 <title>Printing</title>
8 <para>
9 Written by &name-huw-davies; <email>&email-huw-davies;</email>
10 </para>
11 <para>
12 (Extracted from <filename>wine/documentation/printing</filename>)
13 </para>
15 <para>
16 Printing in Wine can be done in one of two ways. Both of which are pretty alpha.
17 </para>
18 <orderedlist>
19 <listitem>
20 <para>Use an external windows 3.1 printer driver.</para>
21 </listitem>
22 <listitem>
23 <para>
24 Use the builtin Wine Postscript driver (+ ghostscript to produce
25 output for non-postscript printers).
26 </para>
27 </listitem>
28 </orderedlist>
30 <para>
31 Note that at the moment WinPrinters (cheap, dumb printers that require
32 the host computer to explicitly control the head) will not work with
33 their Windows printer drivers. It is unclear whether they ever will.
34 </para>
36 <sect2>
37 <title>External printer drivers</title>
38 <para>
39 At present only 16 bit drivers will work (note that these include win9x
40 drivers). To use them, add
41 </para>
42 <screen>
43 printer=on
44 </screen>
45 <para>
46 to the [wine] section of <filename>wine.conf</filename> (or
47 <filename>~/.wine/config</filename>). This lets
48 <function>CreateDC</function> proceed if its driver argument is a 16
49 bit driver. You will probably also need to add
50 </para>
51 <screen>
52 "TTEnable" = "0" "TTOnly" = "0"
53 </screen>
54 <para>
55 to the [TrueType] section of <filename>~/.wine/config</filename>. The code for
56 the driver interface is in <filename>graphics/win16drv</filename>.
57 </para>
58 </sect2>
60 <sect2>
61 <title>Builtin Wine PostScript driver</title>
62 <para>
63 Enables printing of PostScript files via a driver built into Wine. See
64 <filename>documentation/psdriver</filename> for installation
65 instructions. The code for the PostScript driver is in
66 <filename>graphics/psdrv</filename>.
67 </para>
68 </sect2>
70 <sect2>
71 <title>Spooling</title>
72 <para>
73 Spooling is rather primitive. The [spooler] section of
74 <filename>wine.conf</filename> maps a port (e.g.
75 <systemitem>LPT1:</systemitem>) to a file or a command via a pipe. For
76 example the following lines
77 </para>
78 <screen>
79 "LPT1:" = "foo.ps" "LPT2:" = "|lpr"
80 </screen>
81 <para>
82 map <systemitem>LPT1:</systemitem> to file <filename>foo.ps</filename>
83 and <systemitem>LPT2:</systemitem> to the <command>lpr</command>
84 command. If a job is sent to an unlisted port then a file is created
85 with that port's name e.g. for <systemitem>LPT3:</systemitem> a file
86 called <systemitem>LPT3:</systemitem> would be created.
87 </para>
88 </sect2>
89 </sect1>
91 <sect1 id="psdriver">
92 <title>The Wine PostScript Driver</title>
94 <para>
95 Written by &name-huw-davies; <email>&email-huw-davies;</email>
96 </para>
97 <para>
98 (Extracted from <filename>wine/documentation/psdriver</filename>)
99 </para>
101 <para>
102 When complete this will allow Wine to generate PostScript files without
103 needing an external printer driver. It should be possible to print to a
104 non PostScript printer by filtering the output through ghostscript.
105 </para>
107 <sect2>
108 <title>Installation</title>
109 <para>
110 The driver behaves as if it were a DRV file called
111 <filename>wineps.drv</filename> which at the moment is built into Wine.
112 Although it mimics a 16 bit driver it will work with both 16 and 32 bit
113 apps, just as win9x drivers do.
114 </para>
115 <para>
116 To install it add
117 </para>
118 <screen>
119 "Wine PostScript Driver" = "WINEPS,LPT1:"
120 </screen>
121 <para>
122 to the [devices] section and
123 </para>
124 <screen>
125 "Wine PostScript Driver" = "WINEPS,LPT1:,15,45"
126 </screen>
127 <para>
128 to the [PrinterPorts] section of <filename>win.ini</filename> and to set it
129 as the default printer also add
130 </para>
131 <screen>
132 "device" = "Wine PostScript Driver,WINEPS,LPT1:"
133 </screen>
134 <para>
135 to the [windows] section of <filename>~/.wine/config</filename> and ???
136 <emphasis>[sic]</emphasis>
137 </para>
138 <para>
139 To run 32 bit apps (and 16 bit apps using the
140 <literal>builtin</literal> commdlg) you also need to add certain
141 entries to the registry. The easiest way to do that at the moment is
142 to use the winelib program <command>programs/regapi/regapi</command>
143 with the file <filename>documentation/psdrv.reg</filename>. To do this
144 <command>cd</command> to <filename>programs/regapi/regapi</filename>
145 and type <userinput>make</userinput> to actually make the program, then
146 type <userinput>./regapi setValue
147 &lt;../../documentation/psdrv.reg</userinput>. You can obviously
148 edit <filename>psdrv.reg</filename> to suit your requirements.
149 </para>
150 <para>
151 You will need Adobe Font Metric (AFM) files for the (type 1 PostScript)
152 fonts that you wish to use. You can get these from
153 <ulink url="ftp://ftp.adobe.com/pub/adobe/type/win/all/afmfiles">
154 ftp://ftp.adobe.com/pub/adobe/type/win/all/afmfiles </ulink>. The
155 directories <filename>base17</filename> or <filename>base35</filename>
156 are good places to start. Note that these are only the font metrics and
157 not the fonts themselves. At the moment the driver does not download
158 additional fonts, so you can only use fonts that are already present on
159 the printer.
160 </para>
161 <para>
162 Then create a [afmfiles] section in your
163 <filename>wine.conf</filename> (or
164 <filename>~/.wine/config</filename>) and add a line of the form
165 </para>
166 <screen>
167 "file&lt;n&gt;" = "/unix/path/name/filename.afm"
168 </screen>
169 <para>
170 for each AFM file that you wish to use. [This might change in the future]
171 </para>
172 <para>
173 You also require a PPD file for your printer. This describes certain
174 characteristics of the printer such as which fonts are installed, how
175 to select manual feed etc. Adobe also has many of these on its website,
176 have a look in <ulink url="ftp://ftp.adobe.com/pub/adobe/printerdrivers/win/all/">
177 ftp://ftp.adobe.com/pub/adobe/printerdrivers/win/all/</ulink>. Create
178 a [psdrv] section in your <filename>wine.conf</filename> (or
179 <filename>~/.wine/config</filename>) and add the following entry:
180 </para>
181 <screen>
182 "ppdfile" = "/somewhere/file.ppd"
183 </screen>
184 <para>
185 By default, the driver will look for a file named
186 <filename>default.ppd</filename> in the directory from which
187 you started wine.
188 </para>
189 <para>
190 To enable colour printing you need to have the
191 <literal>*ColorDevice</literal> entry in the PPD set to
192 <literal>true</literal>, otherwise the driver will generate
193 greyscale.
194 </para>
195 <para>
196 Note that you need not set <literal>printer=on</literal> in
197 the [wine] section of <filename>wine.conf</filename>, this
198 enables printing via external printer drivers and does not
199 affect wineps.
200 </para>
201 <para>
202 If you're lucky you should now be able to produce PS files
203 from Wine!
204 </para>
205 <para>
206 I've tested it with win3.1 notepad/write, Winword6 and
207 Origin4.0 and 32 bit apps such as win98 wordpad, Winword97,
208 Powerpoint2000 with some degree of success - you should be
209 able to get something out, it may not be in the right place.
210 </para>
211 </sect2>
213 <sect2>
214 <title>TODO / Bugs</title>
216 <itemizedlist>
217 <listitem>
218 <para>
219 Driver does read PPD files, but ignores all constraints
220 and doesn't let you specify whether you have optional
221 extras such as envelope feeders. You will therefore find
222 a larger than normal selection of input bins in the
223 print setup dialog box. I've only really tested ppd
224 parsing on the <filename>hp4m6_v1.ppd</filename> file.
225 </para>
226 </listitem>
227 <listitem>
228 <para>No TrueType download.</para>
229 </listitem>
230 <listitem>
231 <para>StretchDIBits uses level 2 PostScript.</para>
232 </listitem>
233 <listitem>
234 <para>AdvancedSetup dialog box.</para>
235 </listitem>
236 <listitem>
237 <para>Many partially implemented functions.</para>
238 </listitem>
239 <listitem>
240 <para>ps.c is becoming messy.</para>
241 </listitem>
242 <listitem>
243 <para>
244 Notepad often starts text too far to the left depending
245 on the margin settings. However the win3.1
246 <filename>pscript.drv</filename> (under wine) also does
247 this.
248 </para>
249 </listitem>
250 <listitem>
251 <para>Probably many more...</para>
252 </listitem>
253 </itemizedlist>
255 <para>
256 Please contact me if you want to help so that we can avoid duplication.
257 </para>
258 <para>
259 &name-huw-davies; <email>&email-huw-davies;</email>
260 </para>
261 </sect2>
262 </sect1>
263 </chapter>
265 <!-- Keep this comment at the end of the file
266 Local variables:
267 mode: sgml
268 sgml-parent-document:("wine-doc.sgml" "set" "book" "chapter" "")
269 End: