Penguin
Annotated edit history of pstoimg(1) version 2, including all changes. View license author blame.
Rev Author # Line
1 perry 1 PSTOIMG
2 !!!PSTOIMG
3 NAME
4 SYNOPSIS
5 OPTIONS
6 DESCRIPTION
7 RETURN VALUE
8 EXAMPLES
9 ENVIRONMENT
10 SEE ALSO
11 NOTES
12 CAVEATS
13 BUGS
14 AUTHOR
15 HISTORY
16 ----
17 !!NAME
18
19
2 perry 20 pstoimg - Convert a !PostScript file to a bitmap image using Ghostscript and the Netpbm utilities
1 perry 21 !!SYNOPSIS
22
23
24 __pstoimg -help -version__
25
26
27 __pstoimg__ [[ __-antialias__ ] [[ __-aaliastext__ ]
28 [[ __-center__ ''num'' ] [[ __-color__ ''num'' ] [[
29 __-crop__ ''code'' ] [[ __-debug__ ] [[
30 __-density__ ''num''] [[ __-depth__ ''num'' ] [[
31 __-discard__ ] [[ __-flip__ ''code'' ] [[
32 __-geometry__ ''X''x''Y'' ] [[ __-interlaced__ ]
33 [[ __-margins__ ''X'',''Y'' ] [[ __-multipage__ ]
34 [[ __-out__ ''file'' ] [[ __-quiet__ ] [[
35 __-rightjustify__ ''num'' ] [[ __-scale__ ''num''
36 ] [[ __-tmp__ ''path'' ] [[ __-topjustify__
37 [[__x__]''num'' ] [[ __-transparent__ ] [[
38 __-type__ ''type'' ] [[ __-shoreup__
39 ''num''[[__d__] ] [[ __-white__ ] ''file'' [[
40 ''file2'' ... ]
41 !!OPTIONS
42
43
44 The command line options may be abbreviated to the shortest
45 unique prefix.
46
47
48 __-help__
49
50
51 Show this help page and exit.
52
53
54 __-version__
55
56
57 Show the release and version of pstoimg and
58 exit.
59
60
61 __-antialias__
62
63
64 Use Ghostscript's anti-aliasing feature for rendering
65 ``softer'' images. This applies to lines and edges of
66 polygonal and oval or circular shapes. Only valid if
67 Ghostscipt 4.03 or higher is installed.
68
69
70 __-aaliastext__
71
72
73 Use Ghostscript's anti-aliasing feature for ``smoother''
74 font characters, without the jagged edges. Similar to
75 __-antialias__ for graphic components. Only valid if
76 Ghostscipt 4.03 or higher is installed.
77
78
79 __-center__ ''num''
80
81
82 Add the appropriate amount of whitespace to the left of the
83 image so that the image appears to be centered in a total
84 width of ''num'' pixels.
85
86
87 __-crop__ ''code''
88
89
90 Crop the bitmap from the given directions. ''code'' may
91 be a string of several cropping instructions, which are
92 executed strictly in the given order. Possible values are:
93 __h__ (horizontal, i.e. crop top and bottom), __v__
94 (vertical), __tblr__ (top, bottom, left, right) and
95 __a__ (all directions). A special case is __s__:
96 ``shave'' the image at the bottom, but only if a single line
97 of whitespace exists.
98
99
100 __-debug__
101
102
103 Turn on debugging output. This can get rather verbose. Any
104 intermediate files generated are not removed to help
105 debugging.
106
107
108 __-density__ ''num''
109
110
111 The density (resolution) in DPI in which to
112 render the bitmap. The default is 72.
113
114
115 __-depth__ ''num'' or __-color__
116 ''num''
117
118
119 Specify the color depth of the bitmap. Legal values are 1
120 (black
121
122
123 __-discard__
124
125
126 Delete the input postscript file if the conversion was
127 successful. Setting the environment DISCARD
128 to a true value (as perl sees it) has the same
129 effect.
130
131
132 __-flip__ ''code''
133
134
135 Flip all generated output bitmaps. The following codes are
136 recognized: lr (flip left-right), tb (flip top-bottom), xy
137 (flip bottom/left-top/right), r90 and ccw (rotate by 90
138 degrees counterclockwise), r270 and cw (rotate 90 degrees
139 clockwise) and r180 (rotate 180 degrees).
140
141
142 __-geometry__ ''X''x''Y''
143
144
2 perry 145 Render only this ``window'' of the !PostScript file. If
1 perry 146 given, this option can dramatically reduce memory
147 requirements and speed up conversion. The geometry is
148 automatically detected in case of EPS files
2 perry 149 (Encapsulated !PostScript).
1 perry 150
151
152 __-interlaced__
153
154
155 Generate an interlaced bitmap. Interlaced images build up
156 from coarse to fine as they are loaded. This option may not
157 work on every installation and/or bitmap type, depending of
158 the capabilities of external programs.
159
160
161 __-margins__ ''X'',''Y''
162
163
164 The offset of the rectangle in the postscript file that is
165 going to be rendered from top/left. Can be used together
166 with __-geometry__ to further reduce the size of the
167 intermediate bitmap file generated by
168 Ghostscript.
169
170
171 __-multipage__
172
173
2 perry 174 Process a multi-page !PostScript file, i.e. create an
1 perry 175 individual bitmap for every page. The resulting files are
176 numbered: The decimal number (starting with 1) is appended
2 perry 177 to the basename of the !PostScript input file (or the
1 perry 178 basename of the filename specified with __-out__), while
179 keeping the extension.
180
181
182 __-out__ ''file''
183
184
2 perry 185 The file where to write the bitmap. If multiple !PostScript
1 perry 186 files are supplied on the command line, this option is
187 ignored. The bitmap type extension is appended automatically
188 if ''file'' does not contain a dot. In connection with
189 __-multipage__ ''file'' is extended by the page number
190 as shown in this example:
191
192
193 -outfile foo.gif --------
194
195
196 __-quiet__
197
198
199 Do not print anything except error messages.
200
201
202 __-rightjustify__ ''num''
203
204
205 Add the appropriate amount of whitespace to the left of the
206 image so that it appears to be aligned to the right in a
207 total width of ''num'' pixels.
208
209
210 __-scale__ ''factor''
211
212
213 Scale the image by ''factor''. Valid choices are any
214 numbers greater than zero. Useful choices are numbers
215 between 0.1 - 5. Large numbers may generate very large
216 intermediate files and will take longer to process. If this
217 option is omitted, the environment SCALE is
218 considered.
219
220
221 __-shoreup__ ''num''[[__d__]
222
223
224 Make height and width of the bitmap(s) an exact multiple of
225 ''num''. If ''num'' is followed by a ``d'', then half
226 the extra vertical space is placed underneath. This option
227 is useful, if you want to have ``blown-up'' images of high
228 quality for print, but downscale them in HTML
229 using . If the actual
230 image is is not an integer multiple of x,y then browsers
231 tend to display distorted images.
232
233
234 __-tmp__ ''path''
235
236
237 Use ''path'' to store temporary files. Defaults to /tmp
238 on this installation. This parameter can be set by the
239 environment __TMP__ or
240 __TEMP__ , too.
241
242
243 __-topjustify__ [[__x__]''num''
244
245
246 Add padding whitespace to the image so that it gets a
247 defined height. If an integer value is given, it defines the
248 total height. The whitespace is added at the bottom. If the
249 number is preceded by ``x'', then this multiple of the image
250 height is added as whitespace at the bottom.
251
252
253 __-transparent__
254
255
256 Generate transparent bitmaps, i.e. the background color
257 (white) is transparent if viewed with certain viewers (e.g.
258 browsers). This option may not be available due to missing
259 capabilities of external programs.
260
261
262 __-type__ ''type''
263
264
265 Instruct pstoimg to render the bitmap in ''type'' format.
266 Depending on the local installation, pstoimg is capable of
267 generating either GIF or PNG
268 bitmaps. This site features the following types:
269 png
270
271
272 If omitted, the first type in this list is
273 taken.
274
275
276 __-white__
277
278
2 perry 279 Remove TeX's page color information from the !PostScript file
1 perry 280 before converting so that a white background is
281 used.
282 !!DESCRIPTION
283
284
285 __pstoimg__ iterates over the given input files and runs
286 them through Ghostscipt. The resulting pnm (portable anymap
287 files) are processed with different Netpbm tools (cropping,
288 color mapping, aligning, ...) and finally converted into
289 (currently) either GIF or PNG
290 format. The bitmaps can now be included e.g. in
291 WWW pages.
292
293
2 perry 294 The !PostScript file is converted as is. If a valid bounding
1 perry 295 box is found ( EPS format), then only this
296 area is converted. The image is ''not'' cropped by
297 default.
298 !!RETURN VALUE
299
300
301 if everything went all right
302
303
304 x
305
306
307 (x != 0) something went wrong. See the message
308 output.
309 !!EXAMPLES
310
311
312 pstoimg foo.ps
313
314
315 Convert the first page of foo.ps to the default bitmap
316 type.
317
318
319 pstoimg -type png -crop a -trans -interlace
320 foo.ps
321
322
323 Same as above, but force png output and crop all the
324 whitespace around the image and make the color white
325 transparent and generate an interlaced bitmap.
326
327
328 pstoimg -multi -out bar -type gif -crop a
329 foo.ps
330
331
2 perry 332 Consider foo.ps a multiple page !PostScript file and create
1 perry 333 output files bar1.gif, bar2.gif, etc.
334 !!ENVIRONMENT
335
336
337 DENSITY , DEPTH ,
338 DEBUG , DISCARD
339
340
341 See __-density__, __-depth__, __-debug__,
342 __-discard__, respectively.
343
344
345 GS_LIB
346
347
348 This variable is set to the path(s) where Ghostscript
349 libraries have been found on this system during
350 configuration, but only if the built-in paths are not
351 correct. This fixes the problem of relocation that is quite
352 common on Win32 installations. This behavior can be
353 overridden by setting GS_LIB manually before
354 starting pstoimg.
355
356
357 LATEX2HTMLDIR
358
359
360 The directory where the LaTeX2HTML library and perl modules
361 are found. Defaults to ``/usr/share/latex2html'' on this
362 installation.
363
364
365 OUTFILE
366
367
368 Setting this has the same effect as specifying __-out__.
369 Please do not rely on this feature any more, it will
370 disappear from the next releases!
371
372
373 PAPERSIZE
374
375
376 The papersize to use by Ghostscript to render the image.
377 pstoimg tries hard to optimize for rendering on the smallest
378 possible bitmap size. Still this option is there to enable
379 tuning by hand, although it is deprecated. If pstoimg finds
380 a better setting, this parameter is ignored.
381
382
383 SCALE
384
385
386 See the discussion of __-scale__.
387
388
389 TMP and TEMP
390
391
392 Unless overridden by __-tmp__, these variables denote a
393 directory where to store temporary files. TMP
394 is considered first, then TEMP .
395 !!SEE ALSO
396
397
398 gs, pnmcrop, pnmquant, pbmmake, pnmcat, pnmfile, pnmflip,
399 ppmtogif, pnmtopng, giftool, giftrans.
400 !!NOTES
401
402
2 perry 403 Several people have suggested to use !ImageMagick's convert
1 perry 404 instead of pstoimg. A few comments on this: convert uses (of
2 perry 405 course) Ghostscript for conversion of !PostScript to bitmap,
1 perry 406 so one still needs gs. And for the special requirements of
407 LaTeX2HTML convert's features are not sufficient. The
2 perry 408 !ImageMagick toolset has everything in place, but it has some
1 perry 409 overhead that can prove killing when processing some 100
410 images. pstoimg only does what it really has to, so it
411 should be quite efficient. Don't get me wrong - I like
2 perry 412 !ImageMagick, but not in the context of
1 perry 413 LaTeX2HTML.
414 !!CAVEATS
415
416
417 This utility is automatically configured and built to work
418 on the local setup. If this setup changes (e.g. some of the
419 external commands are moved), the script has be be
420 reconfigured.
421
422
423 Despite the portability of perl, a pstoimg configured on
424 UNIX will probably not work on Win32 and vice
425 versa.
426 !!BUGS
427
428
429 This is a major enhancement release, so there may be a few
430 bugs. As the user inteface changed a bit, some of your tools
431 that were using pstoimg may not work any more.
432
433
434 Please report bugs to latex2html@tug.org, stating the
435 (debug) output of pstoimg, your perl version and the
436 versions of the external tools. Best is to include the
437 cfgcache.pm file from the configuration
438 procedure.
439 !!AUTHOR
440
441
442 Marek Rouchal
443 !!HISTORY
444
445
446 This script went through a long evolution, beginning with a
447 modification of Doug Crabill's
448 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.