From ae808c962db00a7ca138bb4b94b862195ca4ae47 Mon Sep 17 00:00:00 2001 From: Colin Tong Date: Sat, 8 Dec 2018 01:58:36 -0500 Subject: [PATCH] switched 'pagerendered' event from using utils bus to direct eventBus --- src/app/pdf-viewer/pdf-viewer.component.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/pdf-viewer/pdf-viewer.component.ts b/src/app/pdf-viewer/pdf-viewer.component.ts index 5411782d2..34df21a10 100644 --- a/src/app/pdf-viewer/pdf-viewer.component.ts +++ b/src/app/pdf-viewer/pdf-viewer.component.ts @@ -224,9 +224,9 @@ export class PdfViewerComponent implements OnChanges, OnInit, OnDestroy { }, 100); } - @HostListener('pagerendered', ['$event']) onPageRendered(e: CustomEvent) { - this.pageRendered.emit(e); - } + // @HostListener('pagerendered', ['$event']) onPageRendered(e: CustomEvent) { + // this.pageRendered.emit(e); + // } @HostListener('textlayerrendered', ['$event']) onTextLayerRendered(e: CustomEvent) { this.textLayerRendered.emit(e); @@ -292,6 +292,10 @@ export class PdfViewerComponent implements OnChanges, OnInit, OnDestroy { const eventBus = createEventBus(PDFJSViewer); + eventBus.on('pagerendered', (e) => { + this.pageRendered.emit(e); + }); + this.pdfMultiPageLinkService = new PDFJSViewer.PDFLinkService({eventBus}); this.pdfMultiPageFindController = new PDFJSViewer.PDFFindController({linkService: this.pdfMultiPageLinkService, eventBus}); @@ -316,6 +320,10 @@ export class PdfViewerComponent implements OnChanges, OnInit, OnDestroy { const eventBus = createEventBus(PDFJSViewer); + eventBus.on('pagerendered', (e) => { + this.pageRendered.emit(e); + }); + this.pdfSinglePageLinkService = new PDFJSViewer.PDFLinkService({eventBus}); this.pdfSinglePageFindController = new PDFJSViewer.PDFFindController({linkService: this.pdfSinglePageLinkService, eventBus});