Skip to content

Commit

Permalink
Merge pull request #465 from sChupin/fix-text-layer-rendered
Browse files Browse the repository at this point in the history
fix: Listen for textlayerrendered events from eventBus
  • Loading branch information
VadimDez authored Apr 13, 2019
2 parents 528043d + ae7eec5 commit e42dafa
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/app/pdf-viewer/pdf-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
});
Expand Down

0 comments on commit e42dafa

Please sign in to comment.