a2ping man page

a2ping.pl -- convert between PS, EPS and PDF and other page description formats


Z<> B<a2ping.pl> [B<-->]B<help>
B<a2ping.pl> [B<-->]B<doc>
B<a2ping.pl> [I<options>] <I<inputfile>> [[I<outformat>:] I<outputfile>]


B<a2ping> is a UNIX command line utility written in Perl that converts many raster image and vector graphics formats to EPS or PDF and other page description formats. Accepted input file formats are: PS (PostScript), EPS, PDF, PNG, JPEG, TIFF, PNM, BMP, GIF, LBM, XPM, PCX, TGA. Accepted output formats are: EPS, PCL5, PDF, PDF1, PBM, PGM, PPM, PS, markedEPS, markedPS, PNG, XWD, BMP, TIFF, JPEG, GIF, XPM. B<a2ping> delegates the low-level work to Ghostscript (GS), B<pdftops> and B<sam2p>. B<a2ping> fixes many glitches during the EPS to EPS conversion, so its output is often more compatible and better embeddable than its input. Without the C<--below> option, it is guarenteed to start at the 0,0 coordinate. C<--below>, C<--hires> and C<-v> are recommended options. The page size is set exactly corresponding to the BoundingBox. This means that when Ghostscript renders it, the result needs no cropping, and the PDF MediaBox is correct. 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 B<--bboxfrom=compute-gs> option to make GS recompute the bounding box. The name of the input file doesn't matter -- B<a2ping> detects the file format based on the first few bytes of the file. The name of the output file matters if I<outformat> is missing from the command line: then the extension of the output file determines the FileFormat (I<outformat>).

External Programs

The internal file format of B<a2ping.pl> is PS/EPS. Everything read is first converted to PS or EPS, then processed by B<a2ping.pl>, then converted to the output format. To analyse the bounding box and other properties of non-EPS PS files (and EPS files with option B<--bboxfrom> other than B<=guess>), GS is used. Converting PS to EPS involves this analysis. To write PDF files, GS is used. To read PDF files, B<pdftops> from the B<xpdf> package is used. Sampled input formats are PNG, JPEG, TIFF, PNM, BMP, GIF, LBM, XPM, PCX and TGA. To read sampled input formats, B<sam2p> is used. B<sam2p> is a raster image converter written in C++ by the author of B<a2ping.pl>. Extra output formats are PNG, XWD, BMP, TIFF, JPEG, GIF and XPM. To write extra output formats, B<sam2p> and GS are used. PNM output formats are PGM, PGM and PPM. To write PNM output formats, GS is used.


General Options

-h, --help

Show a summary of the usage


Show the man page

-v, --(no)verbose

Show progress and debug messages (default: no)

Options for the Bounding box


Use HiResBoundingBox in the input file, if present (default: yes)


Use ExactBoundingBox in the input file, if present (default: no)


keep only old, [0 0]-based MediaBox in PDF (default: no)


Method for determining the BoundingBox  (default: guess)


Allow page content below and left of the origin (default: no)

Options for graphics and fonts


use compression                   (default: best)


render shades at outlines.  Possible values: (=I<scale3yes> =I<no> =I<yes>)  (default: scale3no)


allow lossy image filters (EPS->PDF) (default: yes)


(default: default) (bp)


min color for 1 in 8->1 bit conv  (default: 128)

Options for debugging and changing internals


Unlink temporary files (default: yes).  Use B<--notmpunklink> if you want to inspect intermediate files.


path to Ghostscript program (default: gs or gswin32c)


path to Ghostscript for BoundingBox calculation (default: gs or gswin32c)


Pass extra arguments to gs


Pass extra arguments to external program (i.e pdftops)

Tips and Tricks



The author of B<a2ping> is Péter Szabó <F<pts@fazekas.hu>>. B<a2ping> is inspired by and historically based on the B<epstopdf> Perl script modified by Thomas Esser, Sept. 1998, but his modifications have been removed from B<a2ping>, and also B<a2ping> and B<epstopdf> do not share common code anymore.  B<epstopdf> is written by Sebastian Rahtz, for Elsevier Science. B<epstopdf> contained extra tricks from Hans Hagen's texutil. B<a2ping> contains contributions from several people, see the file F<HISTORY.txt> for details. Thank you all for contributing!


2018-03-08 a2ping Peter Szabo