Reputation: 523
I want to crop all pages by 1 inch, as with Adobe Acrobat:
but I can't find such switch in ghostscript reference.
Is there an easy way to crop pages relatively by 1 inch without knowing page dimension upfront?
Upvotes: 1
Views: 127
Reputation: 31207
Short answer; no.
Note that the dialog you have posted doesn't actually crop pages per se, it sets the CropBox of the PDF file. Ghostscript's pdfwrite device does NOT 'edit' PDF files, so you cannot simply alter the CropBox of the original PDF file using Ghostcript.
Long answer; What you can do is create a brand new PDF file which should look the same as the original, and you can create that PDF file with a different CropBox. Now the PDF interpreter must know the MediaBox (and other boxes) from the PDF file, because, obviously, it needs to know how big the original is. Which means that you can write PostScript to alter that.
But doing this isn't simple, especially not if you expect each page in the file to have a different MediaSize, and hence a different CropBox.
Upvotes: 3