PDF: rerender when scale changes

The fixed-layout renderer now accepts an object for the return value of
`load()` (on the `book.sections` items). If it's an object, the `src`
is the URL of the section, and `onZoom`, if present, will be called
when the viewport is zoomed. With this you can scale the page yourself
rather than relying on the renderer's own scaling with CSS transform.

Also upgraded to PDF.js 4.6.82. And now internal links are broken...
Don't know how to fix that yet.
This commit is contained in:
John Factotum
2024-09-28 12:12:59 +08:00
parent ba403301a2
commit 1e952102bd
10 changed files with 42643 additions and 42703 deletions
+1
View File
@@ -175,6 +175,7 @@ export class View extends HTMLElement {
close() {
this.renderer?.destroy()
this.renderer?.remove()
this.book?.destroy?.()
this.#sectionProgress = null
this.#tocProgress = null
this.#pageProgress = null