Open
Description
This is the code I am using
const generatePDF = async () => {
const element = contentRef.current
const canvas = await html2canvas(element, {
useCORS: true, // For external images
allowTaint: true,
scrollX: 0,
scrollY: 0,
})
const imgData = canvas.toDataURL('image/png')
const pdf = new jsPDF('p', 'mm', 'a4')
const imgWidth = 210 // A4 width in mm
const pageHeight = 295 // A4 height in mm
const imgHeight = (canvas.height * imgWidth) / canvas.width
let position = 0
pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight)
pdf.save('my-react-app.pdf')
}
The issue appeared after updating to Google Chrome 138
Metadata
Metadata
Assignees
Labels
No labels