mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[AAE-30877] - Checking if textlayerrendered is triggered
This commit is contained in:
committed by
Wojciech Duda
parent
f494554284
commit
9b41593a0a
@@ -139,7 +139,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
||||
private pdfjsWorkerDestroy$ = new Subject<boolean>();
|
||||
|
||||
constructor(private dialog: MatDialog, private renderingQueueServices: RenderingQueueServices, private appConfigService: AppConfigService) {
|
||||
(window as any).pdfWorkerSrc = 'assets/pdfjs/pdf.worker.mjs';
|
||||
// needed to preserve "this" context
|
||||
this.onPageChange = this.onPageChange.bind(this);
|
||||
this.onPagesLoaded = this.onPagesLoaded.bind(this);
|
||||
@@ -214,8 +213,9 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
executePdf(pdfOptions: any) {
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = 'assets/pdfjs/pdf.worker.mjs';
|
||||
//eslint-disable-next-line
|
||||
console.log('Worker', (window as any).pdfWorkerSrc);
|
||||
console.log('Worker', pdfjsLib.GlobalWorkerOptions.workerSrc);
|
||||
|
||||
this.loadingTask = pdfjsLib.getDocument(pdfOptions);
|
||||
//eslint-disable-next-line
|
||||
@@ -266,6 +266,11 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
||||
console.log('EVENT textlayerrendered');
|
||||
this.onPageRendered();
|
||||
});
|
||||
this.eventBus.on('pagerendered', () => {
|
||||
//eslint-disable-next-line
|
||||
console.log('EVENT pagerendered');
|
||||
this.onPageRendered();
|
||||
});
|
||||
|
||||
this.renderingQueueServices.setViewer(this.pdfViewer);
|
||||
this.pdfViewer.setDocument(pdfDocument);
|
||||
|
Reference in New Issue
Block a user