Skip to content

Instantly share code, notes, and snippets.

@blang
Created July 24, 2011 17:32
Show Gist options
  • Save blang/1102856 to your computer and use it in GitHub Desktop.
Save blang/1102856 to your computer and use it in GitHub Desktop.
Quick sourcecode 2 pdf script
<h1>Quick source code 2 pdf</h1>
Author: Benedikt Lang <git@benediktlang.de>
usage: SRC_HOME="/home/ben/jworkspace" enscript2pdf listing.txt output
Generates output.pdf from files listed in listing.txt with parent directory /home/ben/jworkspace
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
listing.txt:
Project1/src/1.java
Project2/src/2.java
#!/bin/sh
OLDPWD=$PWD
rm $2.ps
cd $SRC_HOME
cat $OLDPWD/$1 | xargs enscript -E --output=$OLDPWD/$2.ps
ps2pdf $OLDPWD/$2.ps $OLDPWD/$2.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment