PDF.js Express Version
“@pdftron/pdfjs-express”: “^7.3.9”,
Detailed description of issue
I am receiving the error message TypeError: Cannot read properties of undefined (reading ‘Mode’) when trying to set the following const for docViewer.textSearchInit
const { docViewer, Annotations, CoreControls } = instance;
Additionally, the code snippet above is from your samples.
Expected behaviour
I expect that the properties are found.
Does your issue happen with every document, or just one?
Every document
Link to document
I cannot because it contains sensitive information and I don’t think it’s relevant Code snippet
const { docViewer, Annotations, CoreControls } = instance;
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here
You can access the search modes with the latest version by doing:
instance.Core.Search.Mode.PAGE_STOP
Which sample has this code snippet?
Let me know if this works for you
Best regards,
Tyler Gordon
Web Development Support Engineer
PDFTron
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here
Thank you for sending this, it looks like this guide is for version 8.0+ with the new namespace changes.
Best regards,
Tyler Gordon
Web Development Support Engineer
PDFTron
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here
My apologies, completely forgot to switch the version.
I wasnt able to get the error to occur with that whole snippet. Can you try with the latest build of v7.3.9?
Performing npm install @pdftron/pdfjs-express@7.3.9 should get the latest build.
Best regards,
Tyler Gordon
Web Development Support Engineer
PDFTron
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here