LinuxCommandLibrary

a2ping

Test reachability of Apache module configurations

TLDR

Convert an image to PDF (Note: Specifying an output filename is optional)

$ a2ping [path/to/image.ext] [path/to/output.pdf]
copy

Compress the document using the specified method
$ a2ping --nocompress [none|zip|best|flate] [path/to/file]
copy

Scan HiResBoundingBox if present (defaults to yes)
$ a2ping --nohires [path/to/file]
copy

Allow page content below and left of the origin (defaults to no)
$ a2ping --below [path/to/file]
copy

Pass extra arguments to gs
$ a2ping --gsextra [arguments] [path/to/file]
copy

Pass extra arguments to external program (i.e pdftops)
$ a2ping --extra [arguments] [path/to/file]
copy

Display help
$ a2ping [[-h|--help]]
copy

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.

SEE ALSO

gs(1), ps2pdf(1), epstopdf(1), convert(1), ps2eps(1)

Copied to clipboard