XPages: Creating PDF files from an XPage or HTML with no coding or installation of software


It is often a wish from users to be able to get a PDF file of what is on an XPage.

Normally the user will install software so the user can print to a PDF file.


There are free ones which often contains malware or commercial ones which could be quit expensive.
Other options are hand coding the PDF file with iText or PDFBox etc. which can be a large task.

So lately I have been testing the open source solution wkhtmltopdf, which I have been looking at for some time.
I have been testing it by making PDFs from different web sites and there are some issues with fonts kerning, iframes not loading correctly on etc.
But if you are in control of the HTML you can work around these minor issues.

There is an external C API for creating the PDF file, which I am calling from Java.
So basically all you need is a URL and a name of the PDF file to be created.

An example:

Jesse Gallagher's great article today "Setting up nginx in Front of a Domino Server"
would give this PDF file:
Setting up nginx in Front of a Domino Server.pdfSetting up nginx in Front of a Domino Server.pdf

You might need to resize you browsers width to get the same result

You can create images from HTML as well


Posted on 09/19/2014 12:20:55 PM CEDT