Closed zharchimage closed 5 years ago
Hi,
We dispatch the custom documentLoaded
event to the viewerElement
because we think this event is one of the most used events in WebViewer. However, this is not necessary since this event is the same as the one of docViewer and you could achieve the same thing by the following code:
localInstance = await WebViewer({
path: '/WebViewer/lib',
//enableFilePicker: false,
//enableAnnotations: false,
//enableMeasurement: false,
//enableRedaction: false,
//disabledElements: ['header', 'pageNavOverlay', 'viewControlsButton', 'viewControlsOverlay', 'annotationPopup', 'zoomOverlay', 'textPopup', 'toolStylePopup', 'contextMenuPopup', 'cursorOverlay'],
initialDoc: '/api/pdf',
//initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/webviewer-demo.pdf',
}, viewerElement);
localInstance.docViewer.on('documentLoaded', function() {})
Because the pageComplete
event isn't that often used as documentLoaded
, we didn't provide the same event layer for it. To listen to the pageComplete
event you can use the following code:
localInstance.docViewer.on('pageComplete', function() {})
Events like pageChanged
, layoutModeChanged
, zoomChanged
etc are there for the purpose of legacy UI backwards compatibilities. You should be able to listen these events directly on docViewer
. More available events can be found here: https://www.pdftron.com/api/web/CoreControls.DocumentViewer.html#toc86__anchor
Let me know if this helps and if you have any other questions!
Thanks @ZhijieZhang will check tomorrow!
I'm receiving loads of warning that might when loading a PDF, even if it loads properly:
Any idea why this is happening?
Thanks for bringing this to our attention.
Looking at the call stacks it seems that something goes wrong when WebViewer tries to deserialize annotations. However it's hard to figure out the issue without seeing the document you are trying to load.
One option for you to send over the document is through a support form. You can fill out the form here https://www.pdftron.com/form/request.
Once we could reproduce the issue on our end, we will give you an update and the rest of the conversation will be continued in that support ticket.
Let me know if you have any other questions. Thanks!
I will close this issue for now because from the call stacks, the errors are from the CoreControls.js
, not UI.
@potudopotudo If you'd like this issue to be sorted out, please fill out the form and kindly send the document so that we can try to reproduce the issue on our end and investigate further. Thanks!
I'm building a Typescript wrapper, and I have this code: ` var localInstance: any;
THe PDF Is loading properly and documentLoaded and Pagechanged get called but events like
pageComplete
andfinishedRendering
never get called.