Last update: 4:49 pm pdtT H U R S D A Y ,    A P R I L   2 9 ,    2 0 1 0 FREE 

pdfsrc - Source Code Printing

pdfsrc is a command-line application which takes a set of Java or C source files and creates a PDF file which prints the source out in a sane way.

Code is printed with a tabstop of 4, 80 columns, and no colors. The pages are in landscape mode with the code printed in two panels. This is designed so printing on both sides of the page (duplex mode) gives excellent results.

pdfsrc is coded in Java and makes calls to the iText PDF library.

DOWNLOAD (osx/linux/win): pdfsrc.jar

Usage:

$ pdfsrc.jar file1.c file2.c *.h
OUTPUT: /tmp/src8551391537811265587.pdf

$ lp -o sides=two-sided-short-edge /tmp/src8551391537811265587.pdf
		OR
$ evince /tmp/src8551391537811265587.pdf
		OR
(Load in Adobe Reader, and select File->Print)

Example Page of Output:


pdfsrc uses the iText API to generate the raw PDF output. The iText project is redistributed under the terms of the GNU Affero General Public License. This can be downloaded here: iText.jar