Hi Juan,
i had exactly the same problem with a customer last month.
The normal PDF Viewer would load the PDFs but PDFjs was not loading anything. I had the same Error-msg in the dev-console.
It seemed that something blocked .mjs files which PDFjs uses.
Servoy: 2024.9.1.4003
Tomcat 9
Servoy PDF Viewer: 2024.3.1
I fixed it like this:
In my Tomcat web.xml i added a mime-mapping block:
- Code: Select all
<mime-mapping>
<extension>mjs</extension>
<mime-type>application/javascript</mime-type>
</mime-mapping>
Restarted the Tomcat and it worked.
For some users it was still broken (they had a older chrome and firefox installed)
For this i opened the Developer-Console in the browser and under "Network" i enabled "deactivate Cache" -> reloaded the page and it worked.
After that you can disable "deactivate cache" again.
cache_problem.png
Hope it helps
P.S
oh and im loading the pdf via elements.pdfjs.documentURL = PDF_URL and not via dataprovider
- Code: Select all
var remoteJSFile = plugins.file.convertToRemoteJSFile(scopes.files.USER_TEMP_PATH_URL + 'invoice_' + _invoice_nr + '.pdf')
var remoteURL = plugins.file.getUrlForRemoteFile(remoteJSFile)
elements.pdfjs.documentURL = remoteURL
-Vik
You do not have the required permissions to view the files attached to this post.