diff --git a/src/app/pdf-viewer/pdf-viewer.component.ts b/src/app/pdf-viewer/pdf-viewer.component.ts index c1c893b71..b141120e9 100644 --- a/src/app/pdf-viewer/pdf-viewer.component.ts +++ b/src/app/pdf-viewer/pdf-viewer.component.ts @@ -250,11 +250,6 @@ export class PdfViewerComponent implements OnChanges, OnInit, OnDestroy { }, 100); } - @HostListener('textlayerrendered', ['$event']) - onTextLayerRendered(e: CustomEvent) { - this.textLayerRendered.emit(e); - } - get pdfLinkService(): any { return this._showAll ? this.pdfMultiPageLinkService @@ -331,6 +326,10 @@ export class PdfViewerComponent implements OnChanges, OnInit, OnDestroy { this.pageRendered.emit(e); }); + eventBus.on('textlayerrendered', e => { + this.textLayerRendered.emit(e); + }); + this.pdfMultiPageLinkService = new PDFJSViewer.PDFLinkService({ eventBus }); this.pdfMultiPageFindController = new PDFJSViewer.PDFFindController({ linkService: this.pdfMultiPageLinkService, @@ -364,6 +363,10 @@ export class PdfViewerComponent implements OnChanges, OnInit, OnDestroy { this.pageRendered.emit(e); }); + eventBus.on('textlayerrendered', e => { + this.textLayerRendered.emit(e); + }); + this.pdfSinglePageLinkService = new PDFJSViewer.PDFLinkService({ eventBus });