Wtx ~ Wt Extension Library
WtxLib
|
This page discusses the steps necessary to take a document (aka; web-page) from within Wt and convert it to a well-formatted, well-behaved PDF file. The value of these techniques is high since Wt makes generating and manipulating HTML pages quite easy, and when combined with some good HTML layout techniques, it becomes possible to produce web-pages that look good in a browser as well as a PDF file.
Disclaimer: these techniques are my own, after much trial and error. These techniques are in no way to be confused with the "right way". Use what you can, your mileage may vary.
Additional Disclaimer: Note that Wt includes some objects for manipulating PDF files: https://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WPdfImage.html I have not taken the time to review these objects or attempt to employ them. When I am able to I will and then produce a complimentary set of documents to match.
Since we're talking about using wkhtmltopdf.org to generate a PDF document from a HTML file, let's talk about specific use cases. It's one thing to take any simple webpage or website and run it through wkhtmltopdf and get a PDF file of the same. But, when it comes to generating things like "specifically formatted" webpage, similar to those that might represent an 'invoice' or 'report' then some tips and tricks and techniques are in order. There are plenty of tutorials available on the web for simple basic use cases. This document is specific to a "formatted result" outcome.
Calling wkhtmltopdf