(Author: Roland Rashleigh-Berry
Date: 10 Jun 2006)
Suppose a legacy system, such as the one described, used US Letter
paper with 1.0 inch margins all round and the list of output was in the
file "outlis.txt" then the following command might be able to build
the PostScript file. And if you have a good PostScript file, the rest is
easy.
usps -r 1.0 $(cat outlis.txt) > myfile.ps |
Both the "a4ps" and "usps" scripts, as supplied, default the margins to 1.0 inch for all except the right margin which is 0.75 inches (looking at the page in the "portrait" sense). So if any of the margins differ then they must be specified.
Once you have a PostScript file then you can turn it into a PDF using
either "a4ps2pdf" or "usps2pdf" depending on the paper size. The script
will create a file with the same name as the input file but with the extension
".pdf" like this:
usps2pdf myfile.ps |
Hopefully you will have a PDF and if you are lucky, it will be correctly
bookmarked as well. It is the script "getitles" that tries to identify
the titles in your output. Maybe it will need amending to do so correctly
or maybe a special version of it will be required. It is not an easy script
to maintain, though I have written it as best I can. You can link to it
below as well as a simple SAS® software version of it.
getitles
getitles_sas
The above script will create files names file001.tmp, file002.tmp etc.
so they will be in the correct order for input to "a4ps" or "usps". Again,
you need to know what paper size the reports were intended for and what
margins to leave as both "a4ps" and "usps", as supplied, assume a one inch
margin all round except the right margin (in the "portrait" sense) which
is 0.75 inches. Assuming the reports were intended for A4 paper with a
one inch margin all round then once you had split the output using "splitbiglst"
you could create the PostScript file like this:
a4ps -r 1.0 file*.tmp > myfile.ps |
Once you have the postscript file, you can convert it to a PDF using
either "a4ps2pdf" (for A4 paper) or "usps2pdf" (for US Letter). In the
case of the above example you would use:
a4ps2pdf myfile.ps |
The output PDF will have the same name as the input file but with the extension ".pdf".
Use the "Back" button of your browser to return to the previous page.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.
Further info on
file and
related to
legacy
Fastest
FTP
on the planet
Go FTP FREE
Program