

pdfmake seems to be well documented and very easy to use, but since it was a beta version, I decided for jsPDF. When I started my project, some months ago, I searched for a JS library, and finally I found two candidates: jsPDF and pdfmake.

Unfortunately, the library seems to be abandoned (its last version dates back to 2011) (Update: actually, the latest version appears to be from December 2015), but thanks to some JavaScript libraries, we now have the ability to build PDF files directly in the clients (thus making their generation faster). In the past I’ve often used FPDF, a PHP tool that can easily give you such controls and that can be easily expanded with many plugins.

(I’ve tried several tools of that type, but none of them has fully satisfied me.) My goal is to have complete control over the positioning and size of elements, page breaks and so on. I’m not talking here about the simple conversion of HTML to PDF. Therefore, when I need to build something that must be printed, I always try to avoid CSS, and the simplest solution is to use PDF. Anyone who has dealt with CSS printing rules knows how difficult it is to achieve a decent level of cross-browser compatibility (take a look, for example, at the Page-break support table at Can I Use).
