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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
|
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "A2PING 1"
.TH A2PING 1 "2004-05-26" "perl v5.8.1" "User Contributed Perl Documentation"
.ds pts-dev \*[.T]
.do if '\*[.T]'ascii' .ds pts-dev tty
.do if '\*[.T]'ascii8' .ds pts-dev tty
.do if '\*[.T]'latin1' .ds pts-dev tty
.do if '\*[.T]'nippon' .ds pts-dev tty
.do if '\*[.T]'utf8' .ds pts-dev tty
.do if '\*[.T]'cp1047' .ds pts-dev tty
.do if '\*[pts-dev]'tty' \{\
.ll 79
.pl 33333v
.nr IN 2n
.\}
.ad n
.SH "NAME"
a2ping.pl \-\- convert between PS, EPS and PDF and other page description
formats
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\& \fBa2ping.pl\fR [\fB\-\-\fR]\fBhelp\fR
\fBa2ping.pl\fR [\fB\-\-\fR]\fBdoc\fR
\fBa2ping.pl\fR [\fIoptions\fR] <\fIinputfile\fR> [[\fIoutformat\fR:] \fIoutputfile\fR]
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBa2ping\fR is a \s-1UNIX\s0 command line utility written in Perl that
converts many raster image and vector graphics formats to \s-1EPS\s0 or \s-1PDF\s0 and
other page description formats. Accepted input file formats are: \s-1PS\s0
(PostScript), \s-1EPS\s0, \s-1PDF\s0, \s-1PNG\s0, \s-1JPEG\s0, \s-1TIFF\s0, \s-1PNM\s0, \s-1BMP\s0, \s-1GIF\s0, \s-1LBM\s0, \s-1XPM\s0, \s-1PCX\s0,
\&\s-1TGA\s0. Accepted output formats are: \s-1EPS\s0, \s-1PCL5\s0, \s-1PDF\s0, \s-1PDF1\s0, \s-1PBM\s0, \s-1PGM\s0, \s-1PPM\s0,
\&\s-1PS\s0, markedEPS, markedPS, \s-1PNG\s0, \s-1XWD\s0, \s-1BMP\s0, \s-1TIFF\s0, \s-1JPEG\s0, \s-1GIF\s0, \s-1XPM\s0.
\&\fBa2ping\fR delegates the low-level work to
Ghostscript (\s-1GS\s0), \fBpdftops\fR and \fBsam2p\fR. \fBa2ping\fR fixes many glitches
during the \s-1EPS\s0 to \s-1EPS\s0 conversion, so its output is often more compatible
and better embeddable than its input.
.PP
Without the \f(CW\*(C`\-\-below\*(C'\fR option, it is guarenteed to start at the 0,0
coordinate. \f(CW\*(C`\-\-below\*(C'\fR, \f(CW\*(C`\-\-hires\*(C'\fR and \f(CW\*(C`\-v\*(C'\fR are recommended options.
.PP
The page size is set exactly corresponding to the BoundingBox.
This means that when Ghostscript renders it, the result needs no
cropping, and the \s-1PDF\s0 MediaBox is correct.
.PP
If the bounding box is not right, of course, you have problems. If you
feed crap in, you get crap. But you can supply the
\&\fB\-\-bboxfrom=compute\-gs\fR option to make \s-1GS\s0 recompute the bounding box.
.PP
The name of the input file doesn't matter \*(-- \fBa2ping\fR detects the file
format based on the first few bytes of the file. The name of the output
file matters if \fIoutformat\fR is missing from the command line: then the
extension of the output file determines the FileFormat (\fIoutformat\fR).
.SH "EXTERNAL PROGRAMS"
.IX Header "EXTERNAL PROGRAMS"
The internal file format of \fBa2ping.pl\fR is \s-1PS/EPS\s0. Everything read is
first converted to \s-1PS\s0 or \s-1EPS\s0, then processed by \fBa2ping.pl\fR, then
converted to the output format.
.PP
To analyse the bounding box and other properties of non-EPS \s-1PS\s0 files
(and \s-1EPS\s0 files with option \fB\-\-bboxfrom\fR other than \fB=guess\fR), \s-1GS\s0 is
used. Converting \s-1PS\s0 to \s-1EPS\s0 involves this analysis.
.PP
To write \s-1PDF\s0 files, \s-1GS\s0 is used.
.PP
To read \s-1PDF\s0 files, \fBpdftops\fR from the \fBxpdf\fR package is used.
.PP
Sampled input formats are \s-1PNG\s0, \s-1JPEG\s0, \s-1TIFF\s0, \s-1PNM\s0, \s-1BMP\s0, \s-1GIF\s0, \s-1LBM\s0, \s-1XPM\s0, \s-1PCX\s0
and \s-1TGA\s0. To read sampled input formats, \fBsam2p\fR is used. \fBsam2p\fR is
a raster image converter written in \*(C+ by the author of \fBa2ping.pl\fR.
.PP
Extra output formats are \s-1PNG\s0, \s-1XWD\s0, \s-1BMP\s0, \s-1TIFF\s0, \s-1JPEG\s0, \s-1GIF\s0 and \s-1XPM\s0. To
write extra output formats, \fBsam2p\fR and \s-1GS\s0 are used.
.PP
\&\s-1PNM\s0 output formats are \s-1PGM\s0, \s-1PGM\s0 and \s-1PPM\s0. To write \s-1PNM\s0 output formats, \s-1GS\s0
is used.
.SH "TIPS AND TRICKS"
.IX Header "TIPS AND TRICKS"
.IP "\(bu" 2
Call with the \fB\-v\fR option to see progress and debug messages.
.IP "\(bu" 2
If your \s-1EPS\s0 contains a wrong bounding box, you can fix it by running
\&\f(CW\*(C`a2ping.pl \-v \-\-bboxfrom=compute\-gs thefile.eps \-\-\*(C'\fR
.IP "\(bu" 2
You can specify \fB\-\fR as \fIinputfile\fR to get stdin and as \fIoutputfile\fR
to get stdout. This works even for \s-1PDF\s0 files (which must be seekable),
because \fBa2ping\fR copies them to a temporary file automatically.
.IP "\(bu" 2
If \fIinputfile\fR and \fIoutputfile\fR are the same, \fBa2ping\fR copies the
\&\fIinputfile\fR to a temporary location first. However, this usage is
recommended only if there is a backup of the file to be restored in case
\&\fBa2ping\fR doesn't produce the desired result.
.IP "\(bu" 2
If you specify \fB\-\-\fR as \fIoutputfile\fR, it will be the same as \fIinputfile\fR.
.IP "\(bu" 2
\&\fBa2ping\fR respects \fB\-\-Duplex\fR for FileFormat \s-1PCL5\s0, even though \s-1GS\s0 doesn't.
.IP "\(bu" 2
If you have an incompatible \s-1PS\s0 that \s-1GS\s0 can read but your printer cannot print,
just run \f(CW\*(C`a2ping.pl foo.ps PDF: \- | a2ping.pl \- PS: foo.ps\*(C'\fR
.IP "\(bu" 2
If you have a \s-1PS\s0 coming from Win32 (often with extension \f(CW\*(C`.prn\*(C'\fR), run
it through \fBa2ping\fR. It will remove the resolution changes and the
progress text printed to the terminal (which confuses \fIgv\fR\|(1) and makes
some filters in the print queue emit incorrect output).
.IP "\(bu" 2
\&\fBa2ping\fR does antialiasing (\fB\-\-antialias=scale3no\fR) of glyphs and
curves when emitting a sampled image (FileFormats such as \s-1PGM\s0 and \s-1PPM\s0).
This improves readability of the glyphs. \fB=yes\fR instructs \s-1GS\s0 to do
internal antialiasing, but it usually doesn't improve much. \fB=scale3no\fR
turns off \s-1GS\s0 internal antialiasing, but makes it render everything 3x3
as big, and then scales it back down. \fB=scale3no\fR turns on both 3x3
scaling and \s-1GS\s0 internal antialiasing, which results in thicker lines and
worse quality in general.
.IP "\(bu" 2
When creating a \s-1PBM\s0 file, antialiasing usually doesn't improve the
quality, so it is switched off by default. But if you set
\&\fB\-\-antialias=scale3no\fR or \fB\-\-antialias=scale3yes\fR, \s-1GS\s0 will render a \s-1PGM\s0 file,
and the value of \fB\-\-threshold\fR determines the minimum intensity for white in
the final \s-1PBM\s0.
.IP "\(bu" 2
If you need a bigger sampled output file, specify a larger
\&\fB\-\-Resolution\fR. The default is \fB\-\-Resolution=72\fR. If your sampled output file
is going to be really big, you should specify \fB\-\-AntiAlias=yes\fR instead of
the default \fB\-\-AntiAlias=scale3no\fR to speed up conversion.
.SH "MISC"
.IX Header "MISC"
.IP "\(bu" 2
Doesn't depend on the filename or extension of the input file.
.IP "\(bu" 2
Conversion from \s-1EPS\s0 to \s-1PDF:\s0 fixes glitches etc., calls gs
\&\-sDEVICE=pdfwrite
.IP "\(bu" 2
Conversion from \s-1EPS\s0 to \s-1EPS:\s0 fixes various glitches, moves (llx,lly) to
(0,0), removes binary junk from the beginning of the \s-1EPS\s0 etc.
.IP "\(bu" 2
Conversion from \s-1PDF\s0 to \s-1PDF:\s0 keeps the file intact
.IP "\(bu" 2
Conversion from \s-1PDF\s0 to \s-1EPS:\s0 calls pdftops \-eps (of the xpdf package)
.IP "\(bu" 2
Conversion from \s-1PS\s0 to \s-1EPS:\s0 keeps 1st page only, removes setpagedevice etc.
.SH "AUTHORS"
.IX Header "AUTHORS"
The author of \fBa2ping\fR is Szabó Péter <\fIpts@fazekas.hu\fR>.
.PP
\&\fBa2ping\fR is inspired by and historically based on the \fBepstopdf\fR Perl
script modified by Thomas Esser, Sept. 1998, but his modifications have
been removed from \fBa2ping\fR, and also \fBa2ping\fR and \fBepstopdf\fR do not
share common code anymore. \fBepstopdf\fR is written by Sebastian Rahtz,
for Elsevier Science. \fBepstopdf\fR contained extra tricks from Hans Hagen's
texutil.
.SH "HISTORY"
.IX Header "HISTORY"
.Sh "1999/05/06 v2.5 (Heiko Oberdiek)"
.IX Subsection "1999/05/06 v2.5 (Heiko Oberdiek)"
.Vb 14
\& * New options: --hires, --exact, --filter, --help.
\& * Many cosmetics: title, usage, ...
\& * New code for debug, warning, error
\& * Detecting of cygwin perl
\& * Scanning for %%{Hires,Exact,}BoundingBox.
\& * Scanning only the header in order not to get a wrong
\& BoundingBox of an included file.
\& * (atend) supported.
\& * uses strict; (earlier error detecting).
\& * changed first comment from '%!PS' to '%!';
\& * corrected (atend) pattern: '\es*\e(atend\e)'
\& * using of $bbxpat in all BoundingBox cases,
\& correct the first white space to '...Box:\es*$bb...'
\& * corrected first line (one line instead of two before 'if 0;';
.Ve
.Sh "2000/11/05 v2.6 (Heiko Oberdiek)"
.IX Subsection "2000/11/05 v2.6 (Heiko Oberdiek)"
.Vb 1
\& * %%HiresBoundingBox corrected to %%HiResBoundingBox
.Ve
.Sh "2001/03/05 v2.7 (Heiko Oberdiek)"
.IX Subsection "2001/03/05 v2.7 (Heiko Oberdiek)"
.Vb 2
\& * Newline before grestore for the case that there is no
\& whitespace at the end of the eps file.
.Ve
.Sh "2003/02/02 (Szabó Péter)"
.IX Subsection "2003/02/02 (Szabó Péter)"
.Vb 10
\& * option --below
\& * removes DOS EPSF binary junk correctly
\& * adds all 3 BoundingBox DSC comments
\& * reads all 3 BoundingBox DSC comments, and picks the best
\& * forces BoundingBox to be an integer
\& * adds %%EndComments and proper %!PS-Adobe-?-? EPSF-?.? header
\& * adds %%Pages:
\& * adds invocation syntax: a2ping <infile.eps> <outfile.eps|pdf>
\& * can convert PDF to EPS (by calling pdftops(1)) and PDF to PDF
\& * emulates work for PDF input
.Ve
.Sh "2003/04/16 (Szabó Péter)"
.IX Subsection "2003/04/16 (Szabó Péter)"
.Vb 7
\& * added PS and sam2p support, renamed to a2ping
\& * sam2p and pdftops if $InputFilename eq '-';
\& * remove PJL UEL header from the beginning
\& * works for PS non-EPS files for input
\& * input support for PNG JPEG TIFF PNM BMP GIF LBM XPM PCX TGA via sam2p
\& * removes ^L (form feed) from end of EPS file
\& * -x=-c:rle to add sam2p options
.Ve
.Sh "2003/04/26 (Szabó Péter)"
.IX Subsection "2003/04/26 (Szabó Péter)"
.Vb 14
\& * omit the unnecessary setpagedevice calls when creating normal eps
\& * --noverbose --nocompress supported differently
\& * no more option defaults :-(
\& * justlib2
\& * multi-page output with PS:, PDF:, PCL5:
\& * after `a2ping -pa4', file out.pcl says: `HP PCL printer data - A4 page
\& size', instead of `US letter'
\& * justlib2-ified doesn't depend on Getopt::Long anymore
\& * fully supports filtering (stdin and/or stdout), PDF and PCL5 output to
\& pipe (!$$ll_zero)
\& * adds DSC ``%%DocumentMedia: plain 612 792 0 () ()''
\& * BoundingBox precedence for EPS input: --PageSize, %%*BoundingBox,
\& setpagedevice. Precedence for other inputs: --PageSize, setpagedevice,
\& %%*BoundingBox
.Ve
.Sh "2003/09/25 (Szabó Péter)"
.IX Subsection "2003/09/25 (Szabó Péter)"
.Vb 7
\& * --bboxfrom=adsc: %%BoundingBox overrides -sDEVICE=bbox
\& * improved bbox discovery
\& * many bugfixes
\& * MetaPost EPS input fixes for prologues:=0;
\& * a2ping.pl -v --papersize=50,60 --bboxfrom=compute-gs t.ps t2.ps
\& * consistent bbox, --PageSize, /PageSize handling
\& * consistent --Resolution and --Duplex handling
.Ve
.Sh "2003/12/02 (Szabó Péter)"
.IX Subsection "2003/12/02 (Szabó Péter)"
.Vb 1
\& * --bboxfrom=compute-gs option to fix PS -> EPS bbox (gs -sDEVICE=bbox), tuzv.eps
.Ve
.Sh "2004/02/10 v2.77 (Szabó Péter)"
.IX Subsection "2004/02/10 v2.77 (Szabó Péter)"
.Vb 7
\& * the compute-pipe routine is now run unless --bboxfrom=guess with EPS
\& * added --gsextra=
\& * added --antialias=
\& * added FileFormat PBM, PGM, PPM
\& * separated FileFormat features to FL_* constants
\& * added --doc
\& * there is no default FileFormat (PDF) anymore
.Ve
|