MacOS – Add Margins to PDF generated via “Printing” in Safari

adobe-acrobatmacospdf

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!

Best Answer

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