Can i add the custom message in the same row as the title in pdfhtml5 export
Can i add the custom message in the same row as the title in pdfhtml5 export
gabrielandre
Posts: 4Questions: 1Answers: 1
I have the title left aligned, now i want to add the message on the same row but right aligned:
extend: "pdfHtml5", className: "btn-sm", orientation: 'portrait', pageSize: 'LETTER', title: '@Localizer["MERCHANT REPORT"]', exportOptions: {
columns: [0, 1, 2, 3, 4]
},
message: 'Dashboard ',
customize: function (doc) {
doc.content[2].table.widths = ['40%', '15%', '20%', '15%', '10%'];
doc.defaultStyle.fontSize = 8;
doc['footer'] = (function (page, pages) {
return {
columns: [
'@Localizer["REPORT DATE:"]' + ' ' + moment().format('YYYY-MM-DD, HH:mm:ss') + '',
{
alignment: 'right',
text: [
{ text: page.toString(), italics: true },
' of ',
{ text: pages.toString(), italics: true }
]
}],
margin: [10, 0]
}
});
}
},
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You've certainly got the right idea of using the
customize
method - but exactly how you do the layout aspect with the pdfmake API, I'm afraid you'd need to refer to the pdfmake documentation and support channels.Allan
Thanks for the advice, i managed to fix the alignment playing with the margins in the buttons.html5.js
g.message && c.content.unshift({
text: g.message,
style: "message",
margin: [0, 0, 0, 25]//margin adjusted to align with title