Closed eKoopmans closed 1 week ago
It's supposed to be possible to use a canvas as a direct source, with either of:
html2pdf().from(canvas).save()
html2pdf().set({ canvas: canvas }).save()
But there were two errors preventing this from working:
getType
toLowerCase()
.from()
pageSize
toPdf
This PR should solve the issue - added the all-tags_canvas.pdf snapshot test to verify the fix.
all-tags_canvas.pdf
Closes #699
It's supposed to be possible to use a canvas as a direct source, with either of:
html2pdf().from(canvas).save()
etc.html2pdf().set({ canvas: canvas }).save()
etc.But there were two errors preventing this from working:
getType
when usingtoLowerCase()
, meaning the.from()
approach didn't workpageSize
initialization intoPdf
, meaning both approaches didn't workThis PR should solve the issue - added the
all-tags_canvas.pdf
snapshot test to verify the fix.Closes #699