JPRED-2 Initial commit of software for the Jpred website (some files excluded due...
[jpred.git] / websoft / bin / ps2pdf
diff --git a/websoft/bin/ps2pdf b/websoft/bin/ps2pdf
new file mode 100755 (executable)
index 0000000..68b26af
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+if ($ARGV[0]) { open(IN, "<$ARGV[0]") or die($!); }
+else { *IN = *STDIN; }
+
+open(PROG, "| gs -dSAFER -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=- -c .setpdfwrite -f -") or die($!);
+while (<IN>) { print PROG $_; }
+close(IN);
+close(PROG);