How to set margins in a PDF export?
How to set margins in a PDF export?
mlong
Posts: 10Questions: 5Answers: 0
When exporting to a PDF how do I set the margins?
This discussion has been closed.
Answers
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 thepdfHtml5
button type to customise the PDF.Allan
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 ]; },
That's superb - thanks so much for posting back with your solution. I'm sure others will find it useful!
Allan