Unfortunately, the majority of our documents are in A4 format, while many of our collaborators must use US Letter printers. Here are some ways to translate files from one format to the other:
psresize -PA4 -pletter a4file.ps letterfile.psIf not, then ...
psnup -pletter -Pa4 a4file.ps letterfile.psThis scales the A4 text down by 0.94, and applies a small horizontal shift of 7 points. If psnup fails for you, the same transformation can be accomplished using pstops:
pstops '0.94@1(7,0)' a4file.ps letterfile.psIf that also fails, you can use the following simple perl script: a4toletter. You use it like this:
a4toletter a4file.ps letterfile.ps
pstops '0@1(0,-25)' a4file.ps letterfile.psor with a perl script: a4toletter-shift. Once more, usage looks like this:
a4toletter-shift a4file.ps letterfile.ps
Postscript files which include figures actually preserve the source of the original eps files intact. You can easily extract the figures ... they are framed by two distinctive lines in the ps file:
%%BeginDocument ... %%EndDocumentYou can extract the eps files by hand in a text editor. Note, however, that the bounding box for the eps figure is lost. (Well, not exactly, but it's a bit complicated to pull it out, and I haven't verified a robust method yet). The easiest thing to do is to simply run ps2epsi on the code you extracted ... it will make the bounding box for you, and insert the usual eps header lines.
Here is a perl script which does all this automatically for you: extract-eps. Basically, you type
extract-eps file.psand all embedded eps files will be extracted (using their original filenames). Type
extract-eps -hto learn about a few command line options that are available.
If often happens that you have a lovely colour figure that you would like to render in black-and-white ... for example, a plot that you showed at a talk, but must now include in a printed proceeding. If you don't have a B&W version of the plot at hand, you can convert your colour file. The two simplest choices are:
Here is a perl script which performs either of these manipulations: bw_convert. The usage syntax is
bw_convert [-b] colour-file.ps bw-file.psThe -b option engages procedure #2 above -- convert all colours and greys to black. Otherwise, procedure #1 is used.
Postscript is a programming language, just like FORTRAN, C, or PERL. Postscript files are in ASCII text, just like any other source code, and so can be readily hacked ... if you know the language. :-) In fact, it is a rather nice language, extremely similar to that of an RPN calculator -- if you have ever used such a calculator, the syntax of postscript will be perfectly intuitive to you. Here are 4 links that can take you all the way from Acolyte to Wizard: