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