a2ping
Test reachability of Apache module configurations
TLDR
Convert an image to PDF (Note: Specifying an output filename is optional)
Compress the document using the specified method
Scan HiResBoundingBox if present (defaults to yes)
Allow page content below and left of the origin (defaults to no)
Pass extra arguments to gs
Pass extra arguments to external program (i.e pdftops)
Display help
SYNOPSIS
a2ping [-v] [-q] [-o name] [-D device] [-p paper] [-r dpi] [-s scale] [PSfile ...]
PARAMETERS
-v
Verbose: print progress messages
-q
Quiet: suppress non-error messages
-o name
Output filename (default: name-ping.ext)
-D device
Device: pdf, png, png16m, pngmono, pnggray, jpeg, jpeggray, tiff24nc, eps, ps (default: pdf)
-P
Deprecated: alias for -D pdf
-F
Deprecated: alias for -D png16m
-p paper
Paper size: a4 (default), a3, a2, letter, legal, etc.
-r resolution
DPI resolution (default: 300)
-H height
Page height in points (overrides paper)
-W width
Page width in points (overrides paper)
-s scale
Scale factor (default: 1.0)
-m margins
Margins in points around image (default: 36)
-C command
Ghostscript command (default: gs)
DESCRIPTION
a2ping is a utility from the psutils package that converts PostScript (PS) files into raster and vector formats ideal for embedding in TeX, LaTeX, or HTML documents.
It renders the input PS on a single page, scaling it to fit specified dimensions (default A4 paper), and produces output like PDF, PNG, TIFF, JPEG, EPS, or PS. The tool uses Ghostscript (gs) for distillation and relies on device-specific settings for quality.
Primarily used for creating high-resolution images from vector diagrams, plots, or figures. For example, it handles complex PS output from tools like gnuplot or MetaPost. Default resolution is 300 DPI, with customizable scale, margins, and paper sizes. Input can be a file or stdin; multiple files process sequentially.
Unlike direct gs invocation, a2ping simplifies options for document inclusion, ensuring consistent bounding boxes and no extra pages.
CAVEATS
Requires Ghostscript; rasterizes content in image formats; full-page output only; large files may consume high memory.
DEPENDENCIES
Needs Ghostscript (≥9.x recommended). Install via apt install ghostscript psutils.
EXAMPLE USAGE
a2ping -o fig.pdf diagram.ps
a2ping -D png -r 150 -p a4 plot.ps
Include in LaTeX: \includegraphics{fig.pdf}
HISTORY
Part of psutils suite by Angus Duggan (early 1990s); maintained for PostScript-to-TeX workflows; included in most Linux distros via psutils package.


