summaryrefslogtreecommitdiff
path: root/dviware/dvipsconfig/README
blob: 9c8f76d18b6eb1e8b9f66350bedd95cb01baa10f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
Release 1.6   11 May 2006	Added mmgrid and a4grid, millimetre grids.
Release 1.5   02 Aug 2000	Added addpsctrl, a filter program which can add
				these control instructions to already existing
				PostScript files.
				Added US ledger paper.
Release 1.4   22 Mar 2000	Added tray selection.
				Thanks to Steffen Klupsch for suggesting it.
Release 1.3.2 09 Mar 2000	License change only. Modified README.
Release 1.3,  19 Feb 1999
Release 1.2,  25 Jan 1998
Release 1.13, 21 Aug 1995
Release 1.12, 02 Mar 1995
Release 1.0,  20 Feb 1995


OVERVIEW
========

This is a set of PostScript header files which can be used to control the
printer, like simplex/duplex printing, or the printing, like screen frequencies
of images, or the addition of a grid underlay. These header files work with
dvips, and can also be inserted with the addpsctrl script into existing
PostScript files.

Put together by Volker Kuhlmann <VolkerKuhlmann@gmx.de>.
This collection of files is available under the name of "dvipsconfig" from

	ftp://dante.ctan.org/tex-archive/dviware/dvipsconfig/

or from any other CTAN host under the same path.
Alternatively, from:

	http://volker.dnsalias.net/soft/texmf/

This software is copyright (C) Volker Kuhlmann, and is freely distributable
under the terms of the GNU General Public License version 2.
Parts of the code in config.psgrid are derived from previous material and are
distributed with permission. See the file for details.


LIST OF FILES
=============

README		This file.
addpsctrl	Shell script which inserts these printer control files into
		into already existing PostScript files (can also be used by
		print filters)
config.*        Configuration files *and* header files for dvips.
		Special format where each file serves both purposes.


INSTALLATION
============

Copy addpsctrl into a directory which is searched for executable programs.

Copy README and all config.* into a directory which is searched by dvips both
for configuration files AND for header files. Each of these files have a dual
function (easier maintenance) and hence must be found under each category
(dvips config and dvips header).

For current installations of web2c respectively teTeX 1.x, consult the file
texmf.cnf for search paths. Currently configured search paths can be displayed
with 
	kpsewhich --show-path "dvips config"
	kpsewhich --show-path "PostScript header"

To check up whether the place was any good, run (both!)
	kpsewhich --format "dvips config" config.duplong
	kpsewhich --format "PostScript header" config.duplong
and don't forget to run mktexlsr...
In case of problems, also check for any .dvipsrc files.

dvips(k) 5.78 kpathsea version 3.2, web2c 7.2, looks in $TEXCONFIG and
$TEXPSHEADERS.

dvips (dvipsk 5.58f, web2c 6.2) looks in $TEXCONFIG for configuration files,
and in $DVIPSHEADERS for header files. For details please see the dvips
documentation (environment variable use seems to change with dvips versions).


USAGE
=====

dvips reads the instructions in a configuration file <configfilename>
with the -P option:

	dvips -P <configfilename> ...

All these configuration files contain the PostScript code for the
respective operation as well, and can be used as header file as they are.

Now to the material provided:

Duplex printing:
---------------

-P simplex      On a duplex printer, force printing in simplex mode.
		On a simplex printer, this will be ignored.

-P duplong      On a duplex printer, force duplex printing with binding
		on the long edge.
		This is what you want for e.g. an A4 upright book.
		On a simplex printer, this will be ignored.

-P dupshort	On a duplex printer, force duplex printing with binding
		on the short edge.
		Useful for e.g. printouts in landscape.
		On a simplex printer, this will be ignored.

Paper size selection:
--------------------

-P a3		Switch the printer to use A3 paper.
		Note: "-t a3" must still be used as well!
		Only works with PS level 2 devices, ignored otherwise.

-P a4		Switch the printer to use A4 paper.
		Note: "-t a4" must still be used as well, unless it is
		the default.
		Only works with PS level 2 devices, ignored otherwise.

-P usletter	Switch the printer to use US letter paper.
		Note: "-t letter" must still be used as well, unless it
		is the default.
		Only works with PS level 2 devices, ignored otherwise.

-P usledger	Switch the printer to use US usledger paper.
		Note: "-t ledger" must still be used as well, unless it
		is the default.
		Only works with PS level 2 devices, ignored otherwise.

Screen frequencies and dot functions:
------------------------------------

-P screenN	Print images with a screen frequency of N lpi at
		45 degrees with the "dot" spot function. 
		N = {35, 50, 70, 80, 85, 90, 100, 110, 120, 130, 140, 150}

-P screen100_0	Print images with a screen frequency of 100lpi
		at 0 degrees with the "dot" spot function.
		A 0 degree screen angle is only useful as illustration!

Note:   When working with screen frequencies, it is possible that
	turning the printer off and back on solves the problem of the
	screen commands not having any effect. Previous print jobs may
	leave the printer in a different state.

Colour printer media selection:
------------------------------

-P tek550paper	Switch Tektronix 550 and 560 colour printers to print on paper.

