Reduce Page Margin of PDF Template in Fusion Invoice

While polishing my newly created Fusion Invoice Template, I wanted to decrease the page margins by half to accommodate more of my terms in a single page. After figuring out the library (MPDF) being used for generating PDFs from HTML, I found the helper responsible for creating the actual PDFs from within the application.

The helper file can be located at /application/helpers/mpdf_helper.php

In there, at about line # 24, comment out the following line of code:
$mpdf = new mPDF();

And add the following line of code above or below the commented line:
$mpdf=new mPDF('','', 0, '', 15, 15, 16, 16, 9, 9, 'P');

Which will set margin to its default values:

margin_left 15
margin_right 15
margin_top 16
margin_bottom 16
margin_header 9
margin_footer 9

All values should be specified as LENGTH in millimetres.
If you are creating a DOUBLE-SIDED document, the margin values specified will be used for ODD pages; left and right margins will be mirrored for EVEN pages.

Resource: http://mpdf1.com/manual/index.php?tid=184

One Reply to “Reduce Page Margin of PDF Template in Fusion Invoice”

  1. Thanks a million!
    I was looking to reduce the size/quality of my invoice PDF’s and that resource link will point me in the right direction 😉

Leave a Reply

Your email address will not be published. Required fields are marked *