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