Debian Codegraph @

texk/xdvipsk/thirdparty/libtiff/doc/tools/tiff2ps.rst

raw
1 tiff2ps
2 ========
3
4 .. program:: tiff2ps
5
6 Synopsis
7 --------
8
9 **tiff2ps** [ *options* ] *input.tif* …
10
11 Description
12 -----------
13
14 :program:`tiff2ps` reads TIFF images and writes PostScript™ or Encapsulated
15 PostScript™ (EPS) on the standard output. By default :program:`tiff2ps`
16 writes Encapsulated PostScript™ for the first image in the specified
17 TIFF image file.
18
19 By default, :program:`tiff2ps` will generate PostScript™ that fills a
20 printed area specified by the TIFF tags in the input file.
21 If the file does not contain ``XResolution`` or ``YResolution``
22 tags, then the printed area is set according to the image dimensions.
23 The :option:`-w` and :option:`-h` options (see below)
24 can be used to set the dimensions of the printed area in inches;
25 overriding any relevant TIFF tags.
26
27 The PostScript™ generated for RGB, palette, and CMYK images uses the
28 ``colorimage`` operator. The PostScript™ generated for greyscale and
29 bilevel images uses the ``image`` operator. When the ``colorimage``
30 operator is used, PostScript™ code to emulate this operator
31 on older PostScript™ printers is also generated.
32 Note that this emulation code can be very slow.
33
34 Color images with associated alpha data are composited over
35 a white background.
36
37 Options
38 -------
39
40 .. option:: -1
41
42 Generate PostScript™ Level 1 (the default).
43
44 .. option:: -2
45
46 Generate PostScript™ Level 2.
47
48 .. option:: -3
49
50 Generate PostScript™ Level 3. It basically allows one to use the ```/flateDecode``
51 filter for ZIP compressed TIFF images.
52
53 .. option:: -8
54
55 Disable use of ASCII85 encoding with PostScript™ Level 2/3.
56
57 .. option:: -a
58
59 Generate output for all IFDs (pages) in the input file.
60
61 .. option:: -b margin
62
63 Specify the bottom margin for the output (in inches). This does not affect
64 the height of the printed image.
65
66 .. option:: -c
67
68 Center the image in the output. This option only shows an effect if both
69 the :option:`-w` and the :option:`-h` option are given.
70
71 .. option:: -C name
72
73 Specify the document creator name.
74
75 .. option:: -d dir
76
77 Set the initial TIFF
78 directory to the specified directory number.
79 (NB: Directories are numbered starting at zero.)
80 This option is useful for selecting individual pages in a
81 multi-page (e.g. facsimile) file.
82
83 .. option:: -D
84
85 Enable duplex printing (two pages per sheet of paper).
86
87 .. option:: -e
88
89 Force the generation of Encapsulated PostScript™ (implies
90 :option:`-z`).
91
92 .. option:: -h size
93
94 Specify the vertical size of the printed area (in inches).
95
96 .. option:: -H
97
98 Specify the maximum height of image (in inches). Images with larger sizes will
99 be split in several pages. Option :option:`-L`
100 may be used for specifying size of split images overlapping.
101
102 .. option:: -i
103
104 Enable/disable pixel interpolation. This option requires a
105 single numeric value: zero to disable pixel interpolation and
106 non-zero to enable. The default is enabled.
107
108 .. option:: -L
109
110 Specify the size of overlapping for split images (in inches). Used in
111 conjunction with :option:`-H` and :option:`-W` options.
112
113 .. option:: -l
114
115 Specify the left margin for the output (in inches). This does not affect
116 the width of the printed image.
117
118 .. option:: -M size
119
120 Set maximum memory allocation size (in MiB). The default is 256MiB.
121 Set to 0 to disable the limit.
122
123
124 .. option:: -m
125
126 Where possible render using the ``imagemask`` PostScript™ operator instead of the
127 ``image`` operator. When this option is specified :program:`tiff2ps` will use
128 ``imagemask`` for rendering 1 bit deep images. If this option is not specified
129 or if the image depth is greater than 1 then the ``image`` operator is used.
130
131 .. option:: -o ifdoffset
132
133 Set the initial TIFF directory to the IFD at the specified file offset.
134 This option is useful for selecting thumbnail images and the
135 like which are hidden using the ``SubIFD`` tag.
136
137 .. option:: -O
138
139 Write PostScript™ to specified file instead of standard output.
140
141 .. option:: -p
142
143 Force the generation of (non-Encapsulated) PostScript™.
144
145 .. option:: -P L|P
146
147 Set optional PageOrientation DSC comment to Landscape or Portrait.
148
149 .. option:: -r 90|180|270|auto
150
151 Rotate image by 90, 180, 270 degrees or auto. Auto picks the best
152 fit for the image on the specified paper size (eg portrait
153 or landscape) if :option:`-h` or :option:`-w` is specified. Rotation is in degrees
154 counterclockwise. Auto rotates 90 degrees ccw to produce landscape.
155
156 .. option:: -s
157
158 Generate output for a single IFD (page) in the input file.
159
160 .. option:: -t title
161
162 Specify the document title string.
163
164 .. option:: -T
165
166 Print pages for top edge binding.
167
168 .. option:: -w size
169
170 Specify the horizontal size of the printed area (in inches).
171
172 .. option:: -W size
173
174 Specify the maximum width of image (in inches). Images with larger sizes will
175 be split in several pages. Options :option:`-L` and :option:`-W`
176 are mutually exclusive.
177
178 .. option:: -x
179
180 Override resolution units specified in the TIFF as centimeters.
181
182 .. option:: -y
183
184 Override resolution units specified in the TIFF as inches.
185
186 .. option:: -z
187
188 When generating PostScript™ Level 2, data is scaled so that it does not
189 image into the ``deadzone`` on a page (the outer margin that the printing device
190 is unable to mark). This option suppresses this behavior.
191 When PostScript™ Level 1 is generated, data is imaged to the entire printed
192 page and this option has no affect.
193
194 Examples
195 --------
196
197 The following generates PostScript™ Level 2 for all pages of a facsimile:
198
199 .. highlight:: shell
200
201 ::
202
203 tiff2ps \-a2 fax.tif | lpr
204
205 Note also that if you have version 2.6.1 or newer of Ghostscript then you
206 can efficiently preview facsimile generated with the above command.
207
208 To generate Encapsulated PostScript™ for a the image at directory 2
209 of an image use:
210
211 ::
212
213 tiff2ps \-d 1 foo.tif
214
215 (Notice that directories are numbered starting at zero.)
216
217 If you have a long image, it may be split in several pages:
218
219 ::
220
221 tiff2ps \-h11 \-w8.5 \-H14 \-L.5 foo.tif > foo.ps
222
223 The page size is set to 8.5x11 by :option:`-w` and :option:`-h`
224 options. We will accept a small amount of vertical compression, so
225 :option:`-H` set to 14. Any pages between 11 and 14 inches will be fit onto one page.
226 Pages longer than 14 inches are cut off at 11 and continued on the next
227 page. The :command:`-L.5`
228 option says to repeat a half inch on the next page (to improve readability).
229
230 Bugs
231 ----
232
233 Because PostScript™ does not support the notion of a colormap,
234 8-bit palette images produce 24-bit PostScript™ images.
235 This conversion results in output that is six times
236 bigger than the original image and which takes a long time
237 to send to a printer over a serial line.
238 Matters are even worse for 4-, 2-, and 1-bit palette images.
239
240 Does not handle tiled images when generating PostScript™ Level I output.
241
242 See also
243 --------
244
245 :doc:`pal2rgb` (1),
246 :doc:`tiffinfo` (1),
247 :doc:`tiffcp` (1),
248 :doc:`tiffgt` (1),
249 :doc:`tiffmedian` (1),
250 :doc:`tiff2bw` (1),
251 :doc:`/functions/libtiff` (3tiff),