mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { ModalController, NavParams } from '@ionic/angular';
|
|
import { ProcessesService } from 'src/app/services/processes.service';
|
|
import { ThemeService } from 'src/app/services/theme.service'
|
|
|
|
|
|
@Component({
|
|
selector: 'app-document-viewer',
|
|
templateUrl: './document-viewer.page.html',
|
|
styleUrls: ['./document-viewer.page.scss'],
|
|
})
|
|
export class DocumentViewerPage implements OnInit {
|
|
|
|
pdfSrc = null;
|
|
task = null
|
|
DocId = null
|
|
fileName = ''
|
|
link = ''
|
|
|
|
constructor(
|
|
private modalController: ModalController,
|
|
private navParams: NavParams,
|
|
public processes: ProcessesService,
|
|
public ThemeService: ThemeService) {
|
|
|
|
this.task = this.navParams.get('task') || null;
|
|
this.DocId = this.navParams.get('DocId');
|
|
|
|
this.pdfSrc = 'https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file='
|
|
|
|
}
|
|
|
|
ngOnInit() {
|
|
|
|
this.processes.getFileBase64(this.DocId).subscribe((res: any) => {
|
|
|
|
|
|
this.pdfSrc= 'data:application/pdf;base64,'+ res.file
|
|
this.fileName = res.name
|
|
|
|
})
|
|
|
|
}
|
|
|
|
close() {
|
|
this.modalController.dismiss();
|
|
}
|
|
}
|