GhostScript and Margins
I had a postscript document that simply did not want to come out correctly, the offsets were such that the page content was going well off the visible area.
the following vile hack is one solution:
cat <<EOF>offsetfix.ps %!PS-Adobe-2.0 << /PageOffset [ 16 -52] /Margins [0 0] /.HWMargins [0 0 0 0] >> setpagedevice EOF gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite \ -dOptimize=true \ -sOutputFile=output.pdf \ offsetfix.ps input.ps
granted, one could cat the snippit in offsetfix.ps with the original document, but as I’m not sure what else may be using it, I’d rather not.
this also has the advantage of being a bit more portable, albeit rather ugly when compared to the original:
ps2pdf input.ps output.pdf
Leave a comment