Setting the output page size with ps2pdf
Ghostscript's ps2pdf utility converts Postscript format files into Adobe PDF. One drawback with this utility is that, by default, it always outputs in Ghostscript's default page size, regardless of the postscript document's page layout. This is probably sensible if the document is destined for printing, but at the moment PDF is also the best cross-platform way to express large spaces of graphics (in this case directed-tree graphs).
I've managed to get around this - mostly - as follows:
I've managed to get around this - mostly - as follows:
- Use ImageMagick's identify to get the Postscript document dimensions:
$ identify test.ps
test.ps PS 609x1528 609x1528+0+0 PseudoClass 256c 909kb 0.020u 0:01 - Execute ps2pdf with the -dDEVICEWIDTHPOINTS and -dDEVICEHEIGHTPOINTS arguments
$ ps2pdf -dDEVICEWIDTHPOINTS=679 -dDEVICEHEIGHTPOINTS=1598 test.ps test.pdf