Search

Ubuntu Amd64 - Convert HTML web pages to PDF with Firefox

Contents[Hide]

Ubuntu

ubuntu-firefox-web2pdfFirefox provides a very nice add-on Print pages to Pdf to convert Web pages straight to PDF files.

This add-on is quite special as it is not using any online service for the conversion job.

It is using wkhtmltopdf library which convert html to pdf using the webkit rendering engine.

This Firefox add-on works Out Of The Box under any Ubuntu i386 distribution.

It was broken under Ubuntu Amd64 for version 0.1.8.5, but has been corrected on version 0.1.9.0.

This article explains how to solve this issue and to get a fully working one click solution to convert any HTML web page to a PDF document on a Ubuntu 64 computer.

It has been tested under Ubuntu Amd64 12.04 LTS, with Firefox 20 and Print pages to Pdf 0.1.9.0.

1. Install the Add-on

First step is obviousy to install the Add-on from Print pages to Pdf.

If you want a real One click solution, make sure to :

  • add the PDF button to your Firefox toolbar
  • in Print pages to PDF options, select Print only active tab
  • in Print pages to PDF options, uncheck Open PDF

2. Update WkHTMLtoPDF library to Amd64

This problem has been solved with version 0.1.9.0.
If you install latest version you won't need to go thru this section.

The Print pages to Pdf Firefox add-on is using an 3rd party OpenSource binary program called wkhtmltopdf.

By default, add-on is provided with a i386 architecture compatible library. This library doesn't run properly on a Amd64 computer, but there is a 64-bit linux version available.

You can download the wkhtmltopdf amd64 library from https://code.google.com/p/wkhtmltopdf/downloads/list.

At the time of this article, latest Amd64 compatible version is wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2.

When you open the archive file, you'll get one single library file named wkhtmltopdf-amd64.

You should then copy this file into your firefox profile directory under ./extensions/This email address is being protected from spambots. You need JavaScript enabled to view it./libraries by renaming it to wkhtmltopdf-i386. It will replace the original library.

Here is what to do from a console prompt :

# cd $HOME/.mozilla/firefox/*.default/extensions/This email address is being protected from spambots. You need JavaScript enabled to view it./libraries
# wget -O wkhtmltopdf.tar.bz2 https://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2
# tar -xvjf wkhtmltopdf.tar.bz2
# mv wkhtmltopdf-i386 wkhtmltopdf-i386.org
# mv wkhtmltopdf-amd64 wkhtmltopdf-i386
# chmod +x wkhtmltopdf-i386

The new Amd64 library has now replaced the i386 one.

You can now restart Firefox.

Your Print pages to Pdf Firefox add-on should now be fully operational.

Hope it helps.

 

Signature Technoblog

This article is published "as is", without any warranty that it will work for your specific need.
If you think this article needs some complement, or simply if you think it saved you lots of time & trouble,
just let me know at This email address is being protected from spambots. You need JavaScript enabled to view it.. Cheers !

icon linux icon debian icon apache icon mysql icon php icon piwik icon googleplus