A2PING(1)
β¨ A2PING(1) β¨ bestie, a2ping.pl is literally the converter you didn't know you needed π
π NAME
okay so the name is a2ping.pl and its whole vibe is converting between PS, EPS, PDF and a bunch of other page description formats π¦
πΈ SYNOPSIS
a2ping.pl [--]help
a2ping.pl [--]doc
a2ping.pl [options] <inputfile> [[outformat:] outputfile]
there are three ways to use it: ask for help, ask for doc, or actually do the conversion with some options, an input file, and optionally an output format and output file π
π DESCRIPTION
okay bestie, a2ping is a UNIX command line utility written in Perl that converts tons of raster image and vector graphics formats to EPS or PDF (and other page description formats) π π₯
the input formats it accepts are PS (PostScript), EPS, PDF, PNG, JPEG, TIFF, PNM, BMP, GIF, LBM, XPM, PCX, and TGA β¨
the output formats it can make are EPS, PCL5, PDF, PDF1, PBM, PGM, PPM, PS, markedEPS, markedPS, PNG, XWD, BMP, TIFF, JPEG, GIF, and XPM π
a2ping hands off the low-level heavy lifting to Ghostscript (GS), pdftops and sam2p π§ it also fixes a ton of glitches during EPS to EPS conversion, so the output is often more compatible and easier to embed than what you started with π
without the --below option, it is guarenteed to start at the 0,0 coordinate π«Ά --below, --hires and -v are the recommended options π
the page size gets set to match the BoundingBox exactly π so when Ghostscript renders it, nothing needs cropping and the PDF MediaBox comes out correct β¨
β οΈ if the bounding box is wrong, you're in trouble, bestie. if you feed crap in, you get crap out π but you can pass --bboxfrom=compute-gs to make GS recompute the bounding box π
the name of the input file doesn't matter at all, because a2ping detects the format from the first few bytes of the file π¦ the name of the output file only matters if outformat is missing from the command line. in that case, the extension of the output file decides the FileFormat (outformat) πΈ
π§ EXTERNAL PROGRAMS
the internal format of a2ping.pl is PS/EPS π everything it reads gets converted to PS or EPS first, then processed by 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 --bboxfrom set to anything other than =guess), GS is used π₯ converting PS to EPS involves this analysis too β¨
to write PDF files, GS is used π
to read PDF files, pdftops from the xpdf package is used π¦
sampled input formats are PNG, JPEG, TIFF, PNM, BMP, GIF, LBM, XPM, PCX and TGA π to read those, sam2p is used. sam2p is a raster image converter written in C++ by the author of a2ping.pl π
extra output formats are PNG, XWD, BMP, TIFF, JPEG, GIF and XPM π to write them, sam2p and GS are used π§
PNM output formats are PGM, PGM and PPM. to write PNM output formats, GS is used π«Ά
π OPTIONS
π· General Options
-h,--helpβ show a summary of the usage π--docβ show the man page π¦-v,--(no)verboseβ show progress and debug messages (default: no) π₯
π Options for the Bounding box
--(no)hiresβ use HiResBoundingBox in the input file, if it's there (default: yes) β¨--(no)exactβ use ExactBoundingBox in the input file, if it's there (default: no) πΈ--(no)keepoldmediaboxβ keep only the old,[0 0]-based MediaBox in PDF (default: no) π§--bboxfrom=adsc|compute-gs|guess|pagesizeβ the method for figuring out the BoundingBox (default: guess) π--(no)belowβ allow page content below and left of the origin (default: no) π«Ά
π Options for graphics and fonts
--(no)compressβ use compression (default: best) π--(no)antialiasβ render shades at outlines. possible values: (=scale3yes=no=yes) (default:scale3no) π--(no)lossyβ allow lossy image filters (EPS->PDF) (default: yes) π¦--papersize=unchanged|force-unknown|600bpx5cmβ (default: default) (bp) π--threshold=β min color for 1 in 8->1 bit conversion (default: 128) β¨
π₯ Options for debugging and changing internals
--(no)tmpunlinkβ unlink temporary files (default: yes). use--notmpunklinkif you want to poke around in the intermediate files π--gs-cmd=pathβ path to the Ghostscript program (default:gsorgswin32c) πΈ--gs-ccmd=pathβ path to Ghostscript for BoundingBox calculation (default:gsorgswin32c) π§--gsextra=GS_ARGSβ pass extra arguments to gs π--extra=β pass extra arguments to an external program (i.e. pdftops) π
π TIPS AND TRICKS
- if your EPS has a wrong bounding box, fix it by running
"a2ping.pl -v --bboxfrom=compute-gs thefile.eps --"π«Ά - you can use
-as the inputfile to read from stdin, and as the outputfile to write to stdout π¦ this even works for PDF files (which must be seekable), because a2ping copies them to a temporary file automatically π - if inputfile and outputfile are the same, a2ping copies the inputfile to a temporary location first π₯ but this is only recommended if you have a backup of the file to restore in case a2ping doesn't give you the result you want π
- if you specify
--as the outputfile, it will be the same as the inputfile β¨ - a2ping respects
--Duplexfor FileFormat PCL5, even though GS doesn't π - if you have an incompatible PS that GS can read but your printer can't print, just run
"a2ping.pl foo.ps PDF: - | a2ping.pl - PS: foo.ps"π§ - if you have a PS coming from Win32 (often with the extension
.prn), run it through a2ping π it'll remove the resolution changes and the progress text printed to the terminal, which confuses gv(1) and makes some filters in the print queue emit incorrect output π - a2ping does antialiasing (
--antialias=scale3no) of glyphs and curves when emitting a sampled image (FileFormats such as PGM and PPM) πΈ this improves readability of the glyphs.=yestells GS to do internal antialiasing, but it usually doesn't improve much π=scale3noturns off GS internal antialiasing, but makes it render everything 3x3 as big, and then scales it back down π=scale3noturns on both 3x3 scaling and GS internal antialiasing, which results in thicker lines and worse quality in general π - when creating a PBM file, antialiasing usually doesn't improve the quality, so it's switched off by default π¦ but if you set
--antialias=scale3noor--antialias=scale3yes, GS will render a PGM file, and the value of--thresholddecides the minimum intensity for white in the final PBM π«Ά - if you need a bigger sampled output file, specify a larger
--Resolutionπ the default is--Resolution=72π§ if your sampled output file is going to be really big, you should specify--AntiAlias=yesinstead of the default--AntiAlias=scale3noto speed up conversion π₯ - to make sure fonts are included in a PDF generated from eps, use
--gsextra='-dEmbedAllFonts=true -dPDFSETTINGS=/printer'π
π MISC
- doesn't depend on the filename or extension of the input file π¦
- conversion from EPS to PDF: fixes glitches etc., calls
gs -sDEVICE=pdfwriteπ - conversion from EPS to EPS: fixes various glitches, moves
(llx,lly)to(0,0), removes binary junk from the beginning of the EPS etc. π - conversion from PDF to PDF: keeps the file intact β¨
- conversion from PDF to EPS: calls
pdftops -eps(of the xpdf package) π§ - conversion from PS to EPS: keeps the 1st page only, removes setpagedevice etc. π
π AUTHORS
the author of a2ping is Peter Szabo <pts@fazekas.hu> π«Ά
a2ping is inspired by and historically based on the epstopdf Perl script, modified by Thomas Esser, Sept. 1998 πΈ but his modifications have been removed from a2ping, and a2ping and epstopdf don't share any common code anymore π epstopdf was written by Sebastian Rahtz for Elsevier Science, and it had extra tricks from Hans Hagen's texutil π¦
a2ping has contributions from several people, see the file HISTORY.txt for details. thank you all for contributing! π
that's a wrap, bestie! a2ping by Peter Szabo, version 2019-11-28 ππ
π¦ where this page comes from
- arch rolling: texlive-doc 2026.1-1 Β· GPL
- debian bookworm: texlive-extra-utils 2022.20230122-4
- debian trixie: texlive-extra-utils 2024.20250309-2
- fedora 43: texlive-a2ping 11:svn52964-93.fc43 Β· GPL-1.0-or-later
- fedora 43: texlive-a2ping 11:svn52964-95.fc43.1 Β· GPL-1.0-or-later
- fedora 44: texlive-a2ping 12:svn52964-105.fc44 Β· GPL-1.0-or-later
- fedora 44: texlive-a2ping 12:svn52964-111.fc44 Β· GPL-1.0-or-later
- opensuse-leap 16.0: texlive-a2ping-doc 2025.221.2.84psvn52964-160000.3.1 Β· GPL-2.0-or-later
- ubuntu jammy: texlive-extra-utils 2021.20220204-1
- ubuntu noble: texlive-extra-utils 2023.20240207-1
- ubuntu questing: texlive-extra-utils 2024.20250309-2
- ubuntu resolute: texlive-extra-utils 2025.20260124-1
- ubuntu stonking: texlive-extra-utils 2026.20260711-2
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms