const orientation = reportSize.width > reportSize.height ? "l" : "p";
const pdf = new jsPDF(orientation, "px", pdfFormat);
const pdfPageWidth = pdf.internal.pageSize.getWidth();
const padding = 10;
await pdf.html(printContent, {
callback: (doc) => doc.save(fileName),
x: padding,
y: padding,
width: pdfPageWidth,
windowWidth: reportSize.width,
html2canvas: {
scale: 1,
logging: false,
},
});
This is my code above, the first image shows the preview, and the second image shows the result after download. When the image is placed above the border as in the first image, that content does not appear in the downloaded PDF, as in the second image. I think the issue is related to padding or margin.
How can I fix this?