PDF: fix comment

This commit is contained in:
John Factotum
2024-09-28 19:32:14 +08:00
parent 3409674e66
commit 4cd2ca2eb3
+2 -2
View File
@@ -19,8 +19,8 @@ const render = async (page, doc, zoom) => {
doc.documentElement.style.setProperty('--scale-factor', scale)
const viewport = page.getViewport({ scale })
// for some reason must use `document`'s canvas
// using a canvas in `doc` results in tofu
// the canvas must be in the `PDFDocument`'s `ownerDocument`
// (`globalThis.document` by default); that's where the fonts are loaded
const canvas = document.createElement('canvas')
canvas.height = viewport.height
canvas.width = viewport.width