From 4cd2ca2eb3b863e0ea6eb331a1619c08453dbaee Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Sat, 28 Sep 2024 19:31:32 +0800 Subject: [PATCH] PDF: fix comment --- pdf.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdf.js b/pdf.js index a686ab4..fc224f9 100644 --- a/pdf.js +++ b/pdf.js @@ -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