LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pnmtoddif

convert a PNM image to a DEC DDIF document

TLDR

Convert PNM to DDIF
$ pnmtoddif [input.pnm] > [output.ddif]
copy
Specify the output resolution in DPI
$ pnmtoddif -resolution [300] [input.pnm] > [output.ddif]
copy
Read from stdin
$ cat [input.pnm] | pnmtoddif > [output.ddif]
copy

SYNOPSIS

pnmtoddif [-resolution dpi] [pnmfile]

DESCRIPTION

pnmtoddif translates a PNM image (PBM, PGM, or PPM) into a DEC DDIF (Digital Document Interchange Format) document on standard output. DDIF is a compound-document format used by DEC's CDA (Compound Document Architecture), most notably in DECwindows applications and document tools that ship with VMS and Ultrix.The converter preserves the bit depth of the input: a PBM becomes a 1-bit DDIF page, a PGM becomes grayscale, and a PPM becomes 24-bit color. The output resolution recorded in the DDIF header is -resolution (default 75 DPI), influencing how downstream viewers scale the image.

PARAMETERS

PNMFILE

Input PNM (PBM, PGM, or PPM) image. If omitted, pnmtoddif reads from standard input.
-resolution N
Embed the given resolution (dots per inch) in the DDIF output. Defaults to 75 DPI.

CAVEATS

DDIF is a legacy format; viewers and converters outside of the historical DEC/Compaq toolchain are rare. There is no built-in converter from DDIF back to PNM in current Netpbm releases.

HISTORY

pnmtoddif was contributed to Netpbm to support interoperability with DEC Compound Document Architecture tooling. It remains in the distribution mostly for archival and legacy purposes.

SEE ALSO

Copied to clipboard
Kai