If you don’t want to write your own program code (as Nikolaus suggested), but use a Ghostscript commandline instead, you need to know 3 things:
- PostScript has a
setpagedevice
operator that takes aPageOffset
parameter; - Ghostscript will process snippets of PostScript code if you pass them with
-c ...
on the commandline; - Ghostscript can evaluate and apply (some) PostScript code even for direct PDF=>PDF conversions.
Now try this commandline to shift all page images by 1 inch (==72pt) to the left:
gswin32c.exe ^
-sDEVICE=pdfwrite ^
-o c:/path/to/output/pdf-shifted-by-1-inch-to-left.pdf ^
-dPDFSETTINGS=/prepress ^
-c "<</PageOffset [-72 0]>> setpagedevice" ^
-f c:/path/to/input/pdf-original.pdf
(The -dPDFSETTINGS=/prepress
I put in in order to not loose any picture quality of the scans…)