fix file not loading

This commit is contained in:
Dan Percic 2021-07-08 19:46:07 +03:00 committed by Adina Țeudan
parent 909f31a406
commit 203cc2cd43

View File

@ -38,7 +38,7 @@ import TextTool = Tools.TextTool;
templateUrl: './pdf-viewer.component.html',
styleUrls: ['./pdf-viewer.component.scss']
})
export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
export class PdfViewerComponent implements OnInit, OnChanges {
@Input() fileData: Blob;
@Input() fileStatus: FileStatusWrapper;
@Input() canPerformActions = false;
@ -85,9 +85,10 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
this.utils.viewMode = value;
}
ngOnInit() {
async ngOnInit() {
console.log(2);
this._documentLoaded = this._documentLoaded.bind(this);
await this._loadViewer();
}
ngOnChanges(changes: SimpleChanges): void {
@ -107,11 +108,6 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
console.log(3);
}
async ngAfterViewInit(): Promise<void> {
console.log('after view init');
await this._loadViewer();
}
setInitialViewerState() {
// viewer init
this.instance.setFitMode('FitPage');
@ -214,8 +210,8 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
{
licenseKey: environment.licenseKey ? atob(environment.licenseKey) : null,
fullAPI: true,
path: this.utils.convertPath('/assets/wv-resources'),
css: this.utils.convertPath('/assets/pdftron/stylesheet.css'),
path: '/assets/wv-resources',
css: '/assets/pdftron/stylesheet.css',
backendType: 'ems'
},
this.viewer.nativeElement