Skip to content

Commit

Permalink
PDF: fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfactotum committed Sep 28, 2024
1 parent 3409674 commit 4cd2ca2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4cd2ca2

Please sign in to comment.