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

**URL:** https://pdfjs.community/t/pdf-js-express-viewer-in-react-not-searching-in-big-files/3383
**Category:** Technical Support
**Created:** [August 3, 2024, 2:53am UTC](https://pdfjs.community/t/pdf-js-express-viewer-in-react-not-searching-in-big-files/3383 "2024-08-03T02:53:55Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![juancarlos](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@juancarlos](https://pdfjs.community/u/juancarlos)
#### Post date: [August 3, 2024, 2:53am UTC](https://pdfjs.community/t/pdf-js-express-viewer-in-react-not-searching-in-big-files/3383/1 "2024-08-03T02:53:55Z")

</div>

**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

 ![Captura_pdfjs_NOTworking](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/f/f90e8c706d7bc7782ff855fcfb63bddcd53b2860.png)  
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]);

```

---

<div class="post-metadata">

### Author: ![darian.chen](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@darian.chen](https://pdfjs.community/u/darian.chen)
#### Post date: [August 5, 2024, 3:36pm UTC](https://pdfjs.community/t/pdf-js-express-viewer-in-react-not-searching-in-big-files/3383/3 "2024-08-05T15:36:07Z")

</div>

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](https://pdfjs.express/demo)

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

Best Regards,  
Darian

---

<div class="post-metadata">

### Author: ![juancarlos](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@juancarlos](https://pdfjs.community/u/juancarlos)
#### Post date: [August 9, 2024, 4:02am UTC](https://pdfjs.community/t/pdf-js-express-viewer-in-react-not-searching-in-big-files/3383/4 "2024-08-09T04:02:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![darian.chen](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@darian.chen](https://pdfjs.community/u/darian.chen)
#### Post date: [August 9, 2024, 2:14pm UTC](https://pdfjs.community/t/pdf-js-express-viewer-in-react-not-searching-in-big-files/3383/5 "2024-08-09T14:14:32Z")

</div>

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.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/8/8ec5dee23f924d1dcf815471718221d7bd10d99c.jpeg)

---

<div class="post-metadata">

### Author: ![juancarlos](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@juancarlos](https://pdfjs.community/u/juancarlos)
#### Post date: [August 9, 2024, 10:29pm UTC](https://pdfjs.community/t/pdf-js-express-viewer-in-react-not-searching-in-big-files/3383/6 "2024-08-09T22:29:37Z")

</div>

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 ☹  
For example this post had a similar problem:

[https://pdfjs.community/t/problems-with-search/2672/5](https://pdfjs.community/t/problems-with-search/2672/5)

---

<div class="post-metadata">

### Author: ![darian.chen](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@darian.chen](https://pdfjs.community/u/darian.chen)
#### Post date: [August 12, 2024, 3:21pm UTC](https://pdfjs.community/t/pdf-js-express-viewer-in-react-not-searching-in-big-files/3383/7 "2024-08-12T15:21:20Z")

</div>

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](https://apryse.com/products/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
