1 <chapter id=
"printing">
2 <title>Printing in Wine
</title>
3 <para>How to print documents in Wine...
</para>
5 <sect1 id=
"wine-printing">
6 <title>Printing
</title>
12 (Extracted from
<filename>wine/documentation/printing
</filename>)
16 Printing in Wine can be done in one of two ways. Both of which are very
21 <para>Use an external windows
3.1 printer driver.
</para>
25 Use the builtin Wine Postscript driver (+ ghostscript to produce
26 output for non-postscript printers).
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.
38 <title>External printer drivers
</title>
40 At present only
16 bit drivers will work (note that these include win9x
41 drivers). To use them, add
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
56 to the [TrueType] section of
<filename>win.ini
</filename>. The code for
57 the driver interface is in
<filename>graphics/win16drv
</filename>.
62 <title>Builtin Wine PostScript driver
</title>
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>.
72 <title>Spooling
</title>
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
80 LPT1:=foo.ps LPT2:=|lpr
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.
93 <title>The Wine PostScript Driver
</title>
96 written by Huw Davies
<email>h.davies1@physics.ox.ac.uk
</email>
99 (Extracted from
<filename>wine/documentation/psdriver
</filename>)
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.
109 <title>Installation
</title>
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.
120 Wine PostScript Driver=WINEPS,LPT1:
123 to the [devices] section of
<filename>win.ini
</filename> and to set it
124 as the default printer also add
127 device=Wine PostScript Driver,WINEPS,LPT1:
130 to the [windows] section of
<filename>win.ini
</filename> and ???
131 <emphasis>[sic]
</emphasis>
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 <../../documentation/psdrv.reg
</userinput>. You can obviously
143 edit
<filename>psdrv.reg
</filename> to suit your requirements.
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
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
162 file
<n
>=/unix/path/name/filename.afm
165 for each AFM file that you wish to use. [This might change in the future]
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:
177 ppdfile=/somewhere/file.ppd
180 By default, the driver will look for a file named
181 <filename>default.ppd
</filename> in the directory from which
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
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
197 If you're lucky you should now be able to produce PS files
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.
209 <title>TODO / Bugs
</title>
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.
223 <para>No TrueType download.
</para>
226 <para>StretchDIBits uses level
2 PostScript.
</para>
229 <para>AdvancedSetup dialog box.
</para>
232 <para>Many partially implemented functions.
</para>
235 <para>ps.c is becoming messy.
</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
246 <para>Probably many more...
</para>
251 Please contact me if you want to help so that we can avoid duplication.
254 Huw Davies
<email>h.davies1@physics.ox.ac.uk
</email>
260 <!-- Keep this comment at the end of the file
263 sgml-parent-document:("wine-doc.sgml" "book" "chapter" "")