Which product are you using?
PDF.js Express Viewer
PDF.js Express Version
UI version -‘8.7.0’
Core version - ‘8.7.4’
webviewer.min.js - ‘8.7.4’
Detailed description of issue
I am implementing PDF JS Express Viewer on several pages using TS and Vue. All instances are working EXCEPT the page where I have one instance instantiated with Vue and one instantiated with TS. This is the only page where I need two viewers. The TS one loads appropriately and I see this in the call to /events - it loads the viewer and then the document.
For the Vue instance, in /events I see only one load event for the document (I’m not allowed to add another picture…but it looks the same, except the license key is blank and only the load document event is passed). I think this is causing my issue.
The viewer appears separately in the UI for both instances, and I double checked that my license key is being sent correctly in both cases.
I am sending the same licenseKey to both instances. It is removed in the request for the 2nd instance. I also tried removing the first instance entirely when the user moves to the tab where I need the 2nd instance. I got the same result. I also tried using two different licenseKeys. Same result.
Is there a way to force the 2nd viewer to send a load viewer event? It seems to me this is what is missing.
Expected behaviour
Both instances will pass in the licenseKey I provide to the request, and both instances will load documents.
Does your issue happen with every document, or just one?
Everyone
Link to document
N/A
Code snippet
This is the instance that is working. The other is similar
PDFJSExpress({
path: "/js/lib/pdfjs-express/public", // point to where the files you copied are served from
licenseKey: licenseKey.value,
}, document.getElementById("pdfPreview")).then((instance) => {
return instance;
});
when loading the document...
this.pdfViewerInstance.then(instance => instance.UI.loadDocument(this.chartPdfURL));