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