HeapReAlloc doesn't allocate memory.
[wine.git] / documentation / printing.sgml
blob6938cb2fc233c0921a7a832f20e4c7c4ed3d625a
1 <sect1 id="config-printing">
2 <title>Printing in Wine</title>
3 <para>How to print documents in Wine...</para>
5 <sect2 id="config-printing-intro">
6 <title>Printing</title>
8 <para>
9 Printing in Wine can be done in one of two ways:
10 </para>
11 <orderedlist>
12 <listitem>
13 <para>
14 Use the built-in Wine PostScript driver (+ ghostscript to produce
15 output for non-PostScript printers).
16 </para>
17 </listitem>
18 <listitem>
19 <para>
20 Use an external windows 3.1 printer driver (outdated, probably won't get supported any more).
21 </para>
22 </listitem>
23 </orderedlist>
25 <para>
26 Note that at the moment WinPrinters (cheap, dumb printers that require
27 the host computer to explicitly control the head) will not work with
28 their Windows printer drivers. It is unclear whether they ever will.
29 </para>
31 <sect3>
32 <title>Built-in Wine PostScript driver</title>
33 <para>
34 Enables printing of PostScript files via a driver built into Wine. See
35 below for installation instructions. The code for the PostScript
36 driver is in <filename>dlls/wineps/</filename>.
37 </para>
38 <para>
39 The driver behaves as if it were a DRV file called
40 <filename>wineps.drv</filename> which at the moment is built into
41 Wine.
42 Although it mimics a 16 bit driver, it will work with both 16 and 32
43 bit apps, just as win9x drivers do.
44 </para>
45 </sect3>
47 <sect3>
48 <title>Spooling</title>
49 <para>
50 Spooling is rather primitive. The [spooler] section of
51 the wine config file maps a port (e.g.
52 <systemitem>LPT1:</systemitem>) to a file or a command via a pipe. For
53 example the following lines
54 </para>
55 <screen>
56 "LPT1:" = "foo.ps"
57 "LPT2:" = "|lpr"
58 </screen>
59 <para>
60 map <systemitem>LPT1:</systemitem> to file <filename>foo.ps</filename>
61 and <systemitem>LPT2:</systemitem> to the <command>lpr</command>
62 command. If a job is sent to an unlisted port, then a file is created
63 with that port's name; e.g. for <systemitem>LPT3:</systemitem> a file
64 called <systemitem>LPT3:</systemitem> would be created.
65 </para>
66 <para>
67 There are now also virtual spool queues called
68 <systemitem>LPR:printername</systemitem>, which send the data
69 to <command>lpr -Pprintername</command>. You do not need to
70 specify those in the config file, they are handled automatically by
71 <filename>dlls/gdi/printdrv.c</filename>.
72 </para>
73 </sect3>
74 </sect2>
76 <sect2 id="config-printing-psdriver">
77 <title>The Wine PostScript Driver</title>
79 <para>
80 This allows Wine to generate PostScript files without
81 needing an external printer driver. Wine in this case uses the
82 system provided PostScript printer filters, which almost all use
83 ghostscript if necessary. Those should be configured during the
84 original system installation or by your system administrator.
85 </para>
87 <sect3>
88 <title>Installation</title>
89 <sect4>
90 <title>Installation of CUPS printers</title>
91 <para>
92 If you are using CUPS, you do not need to configure .ini or
93 registry entries, everything is autodetected.
94 </para>
95 </sect4>
96 <sect4>
97 <title>Installation of LPR /etc/printcap based printers</title>
98 <para>
99 If your system is not yet using CUPS, it probably uses LPRng
100 or a LPR based system with configuration based on <filename>/etc/printcap</filename>.
101 </para>
102 <para>
103 If it does, your printers in <filename>/etc/printcap</filename>
104 are scanned with a heuristic whether they are PostScript capable
105 printers and also configured mostly automatic.
106 </para>
107 <para>
108 Since Wine cannot find out what type of printer this is, you
109 need to specify a PPD file in the [ppd] section of
110 <filename>~/.wine/config</filename>. Either use the shortcut
111 name and make the entry look like:
112 </para>
113 <screen>
114 [ppd]
115 "ps1" = "/usr/lib/wine/ps1.ppd"
116 </screen>
117 <para>
118 Or you can specify a generic PPD file that is to match for all
119 of the remaining printers. A generic PPD file can be found in
120 <filename>documentation/samples/generic.ppd</filename>.
121 </para>
122 </sect4>
123 <sect4>
124 <title>Installation of other printers</title>
125 <para>
126 You do not need to do this if the above 2 sections apply, only if
127 you have a special printer.
128 </para>
129 <screen>
130 Wine PostScript Driver=WINEPS,LPT1:
131 </screen>
132 <para>
133 to the [devices] section and
134 </para>
135 <screen>
136 Wine PostScript Driver=WINEPS,LPT1:,15,45
137 </screen>
138 <para>
139 to the [PrinterPorts] section of <filename>win.ini</filename>,
140 and to set it as the default printer also add
141 </para>
142 <screen>
143 device = Wine PostScript Driver,WINEPS,LPT1:
144 </screen>
145 <para>
146 to the [windows] section of <filename>win.ini</filename>.
147 </para>
148 <para>
149 You also need to add certain entries to the registry.
150 The easiest way to do this is to customize the PostScript
151 driver contents of <filename>winedefault.reg</filename> (see below) and use the
152 Winelib program <command>programs/regedit/regedit</command>. For
153 example, if you have installed the Wine source tree in
154 <filename>/usr/src/wine</filename>, you could use the following
155 series of commands:
156 <itemizedlist>
157 <listitem>
158 <para>
159 <userinput>cp /usr/src/wine/winedefault.reg ~</userinput>
160 </para>
161 </listitem>
162 <listitem>
163 <para>
164 <userinput>vi ~/winedefault.reg</userinput>
165 </para>
166 </listitem>
167 <listitem>
168 <para>
169 Edit the copy of <filename>winedefault.reg</filename> to suit your
170 PostScript printing requirements.
171 At a minimum, you must specify a PPD file for each printer.
172 </para>
173 </listitem>
174 <listitem>
175 <para>
176 <userinput>regedit ~/winedefault.reg</userinput>
177 </para>
178 </listitem>
179 </itemizedlist>
180 </para>
181 </sect4>
182 <sect4>
183 <title>Required configuration for all printer types</title>
184 <para>
185 You won't need Adobe Font Metric (AFM) files for the (type 1 PostScript)
186 fonts that you wish to use any more.
187 Wine now has this information built-in.
188 </para>
189 <para>
190 You'll need a PPD file for your printer. This describes
191 certain characteristics of the printer such as which fonts are
192 installed, how to select manual feed etc. Adobe has many of
193 these on its website, have a look in
194 <ulink url="ftp://ftp.adobe.com/pub/adobe/printerdrivers/win/all/">
195 ftp://ftp.adobe.com/pub/adobe/printerdrivers/win/all/</ulink>.
196 See above for information on configuring the driver to use this
197 file.
198 </para>
199 <para>
200 To enable colour printing you need to have the
201 <literal>*ColorDevice</literal> entry in the PPD set to
202 <literal>true</literal>, otherwise the driver will generate
203 greyscale.
204 </para>
205 <para>
206 Note that you need not set <literal>printer=on</literal> in
207 the [wine] section of the wine config file, this
208 enables printing via external printer drivers and does not
209 affect the built-in PostScript driver.
210 </para>
211 <para>
212 If you're lucky you should now be able to produce PS files
213 from Wine!
214 </para>
215 <para>
216 I've tested it with win3.1 notepad/write, Winword6 and
217 Origin4.0 and 32 bit apps such as win98 wordpad, Winword97,
218 Powerpoint2000 with some degree of success - you should be
219 able to get something out, it may not be in the right place.
220 </para>
221 </sect4>
222 </sect3>
224 <sect3>
225 <title>TODO / Bugs</title>
227 <itemizedlist>
228 <listitem>
229 <para>
230 Driver does read PPD files, but ignores all constraints
231 and doesn't let you specify whether you have optional
232 extras such as envelope feeders. You will therefore find
233 a larger than normal selection of input bins in the
234 print setup dialog box. I've only really tested ppd
235 parsing on the <filename>hp4m6_v1.ppd</filename> file.
236 </para>
237 </listitem>
238 <listitem>
239 <para>
240 No TrueType download.
241 </para>
242 </listitem>
243 <listitem>
244 <para>
245 StretchDIBits uses level 2 PostScript.
246 </para>
247 </listitem>
248 <listitem>
249 <para>
250 AdvancedSetup dialog box.
251 </para>
252 </listitem>
253 <listitem>
254 <para>
255 Many partially implemented functions.
256 </para>
257 </listitem>
258 <listitem>
259 <para>
260 ps.c is becoming messy.
261 </para>
262 </listitem>
263 <listitem>
264 <para>
265 Notepad often starts text too far to the left depending
266 on the margin settings. However the win3.1
267 <filename>pscript.drv</filename> (under wine) also does
268 this.
269 </para>
270 </listitem>
271 <listitem>
272 <para>
273 Probably many more...
274 </para>
275 </listitem>
276 </itemizedlist>
278 </sect3>
279 </sect2>
280 </sect1>
282 <!-- Keep this comment at the end of the file
283 Local variables:
284 mode: sgml
285 sgml-parent-document:("wine-user.sgml" "set" "book" "chapter" "")
286 End: