Topics: AIX, System Admin

Generating a PDF file from a text file on AIX

It's quite easy to generate a PDF file from a text file on AIX. What you need to do that, are both Enscript and Ghostscript installed. Both of them are RPMs that can be found in the AIX Toolbox for Linux Applications. Download the enscript and ghostscript RPMs, along with the RPMs ghostscript-fonts, libpng and urw-fonts, which are required by Ghostscript to run. Put the 5 RPMs in a single folder on your AIX system and run the following command to install all five:

# rpm -ihv *rpm
Now that it is installed, you can easily generate a PDF file. For example, if you wish to generate a PDF file from /etc/motd, run the following command:
# /opt/freeware/bin/enscript -B -p - /etc/motd \
| /usr/bin/gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
-sOutputFile=/tmp/motd.pdf -f -
The PDF file is written to /tmp/motd.pdf, and can be viewed with any PDF viewer.



If you found this useful, here's more on the same topic(s) in our blog:


UNIX Health Check delivers software to scan Linux and AIX systems for potential issues. Run our software on your system, and receive a report in just a few minutes. UNIX Health Check is an automated check list. It will report on perfomance, capacity, stability and security issues. It will alert on configurations that can be improved per best practices, or items that should be improved per audit guidelines. A report will be generated in the format you wish, and the report includes the issues discovered and information on how to solve the issues as well.

Interested in learning more?