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]);