How to set margins in a PDF export?

How to set margins in a PDF export?

mlongmlong Posts: 10Questions: 5Answers: 0
edited May 2016 in Free community support

When exporting to a PDF how do I set the margins?

Answers

  • allanallan Posts: 61,920Questions: 1Answers: 10,153 Site admin

    This is really a pdfmake question rather than one for DataTables. If you go to the pdfmake "playground" and click the "margins" link, you'll see their documentation about how to set the margins. There isn't much documentation, but that's what they provide.

    Use the customize method of the pdfHtml5 button type to customise the PDF.

    Allan

  • mlongmlong Posts: 10Questions: 5Answers: 0

    Thanks for getting back to me Allan - amazing bit of software you've got here.

    I wasn't aware that you'd answered so I did a lot of digging on my own and sure enough the answer was super simple just not easy to find. I think I found it buried in an example posted in this forum for something completely different.

    customize : function(doc) {doc.pageMargins = [10, 10, 10,10 ]; },

  • allanallan Posts: 61,920Questions: 1Answers: 10,153 Site admin

    That's superb - thanks so much for posting back with your solution. I'm sure others will find it useful!

    Allan

This discussion has been closed.