We had a few document templates and refactored the flows to build (x)html instead and convert that to pdf using a rather small java action (using the flying saucer library). If you know your way around html and CSS you can create nice and pixel perfect documents this way including pictures, different fonts, headers, footers, logical page breaks etc.
There is of course the Document Generation module by Mendix, but that has its downsides, starting with limitations concerning file size and number of documents per day. We create thousands of documents some days on a regular basis, so for us this was not an option.