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've built a web page that I'm turning into a PDF using the "Save as PDF" function built into the print functionality in Safari on OS X. Trouble is, when I generate a PDF in this manner, it doesn't offer me the ability to change the margins of the resulting document; in other words, the text at the top and bottom of each page is uncomfortably close to the edge of each "page" and I need to increase those margins.

Things I've tried:

  • Safari provides me with the ability to control the margins (and create custom page types with custom margins), but these seem to only be applied when the page is physically printed onto paper.
  • It appears that Firefox provides this capability, but it doesn't support the fonts, etc. that I have access to in Safari (proprietary fonts that aren't available in the libraries of any of the web font services like Typekit).
  • There are several CSS3 directives that address this issue, but none of the modern browsers support them yet (that I'm aware of, anyway).

I'm assuming there's an application I can use to insert into the process that will allow me to do what I want (Adobe Acrobat X Pro appears to be a candidate, but I'd rather not pay $200 to find out until somebody can tell me certainly that it can do this).

I also realize that I could accomplish the whole PDF generation business in code, but that's a last resort as it will require rewriting a good chunk of the web app that's generating this PDF.

Does anybody have a recommendation of an app or service I can grab that will get me past this?

I appreciate any help you could provide - thanks!

share|improve this question
What CSS have you tried? – newtron May 27 '11 at 1:40

Try wkpdf. Margins are configurable on the command line, and it does other neat stuff like converting HTML links to PDF links automatically.

share|improve this answer

How to add a 10 bp (basis points) margin using (CTAN):

perl --margins 10 input.pdf output.pdf

From the man page included in Ubuntu's version of pdfcrop:

--margins "<left> <top> <right> <bottom>"

(0 0 0 0) add extra margins, unit is bp. If only one number is given, then it is used for all margins, in the case of two numbers they are also used for right and bottom.

share|improve this answer

You must log in to answer this question.

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