Made a sad discovery today. I have Ubuntu 10.04 LTS. My client is in the ad business and she had a marketing competition task for me. She wanted me to visit websites of the competitors, and export the home pages as PDF. However, she wanted me to do so with embedded hyperlinks.
As it turns out, Firefox (and even the latest Chrome) on Ubuntu 10.04 LTS do not embed hyperlinks in PDF web page exports.
Sure, there are several Chrome and FF plugins that let you export as PDF, but what these do is connect to the URL remotely, generate the PDF remotely, and then force a download in your browser to download it from a remote location. That's not good for me, though, because some of these competitor pages require an initial login. That means that all I get back on the PDF printing from these FF or Chrome plugins is a login page.
Is there a way to get around this problem, to fix the broken PDF printer on Ubuntu 10.04?
The tool to use is called wkhtmltopdf, this tool is in the repositories but all compiled repository versions don't have the embeded link functionality due to the hackish changes to some qt libraries.
So install wkhtmltopdf from the repositories to get all the dependencies:
Then download the static version from here. Unpack the file to your desktop and then move to bin:
Now you can use the tool to generate pdf files with links:
For your websites with the login requirement, you need to log in via firefox and then export the cookie file using the Export Cookies firefox plugin. With a cookies.txt you can then run:
I know a lot of these needs to be done on the command line, but it's the best way to do it and you get a lot more control. wkhtmltopdf is quite a powerful tool.