-P tek550transparency	Switch Tektronix 550 and 560 colour printers to print
			on transparency.

Paper tray selection:
--------------------

-P manualfeed	Print on paper from the manual feeder.
		The printer waits for the paper to be loaded after receiving
		the job.
		This should work with almost any printer.

-P envelope	Print on paper from the envelope feeder.
		This should at least work with most HP laser printers.

-P tray1	Print on paper from "tray 1".
		This often is the manual feeder / upper tray / multipurpose
		tray (at least for HP laser printers).

-P tray2	Print on paper from "tray 2".
		This often is the lower tray (at least for HP laser printers).

-P tray3	Print on paper from "tray 1".
		This often is the large capacity / lower cassette (at least for
		HP laser printers).

Note: Tray selection is very printer-dependent. tray1..3 will not work for all
printers. Possible effects of them if the tray doesn't exist, or if the command
is simply wrong for the printer, include the print job being cancelled, or at
best the command being ignored. Email me with any problems and I might be able
to fix it - I don't have that many printers for testing :-)

Reported behaviour:
  HP Laserjet 5M, -P envelope: print job cancelled if tray doesn't exist.
  HP Laserjet 4000N, -P envelope and -P tray3 don't exist: job is printed on 
	paper from the standard tray instead.

Thanks to Steffen Klupsch <steffen@vlsi.informatik.tu-darmstadt.de> for initial
suggestions about the tray selection material, and some beta testing.

Misc:
----

-P psgrid	Print a PostScript coordinate grid onto the page. This can be
		very useful for checking by how much the printer shifts the
		image on the paper, or to check whether things end up in the
		correct place.

-P mmgrid	Print a millimetre grid onto the page. Much more userfriendly.
		Otherwise the same as -P psgrid.

-P a4grid	Print a millimetre grid onto the page, starting in the top-left
		corner. Much more useful for checking page layout.

-P inv          Print all pages inverted, i.e. white letters on black
		background.
		Note: this currently does not work properly. Any
		      hints/fixes greatly appreciated!


CONTROLLING SCREEN FREQUENCIES
==============================

Various PostScript commands for controlling the screen frequencies of
images exist, but not all work on all printers. See fragments of
PostScript code and comments below. The form working on most printers is

	LPI DEGREES {FUNCTION} setscreen

Insert numbers for LPI and DEGREES, and a function for FUNCTION about
which I only know (right or wrong?):

	"Should read 2 values from the stack (x, y coordinates in a
	halftone cell), and return one in the range -1 to 1. The return
	values determine the order in which pixels within a halftone
	cell are whitened to produce any desired shade of gray."

The simplest function is {pop}, creating a "linescreen" pattern. There
is also a function "Dot" (currently used) and "Ellipse". For any other
frequencies/angles/functions put the instructions in a file, and load
the file with

	dvips -h <filename>

Thanks to osakari@unda.fi (Olavi Sakari) for some help, and the "Dot"
and "Ellipse" code.

Notes follow:


%currentscreen 3 1 roll pop pop 70 45 3 -1 roll setscreen
% Works on HP LJ3Si, HP LJ4m. Ignored on HP LJ4mv (VK).


%currentscreen 3 1 roll pop pop 70 45 3 -1 roll sethalftone
% Ignored on HP LJ4mv (VK).


%70 45 {pop} setscreen
% Produces a funny, 1-diagonal pattern ("linescreen") on HP LJ4mv (VK).


% "Dot":
%70 45 {abs exch abs 2 copy add 1 gt {1 sub dup mul exch 1 sub dup mul add 1
%    sub }{dup mul exch dup mul add 1 exch sub }ifelse} setscreen
% Works on HP LJ3Si, HP LJ4m, HP LJ4mv (VK).


% "Ellipse":
%70 45 {dup 5 mul 8 div mul exch dup mul exch add sqrt 1 exch sub} setscreen
% Works on HP LJ4mv (VK).


%70 45
%<<
%     /HalftoneType 1
		%  0 gives range check error, 2 gives undefined error (VK).
%     /Frequency 150
%     /Angle 20
		% the values for /Frequency, /Angle are irrelevant
%     /SpotFunction {pop}
%>>
%setscreen	
% 70 45 seem to replace /Frequency and /Angle in dict
% - Note: NO curly braces around the dict!
% Works on HP LJ4m, produces errors with HP LJ3Si, 
% Produces "linescreen" on HP LJ4mv caused by {pop} (VK).


%<<
%     /HalftoneType 1
%		%  0 gives range check error, 2 gives undefined error (VK).
%     /Frequency 70
%     /Angle 45
%     /SpotFunction {pop}
%>>
%sethalftone  % Level 2 only
% Produces "linescreen" on HP LJ4mv caused by {pop} (VK).


ADDPSCTRL
=========

The addpsctrl program works as a filter. The given controls are inserted into
the PostScript data. The config.* files are located by running kpsewhich, or
by specifying the directory they're in. This allows to use addpsctrl without
having to have a TeXMF installation. For further info run addpsctrl --help.


TODO
====

Control the screen frequency without altering the dot function.

Supply separate controls for setting the dot function.