Search feature not finding results after page load

PDF.js Express Version
7.3.1

Detailed description of issue
When I load a document like the one included, and I search for the term at-home administration it doesn’t appear to find the results.

However if I open the pages panel and scroll all the way to the last page, then hit search again it finds them.

Expected behaviour
The search feature should find the results like so:

Does your issue happen with every document, or just one?
I only tested this one.

Link to document

Code snippet
N/A

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi there!

Can you please share the code you’re using to search the document? And also the code you are using to load PDF.js Express. My suspicion is that there is a timing error and the document isn’t fully loaded before you search.

Thanks you,
Logan

Hey Logan, so I am just using the search field in the sidebar to do the search not running any commands to manually do it. Does the document work for you when you test it?

Here’s the code I am running to load it:
WebViewer({
path: ‘…/…/Content/pdfexpress’, // path to the PDF.js Express’lib’ folder on your server
licenseKey: ‘Insert commercial license key here after purchase’,
initialDoc: ‘/Content/FlowPaper/services/awsview.ashx?doc=’ + filePath + ‘&format=pdf&page={page}&aws=’ + awsName,
disableFlattenedAnnotations: true,
annotationUser: authorName,
disabledElements: [
‘toolbarGroup-Shapes’,
‘toolbarGroup-Insert’,
‘unpostedCommentIndicator’,
‘noteState’,
‘eraserToolButton’,
‘toolsOverlay’
]
})

Hey Andy,

I can reproduce your issue with that document. It is a pretty big document so my suspicion is that we’re not loading all of the pages while searching. I’ll look into it.

Thanks!
Logan

Hi Andy!

This was a tricky one but we found a fix. As a side effect, we were also able to make search about 50% faster on long documents! This fix will be pushed with the next release.

Thanks for reporting this bug,
Logan

Yes!!! Thanks for jumping on this, and glad it wasn’t only a bug I saw.
Looking forward to the fix.

Hi @andy

We just released 7.3.3 which fixes this issue. Sorry for the wait!

Thanks,
Logan

Thanks Logan! I’ll get started on testing it soon, thanks again for jumping on that!

1 Like