Using GNU enscript and Ghostscript to simulate 132x66 output to PDF

1 min read Original article ↗

Using GNU enscript and Ghostscript to simulate 132x66 output to PDF

Prerequisites

Command

This command will produce an out.pdf file containing two full pages of X characters, with each page fitting 132x66 characters on Legal (8.5"x14") paper in landscape orientation using fixed-width Courier font.

$ enscript -qrl -M Legal -f Courier11.99/7.48 -p - \
    <(yes $(printf "X%.0s" {1..132}) | head -132) \
    | ps2pdf - out.pdf

This might be useful if you have some plain ASCII text that was formatted for printing on an old line printer.

#!/bin/bash
#
# Demo: print-132x66-to-pdf <(yes $(printf "X%.0s" {1..132}) | head -132) > out.pdf
#
enscript -qrl -M Legal -f Courier11.99/7.48 -p - "$@" | ps2pdf - -