PDF.js Express Viewer in React not searching in big files

Which product are you using?
PDF.js Express Viewer in React

PDF.js Express Version

I version ‘8.7.0’
Core version ‘8.7.5’
webviewer.min.js ‘8.7.5’
Build ‘Ny80LzIwMjR8MzMxOTBmNGM5YQ==’
WebViewer Server false
Full API false

Detailed description of issue
Search works fine in smaller pdfs but in longer it keeps loading but not error output to debug


Uploaded image when it is not working

Expected behaviour
Search results should show up in the search tab

Does your issue happen with every document, or just one?
Only one longer ones, but we mostly have long pdf files

Link to document
We can´t have a link inside an app, our core is not pdf viewing but databases, pdfs viewing it´s a plus.

Code snippet
Typical implementation on react, everything working even in production:
useEffect(() => {
if (pdfUrl) {
WebViewer(
{
path: ‘/webviewer/lib’,
initialDoc: pdfUrl,
licenseKey: ‘5vo9H8eDJ9GDCJJJht8r’,
},
viewer.current
).then(instance => {
const { Core, UI } = instance;

            // Configurar el idioma a español
            instance.UI.setLanguage('es');

            // Quitar opciones de imprimir y descargar
            instance.UI.disableElements(['printButton', 'downloadButton']);

            // Habilitar la búsqueda
            instance.UI.enableFeatures([instance.UI.Feature.Search]);

            Core.documentViewer.addEventListener('documentLoaded', () => {
                console.log('Documento cargado');
            });

            Core.documentViewer.addEventListener('pageNumberUpdated', (pageNumber) => {
                console.log(`Número de página actual: ${pageNumber}`);
            });

        });
    }
}, [pdfUrl]);

Hello Juancarlos,

Please remove your license key from the code snippet you provided.

Are there any console errors when performing the search? Can you reproduce this issue on our demo here? PDF.js Viewer Demo | PDF.js Express

Please provide a sample document for us to take a look at.

Best Regards,
Darian

Yes Darian, you are right my bad, can´t edit though.
It is apparently a known bug on versions 8.5+ check out the forums. It happens on different frameworks as well. Your demo has a very small pdf so it works. When we have a pdf 100+ pages , the search feature stops working. So I had to downgrade to v8.4 like many people in other frameworks have done as well. So to reproduce just upload a big pdf and test it. I´m using the viewer version.

Please remove your license key from the code snippet you provided in your constructor.

Could you link the forum posts discussing this bug? I tried with a 30GB PDF with over 10,000 pages and I was able to get search results to appear on our demo. It is running v8.7 as you can see.

Hi Darian I´m not sure to know where to edit it so I can remove the key maybe a forum admin could do it, anyway the key is linked to a domain. Maybe I´m too new to edit my own post, I´m not allowed to delete it either :frowning:
For example this post had a similar problem:

https://pdfjs.community/t/problems-with-search/2672/5

Thank you for the link.

Unfortunately, we do not have any updates on the search issue as most of our development resources have been switched over to the Apryse WebViewer.
We recommend you to consider switching to Apryse as it has ongoing updates and has the fix you are looking for.

Best regards,
Darian