- reorganisation of full chapter
[wine] / documentation / printing.sgml
1   <sect1 id="config-printing">
2     <title>Printing in Wine</title>
3     <para>How to print documents in Wine...</para>
4
5     <sect2 id="config-printing-intro">
6       <title>Printing</title>
7
8       <para>
9         Printing in Wine can be done using the built-in Wine PostScript driver (+ ghostscript to produce
10         output for non-PostScript printers).
11       </para>
12       <para>
13         Note that at the moment WinPrinters (cheap, dumb printers that require
14         the host computer to explicitly control the head) will not work with
15         their Windows printer drivers.  It is unclear whether they ever will.
16       </para>
17
18       <sect3>
19         <title>Built-in Wine PostScript driver</title>
20         <para>
21           Enables printing of PostScript files via a driver built into Wine. See
22           below for installation instructions. The code for the PostScript
23           driver is in <filename>dlls/wineps/</filename>.
24         </para>
25         <para>
26           The driver behaves as if it were a DRV file called
27           <filename>wineps.drv</filename> which at the moment is built into
28           Wine.
29           Although it mimics a 16 bit driver, it will work with both 16 and 32
30           bit apps, just as win9x drivers do.
31         </para>
32       </sect3>
33
34       <sect3>
35         <title>Spooling</title>
36         <para>
37           Spooling is rather primitive. The [spooler] section of
38           the wine config file maps a port (e.g.
39           <systemitem>LPT1:</systemitem>) to a file or a command via a pipe. For
40           example the following lines
41         </para>
42         <screen>
43 "LPT1:" = "foo.ps"
44 "LPT2:" = "|lpr"
45         </screen>
46         <para>
47           map <systemitem>LPT1:</systemitem> to file <filename>foo.ps</filename>
48           and <systemitem>LPT2:</systemitem> to the <command>lpr</command>
49           command. If a job is sent to an unlisted port, then a file is created
50           with that port's name; e.g. for <systemitem>LPT3:</systemitem> a file
51           called <systemitem>LPT3:</systemitem> would be created.
52         </para>
53         <para>
54           There are now also virtual spool queues called
55           <systemitem>LPR:printername</systemitem>, which send the data
56           to <command>lpr -Pprintername</command>. You do not need to
57           specify those in the config file, they are handled automatically by
58           <filename>dlls/gdi/printdrv.c</filename>.
59         </para>
60       </sect3>
61     </sect2>
62
63     <sect2 id="config-printing-psdriver">
64       <title>The Wine PostScript Driver</title>
65
66       <para>
67         This allows Wine to generate PostScript files without
68         needing an external printer driver. Wine in this case uses the
69         system provided PostScript printer filters, which almost all use
70         ghostscript if necessary. Those should be configured during the
71         original system installation or by your system administrator.
72       </para>
73
74       <sect3>
75         <title>Installation</title>
76         <sect4>
77           <title>Installation of CUPS printers</title>
78           <para>
79             If you are using CUPS, you do not need to configure .ini or
80             registry entries, everything is autodetected.
81           </para>
82         </sect4>
83         <sect4>
84           <title>Installation of LPR /etc/printcap based printers</title>
85           <para>
86             If your system is not yet using CUPS, it probably uses LPRng
87             or a LPR based system with configuration based on <filename>/etc/printcap</filename>.
88           </para>
89           <para>
90             If it does, your printers in <filename>/etc/printcap</filename>
91             are scanned with a heuristic whether they are PostScript capable
92             printers and also configured mostly automatic.
93           </para>
94           <para>
95             Since Wine cannot find out what type of printer this is, you
96             need to specify a PPD file in the [ppd] section of
97             <filename>~/.wine/config</filename>. Either use the shortcut
98             name and make the entry look like:
99           </para>
100           <screen>
101             [ppd]
102             "ps1" = "/usr/lib/wine/ps1.ppd"
103           </screen>
104           <para>
105             Or you can specify a generic PPD file that is to match for all
106             of the remaining printers. A generic PPD file can be found in
107             <filename>documentation/samples/generic.ppd</filename>.
108           </para>
109         </sect4>
110         <sect4>
111           <title>Installation of other printers</title>
112           <para>
113             You do not need to do this if the above 2 sections apply, only if
114             you have a special printer.
115           </para>
116           <screen>
117   Wine PostScript Driver=WINEPS,LPT1:
118           </screen>
119           <para>
120             to the [devices] section and
121           </para>
122           <screen>
123   Wine PostScript Driver=WINEPS,LPT1:,15,45
124           </screen>
125           <para>
126             to the [PrinterPorts] section of <filename>win.ini</filename>,
127             and to set it as the default printer also add
128           </para>
129           <screen>
130   device = Wine PostScript Driver,WINEPS,LPT1:
131           </screen>
132           <para>
133             to the [windows] section of <filename>win.ini</filename>.
134           </para>
135           <para>
136             You also need to add certain entries to the registry.
137             The easiest way to do this is to customize the PostScript
138             driver contents of <filename>wine.inf</filename> (see below) and use the
139             Winelib program <command>programs/regedit/regedit</command>.  For
140             example, if you have installed the Wine source tree in
141             <filename>/usr/src/wine</filename>, you could use the following
142             series of commands:
143             <itemizedlist>
144               <listitem>
145                 <para>
146                   <userinput>#vi /usr/share/wine/wine.inf</userinput>
147                 </para>
148               </listitem>
149               <listitem>
150                 <para>
151                   Edit the copy of <filename>wine.inf</filename> to suit your
152                   PostScript printing requirements.
153                   At a minimum, you must specify a PPD file for each printer.
154                 </para>
155               </listitem>
156               <listitem>
157                 <para>
158                   <userinput>$wineprefixcreate</userinput>
159                 </para>
160               </listitem>
161             </itemizedlist>
162           </para>
163         </sect4>
164         <sect4>
165           <title>Required configuration for all printer types</title>
166           <para>
167             You won't need Adobe Font Metric (AFM) files for the (type 1 PostScript)
168             fonts that you wish to use any more.
169             Wine now has this information built-in.
170           </para>
171           <para>
172             You'll need a PPD file for your printer.  This describes
173             certain characteristics of the printer such as which fonts are
174             installed, how to select manual feed etc. Adobe has many of
175             these on its website, have a look in
176             <ulink url="ftp://ftp.adobe.com/pub/adobe/printerdrivers/win/all/">
177             ftp://ftp.adobe.com/pub/adobe/printerdrivers/win/all/</ulink>.
178             See above for information on configuring the driver to use this
179             file.
180           </para>
181           <para>
182             To enable colour printing you need to have the
183             <literal>*ColorDevice</literal> entry in the PPD set to
184             <literal>true</literal>, otherwise the driver will generate
185             greyscale.
186           </para>
187           <para>
188             Note that you need not set <literal>printer=on</literal> in
189             the [wine] section of the wine config file, this
190             enables printing via external printer drivers and does not
191             affect the built-in PostScript driver.
192           </para>
193           <para>
194             If you're lucky you should now be able to produce PS files
195             from Wine!
196           </para>
197           <para>
198             I've tested it with win3.1 notepad/write, Winword6 and
199             Origin4.0 and 32 bit apps such as win98 wordpad, Winword97,
200             Powerpoint2000 with some degree of success - you should be
201             able to get something out, it may not be in the right place.
202           </para>
203         </sect4>
204       </sect3>
205
206     </sect2>
207   </sect1>
208
209 <!-- Keep this comment at the end of the file
210 Local variables:
211 mode: sgml
212 sgml-parent-document:("wine-user.sgml" "set" "book" "chapter" "")
213 End:
214 -->