Problems with search

Hi !

My team and I are currently migrating our pdf viewer to this one. Right now we are testing with the free license, testing the different features. Everything is going well, except for one detail. When we try to do a search, it only finds a match and stays loading. If I try to do another search, it doesn’t search for anything anymore.

Any help ?

Hi there,

Thank you for contacting pdf.js express forums,

I tried searching for two words consecutively via the demo - PDF.js Viewer Demo | PDF.js Express and I was unable to reproduce the issue.

Could you please try the demo and see if you can reproduce the issue?
If it persists, could you please share a video and your PDF that showcases your issue?

Best regards,
Kevin Kim

Hi Kevin!

I have no issues with the search on the demo, but when I tried to integrate the pdf-viewer in our app the search doesn’t work (here upload a video example).

I follow the instructions and I have it with minimum configuration
I’m using vue 3.3.4 and vite 4.3.9

I don’t know if I miss something or what

image (468.5 KB)

Hi there,

Thanks for sharing the video, and I do not see anything wrong with your implementation.

Could you please try the vue sample project and see if there is any differences in the configuration:

Best regards,
Kevin Kim

Hi Kevin!

I tried the vue sample project you said. With the default pdf that comes with the project I have no issues, but in the same project, If I tried to load my PDF witch is large, I have the same behavior that in the video. I tried with my PDF for example on the svelte sample project and in this, it works perfectly, so it looks like a problem with the vue version

Bump here.
We are a little disappointed with this. The library in the demo looks impressive, and we were really interested in the annotation feature which is really what we wanted to add to our current viewer. Still, before going with the pro version, we wanted to test if we had everything we have in our viewer with your library, it was a bit of a nasty surprise that the search, which is crucial to our use case, doesn’t work. Is there no hint or something that can be done to improve this performance?

I’m seeing the same issues with search when using Vue and Vite. searchText on a single page works correctly, searchTextFull on the entire document returns a few results but doesn’t get past page 20 in a 50 page PDF). searchText or searchTextFull on a string that is not contained in the document also results in an endless loading loop in the UI with no results returned and search does not work again until the page is fully refreshed. Disabling and enabling search, clearing results, clearing the search field all do nothing.

I’ve tried on Vue 3.2 and 3.3.4 and there was no difference.

Hi there,

From the pdfjs-express-vue-sample project above,
Could you please try updating your express version to 8.7.4:
@pdftron/pdfjs-express”: “^8.7.4”,

I was able to search and after the load (which may take long if there are a lot of results)
it shows the results as expected:

Best regards,
Kevin Kim

Hi Kevin, I’m getting this issue on 8.7.4. Same version as in your screenshot:
Core 8.7.0
UI 8.7.4
Webviewer 8.7.4

I’ve tried the @pdftron/pdfjs-express and @pdftron/pdfjsexpress-viewer packages with the same result.

Testing further with this package:

I can confirm the broken search behaviour exists on the following versions:

  • 8.7.4
  • 8.7.3

Search works correctly on the following:

  • 8.7.2
  • 8.7.1
  • 8.7.0

We have reverted to 8.7.2 until this can be fixed. Thanks

I confirm what readyToLearn says, it works with version 8.7.2 but with higher versions it is broken

Hi there,

Could you please share the file you were using to perform the document search?

Best regards,
Kevin Kim

I have sent you a message with the document. Thank you

I have experienced the problem with any pdf that has more than 50 pages. If you have many images even with less

Thank you for the report,

We will add this issue in the backlog and will let you know when we have an update.

Best regards,
Kevin Kim