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