Feature Requests
Share ideas, discuss and vote on requests from other users in community
This object is in archive! 

Create a hook point for the customisation of $pdf object

WHMCS John shared this idea 3 years ago
Under Consideration

One can successfully use setFooterMargin() in the invoicepdf.tpl so as to set a fixed-height footer. However, I wish to change the point at which the page break occurrs using SetAutoPageBreak .

Calling SetAutoPageBreak in invoicepdf.tpl happens after the page was created (since invoicepdf.tpl is a page template) - and it is ineffective at that stage. Consecutively, even though we can have a footer margin set and the footer content raised as a result, the page content may continue being rendered on top due to the SetAutoPageBreak being ineffective.

WHMCS developers recommended creating a hook to customize properties of $pdf object, and have that hook called anywhere between Invoice::pdfCreate() and Invoice::pdfAddPage() method, passing it $this->pdf instance and allowing it to customize said object’s properties before AddPage() is called.