mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
PDF: fix comment
This commit is contained in:
@@ -19,8 +19,8 @@ const render = async (page, doc, zoom) => {
|
|||||||
doc.documentElement.style.setProperty('--scale-factor', scale)
|
doc.documentElement.style.setProperty('--scale-factor', scale)
|
||||||
const viewport = page.getViewport({ scale })
|
const viewport = page.getViewport({ scale })
|
||||||
|
|
||||||
// for some reason must use `document`'s canvas
|
// the canvas must be in the `PDFDocument`'s `ownerDocument`
|
||||||
// using a canvas in `doc` results in tofu
|
// (`globalThis.document` by default); that's where the fonts are loaded
|
||||||
const canvas = document.createElement('canvas')
|
const canvas = document.createElement('canvas')
|
||||||
canvas.height = viewport.height
|
canvas.height = viewport.height
|
||||||
canvas.width = viewport.width
|
canvas.width = viewport.width
|
||||||
|
|||||||
Reference in New Issue
Block a user