Wouldn’t we all like to have our S/370 output out of Hercules look like this?
How do we do that?
There’s quite a bit of tinkering involved. I will do my best to describe how I did it below and on a few other pages.
Common Hercules stuff
First, there’s some common stuff we have to do on the Hercules level. These pages have been written working on Rasperry Pi’s with Raspbian Lite Linux, So YMMV…
Output from the S/370 systems comes out in *.txt files. When we want it to look like the picture above we have to do some tinkering of our own.
This article is a recipe for PDF output from .txt spool files out of Hercules and I tested it on Linux on my Raspberry Pi. First, as always, we make sure the system is up to date:
sudo apt-get update
sudo apt-get upgrade
Next we look wether ‘enscript‘ and ‘ps2pdf‘ are installed:
which enscript which ps2pdf
If they are, we’re golden! If not:
sudo apt-get install enscript sudo apt-get install ghostscript
Ghostscript? Yes, ghostscript, because ps2pdf is part of that package.
How to use these programs?
Now the seperate commands to create .pdf files are, assuming that you input file is prt00f.txt:
enscript --font=Courier-Bold@8 -l -H1 -r --margins=25:25:40:40 -p prt00f.ps prt00f.txt
We now have a postscript file containing our output. The next step is to convert it to .pdf:
ps2pdf prt00f.ps prt00f.pdf
This program, as the name implies, simply takes a Postscript file and converts it to .pdf.
Combine them into one command
Now both enscript and ps2pdf can write to and read from stdout and stdin, just substitute the name of your file with a minus sign. This is convenient because now we can pipe them together, so we don’t get polution in our directory of those .ps files that we don’t need anyway:
enscript --font=Courier-Bold@8 -l -H1 -r --margins=25:25:40:40 -p - prt00f.txt | ps2pdf - prt00f.pdf
Now for the different stuff per OS
Click on one of these links to continue for your OS of choice: