This filter allows you to manipulate the raw PDF template HTML before it’s sent to mPDF for rendering. This is a quick and dirty way to modify the PDF HTML dynamically. If you are instead looking to modify a field’s mark-up there are better filters for the job.

If you do use this filter we recommend making your changes using a DOM parser. Gravity PDF includes the QueryPath library, which is specifically designed to make it simple to manipulate HTML.

You might also like to use this filter to insert new mark-up between certain fields. This snippet inserts a <hr /> tag every three rows – but you could change that to a page break or any other HTML tag: