2021-09-27 16:23:41 +01:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
|
import { ModalController, NavParams } from '@ionic/angular';
|
|
|
|
|
import { ProcessesService } from 'src/app/services/processes.service';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-document-viewer',
|
|
|
|
|
templateUrl: './document-viewer.page.html',
|
|
|
|
|
styleUrls: ['./document-viewer.page.scss'],
|
|
|
|
|
})
|
|
|
|
|
export class DocumentViewerPage implements OnInit {
|
|
|
|
|
|
2021-10-05 15:02:52 +01:00
|
|
|
pdfSrc = null;
|
2021-09-27 16:23:41 +01:00
|
|
|
task = null
|
|
|
|
|
DocId = null
|
|
|
|
|
fileName = ''
|
|
|
|
|
link = ''
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
private modalController: ModalController,
|
|
|
|
|
private navParams: NavParams,
|
|
|
|
|
private processes: ProcessesService) {
|
|
|
|
|
|
|
|
|
|
this.task = this.navParams.get('task') || null;
|
|
|
|
|
this.DocId = this.navParams.get('DocId');
|
|
|
|
|
|
2021-10-05 15:02:52 +01:00
|
|
|
this.pdfSrc = 'https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file='
|
2021-09-27 16:23:41 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
|
|
|
|
|
this.processes.getFileBase64(this.DocId).subscribe((res: any) => {
|
|
|
|
|
|
|
|
|
|
console.log(res)
|
|
|
|
|
this.pdfSrc= 'data:application/pdf;base64,'+ res.file
|
|
|
|
|
this.fileName = res.name
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
close() {
|
|
|
|
|
this.modalController.dismiss();
|
|
|
|
|
}
|
|
|
|
|
}
|