Closed farling42 closed 1 year ago
In pdfjs, app.js creates a single PDFLinkService object, and passes ignoreDestinationZoom from AppOptions.get("ignoreDestinationZoom")
But the problem is setting the value in AppOptions between AppOptions being created and the PDFLinkService being created.
We need to call AppOptions.set("ignoreDestinationZoom", true)
very early.
Some notes: see
document.addEventListener("webviewerloaded", function() {
PDFViewerApplication.initializedPromise.then(function() {
// The viewer has now been initialized.
})
});
from https://github.com/mozilla/pdf.js/wiki/Third-party-viewer-usage
Note that updatePdfView
could probably just call linkService.setHash(anchor)
Note that AppOptions
might be available at event.target.contentWindow.PDFViewerApplicationOptions
when processing the 'webviewerloaded' event
Implemented in 0.40.0
There is a pdfjs flag ignoreDestinationZoom which will ignore the zoom level in named destinations.
We should set this flag to true if an explicit zoom has been set in the module settings.
Unfortunately this flag needs to be set BEFORE the PdfLinkService is created, but AFTER the viewer.html has got far enough to create the preferences object.