Ask Different is a question and answer site for power users of Apple hardware and software. 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'm trying to create a PDF document from an HTML document.

Of course it's easy to do this using the built-in PDF Printer, however, this does not retain hyperlinks.

I've tried wkhtmltopdf which looked very promising, but it crashes on every attempt.

Is anyone aware of any other options for generating a PDF document from an HTML document while retaining URL links?

share|improve this question
I can't confirm if this works, but something you might consider is converting from HTML to LaTeX. Then convert from LaTeX to PDF since LaTeX is a common way to create hyperlinks in a PDF. – styfle May 31 '11 at 1:32
up vote 5 down vote accepted

Found an answer over on wkpdf

Free, works perfectly. All hyperlinks retained.

share|improve this answer
Also good is wkhtmltopdf. Both of these tools are available via Homebrew on Mac OS. – Ian Mar 6 '13 at 18:42
no longer installs; author seems to have purposefully disabled installation in anticipation of future incompatibility; WTF? – cnst Mar 24 '15 at 0:52
There is an incompatibility with Yosemite from what I gather. – Ian Mar 24 '15 at 1:31

You can do this using Adobe Acrobat.

In Acrobat, go to File-> Create PDF-> From File. Select your HTML doc, let it do a bit of work, and then use File-> Save As to save it.

All hyperlinks will be intact.

share|improve this answer
Thanks for your answer. Is there a non-$200 option? – Ian May 31 '11 at 14:53
@Ian I'm sure there is, but I haven't seen it yet. – Nathan Greenstein May 31 '11 at 18:56
After looking for two days, I've yet to find one, for Mac or Windows, that retains hyperlinks that have anchor text. Very strange. – Ian May 31 '11 at 19:11

The built-in Safari browser seems to do this when you do File -> Print -> PDF -> Save as PDF, it works for me as of Version 6 of Mac Safari.

share|improve this answer
True, and this has worked in the same nice way in older versions too. OmniWeb did so too, but I have not used that for years, so things might have changed. – Arjan Aug 4 '12 at 10:54
Does it retain the hyperlinks for you? – Ian Aug 6 '12 at 21:34
Is there a way to automate this, like what wkpdf used to offer? – cnst Mar 24 '15 at 0:52

I have tried dompdf in the past and has worked very well for me. dompdf PHP

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.