TypeError: Cannot read properties of undefined (reading 'findController') #2508
-
I'm attempting to implement the find by regex feature as described here: https://pdfviewer.net/extended-pdf-viewer/custom-find In the showcase code it shows an override method that appears to be attempting to access the finder on the view. I'm attempting to access the viewer like this: In previous versions this worked, but with the newest version it's showing this error in the console: Please advise. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Currently I'm implementing a better solution, but in the meantime, let's fix your bug. Luckily, that's easy. With version 21 I've removed Nowadays, you can use the constructor(notificationService: PDFNotificationService) {
effect(() => this.PDFViewerApplication = notificationService.onPDFJSInitSignal());
} Update: I've added the missing constructor to the showcase page. |
Beta Was this translation helpful? Give feedback.
Currently I'm implementing a better solution, but in the meantime, let's fix your bug. Luckily, that's easy. With version 21 I've removed
PDFViewerApplication
from thewindow
object. Polluting the global namespace was a dirty hack that has severe disadvantages.Nowadays, you can use the
PDFNoticationService
to get the instance of thePDFViewerApplication
:Update: I've added the missing constructor to the showcase page.