Hi Team,The JavaScript component PDF inApp preview to view PDF documents in a mobile app seems to have a JavaScript vulnerability.
Upon examining the component, I saw that it uses PDF.js and PDF_worker.js files to achieve the functionality to display the pdf files. These JavaScript files seem to be of older version. Is there a way to update these JavaScript files to the latest JavaScript version?
Thanks and Regards,
Vivek Gangwar
Download the latest PDF.js library
Go to the official Mozilla PDF.js repository: https://github.com/mozilla/pdf.js
Download the latest release (it will include both pdf.js and pdf.worker.js).
Replace outdated files in the component
In OutSystems Service Studio, open the PDF InApp Preview (O11) module.
Locate the Resources folder (where pdf.js and pdf.worker.js are stored).
Replace them with the latest versions you downloaded.
Make sure to set the resource properties:
Deploy Action → Deploy to Target Directory
Target Directory → keep consistent with the current setup.
Update References in JavaScript
If the component references a specific version path, update the links to point to the new file names.
Example:
pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdf.worker.js';
Test the Component
Re-publish the module.
Open your mobile app and check if the PDFs render correctly.
Verify in browser console / device logs for any compatibility warnings.
Hi Deepak, Thanks for your reply.
I tried to follow the steps provided but was not able to find the "Set resource properties".Instead, I imported the new pdf.js and pdf_worker.js in the component and updated the references(Please see attached word file for more details).
After doing the changes the component seems to stop working and I am unable to view the PDF. (Attached the error screenshot in word file).Please let me know if I need to do something else.Thanks and Regards,Vivek
Hi Deepak,
Please let me know in case you need more information about anything specific.Thanks and Regards,Vivek