im currently using html-pdf which takes my table data and turns it into an pdf.
My problem is that the table content is overlapping the required A4
papersize in such way that there is 2 columns totally missing in the pdf, when ever i change the
format
to A3
it fits and works.
I need it for A4
to fit. Any ideas ?
const dlPdfResult = (result) => {
return new Promise(function (resolve, reject) {
optionsType = {
format: 'A4',
orientation: 'landscape',
paginationOffset: 0,
header: {
'height': '10mm',
'contents': `<div style=' font-family: sans-serif, Arial, Helvetica; font-size: 11px; text-align: left; width: 842px; overflow: hidden;'><div style='width: 10%; float:left;'></div><div style='width: 40%; float:left;padding: 0px 0px 0px 60px;'>Port2Port exports</div><div style='width: 40%; float:left; text-align: right;'>Logo</div><div style='width: 10%; float:left;'></div>`
},
footer: {
'height': '10mm',
'contents': {
first: '1',
2: '2',
default: '<span style="color: #444;">{{page}}</span>/<span>{{pages}}</span>',
last: 'Last Page'
},
type: 'pdf', // allowed file types: png, jpeg, pdf
quality: '75'
}
}
tableForm = tableify(result)
pdf.create(tableForm, optionsType).toFile('./test.pdf', function (err, res) {
if (err) return reject(err)
resolve(res)
})
})
}