Reputation: 1
**For dynamic data I am using creating HTML **
<div class="prv-blk" id="content-to-print">
<p style="page-break-inside: avoid;"><b>${el.pName || ''}:</b> ${el.pDescription ? el.pDescription + ',' : ''} ${el.ServicePhoneNumber ? el.ServicePhoneNumber + ',' : ''},
${el.addressLine1 ? el.addressLine1 + ',' : ''}, ${el.addressCity ? el.addressCity + ',' : ''},
${el.addressPostalCode ? el.addressPostalCode + ',' : ''}, Utah</p>
</div>
then converting into pdf
await pdf.html(tempContainer, {
callback: async(pdf) => {
// Add any footers or headers here if needed
await this.openPdf(pdf);
},
margin: [10, 10, 10, 10], // top, left, bottom, right margins
autoPaging: 'text', // Automatically add new pages if content overflows
x: 0,
y: 50,
// width: 100,
html2canvas: {
scale: 0.5 // Adjusts the resolution of the output
}
});
but for bold text its misplacing alingment enter image description here
I am expecting to bold text to remain its alingment place not break
Upvotes: 0
Views: 95