Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an application that generates pdf files using ghostscript (current gs version 9.04). The pdf files it generates are placed up and to the left about 1/4 inch each, outside of the printable page. I can't change the application.

The intent is that these pdf files will generally be sent to a printer, and when I do try to print them I lose about 1/4 inch from the left and top as the whole document is shifted in that direction. The entire document is visible when viewed onscreen in acrobat reader, however the left and top margins seen on screen are minimal, while the right edge and bottom edge appear to each have roughly 1/2 inch margin.

I can work around this by telling Acrobat Reader to scale the document to fit the page when I print, but that adds a step for others who will be using the system, shrinks the text, and makes the document look off-center. Is there anything I can set in ghostscript to correct this at that level, to make the document render correctly in the first place?

share|improve this question
Is this print distributor? – Not Kyle stop stalking me Dec 13 '11 at 21:37
@kyle Updated the question. See the 2nd paragraph for clarification – Joel Coehoorn Dec 13 '11 at 21:44
@JoelCoehoorn: Would you please provide some additional details about your pages {Media,Crop,Trim}Box settings? (See also my start-of-an-answer below.) – Kurt Pfeifle Jan 2 '12 at 10:30

Before I write up a more elaborate answer, you should provide a few more details about one of your sample PDF files. Use one with at least 3 pages. Then run this command:

 pdfinfo -f 1 -l 3 -box /path/to/pdf.pdf

This command will enumerate the page sizes ('MediaBox') as well as the dimensions for the viewable/printable parts ('CropBox') of each PDF page.

pdfinfo is part of the XPDF commandline utilities, available for free, for all major OS platforms (certainly for Windows and Linux).


Since you have Ghostscript already, you can also try this command:

gswin32c.exe ^
  -q ^
  -sFile=c:/path/to/your.pdf ^
  -dDumpMediaSizes ^

(On Linux, use gs instead of gswin32c.exe, and adapt the paths as needed.) Should your installation miss the file, try to download it from;a=tree;f=gs/toolbin;hb=HEAD

share|improve this answer
+1 for last sentence, (and all of toolbin) is missing from Windows gs9.02. – matt wilkie Dec 19 '12 at 18:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .