WebViewer Version: 8.9.0
Do you have an issue with a specific file(s)? no
Can you reproduce using one of our samples or online demos? yes
Are you using the WebViewer server? no
Does the issue only happen on certain browsers? no
Is your issue related to a front-end framework? no
Is your issue related to annotations? no
Please give a brief summary of your issue: need to know what functions handle password modal for protected files but documentation is not clear about it
(Think of this as an email subject)
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
here is the situation, i have a page that uses pdftron to open a file and then sign it using some custom drag and drop elements, this page has a loading animation that hides pdftron iframe while document is loading and once is finished it hides the loader and shows pdftron iframe.
now this works for unprotected documents just fine, but it doesn’t work for protected documents because the event that hides the loader is triggered after document is rendered, and if document is protected then the event is not triggered putting the user in an endless loading animation.
So i though of changing the moment at which the loader is hidden or detect if modal is open but i couldn’t find password modal related events or functions, also i noticed that there are only 3 attempts allowed for entering the password otherwise the document is not loaded leaving the user in an empty webviewer, so i need to know what is the function that gets called when user fails the 3 attempts in order to redirect it to homepage and if there is an event tells me if password modal is triggered because i need to put that modal on top of everything else so the user puts the password and loader is hidden when document is fully loaded and not during the process.
last but not least, i am loading my document in this way
WebViewer({
path: '/js/WebViewerNew/lib',
initialDoc: this.initialDoc,
extension: 'pdf',
css: '/css/pdftron.css?' + today,
}, document.getElementById('webviewer'))
.then((instance) => {
and this is the example in the docs
WebViewer(...)
.then(instance => {
instance.UI.loadDocument('https://myserver.com/myfile.pdf', {
password: 'asdf'
});
});
so since i don’t load the document in the same way the password option doesn’t work for me if I put it in the options or maybe it does but don’t know the right way to do it, i can always change it to use the docs example but i wanted to know if is possible to do it while using the first code or not since i have a function that let’s me get the password for pdf files so i can pass it as a parameter to other places
any help will be appreciated, thank you and have a good day
Please provide a link to a minimal sample where the issue is reproducible: