send every type of file its possible now

This commit is contained in:
Eudes Inácio
2022-04-06 16:25:47 +01:00
parent 74a9b787e9
commit a998bee230
8 changed files with 283 additions and 179 deletions
@@ -24,12 +24,13 @@
<img src="{{image}}">
</div>
<div *ngIf="type == 'application/pdf'">
<iframe width="100%" height="100%" [src]="base64Sanitize" type="application/vnd.openxmlformats-officedocument.wordprocessingml.document"></iframe>
<pdf-viewer [src]="image"
<!-- <pdf-viewer [src]="image"
[render-text]="true"
[original-size]="false"
style="width: 400px; height: 500px"
></pdf-viewer>
></pdf-viewer> -->
</div>
</div>
</ion-slide>
+2 -7
View File
@@ -20,7 +20,7 @@ export class ViewMediaPage implements OnInit {
maxRation: 2
};
base64Sanitize = "";
base64Sanitize:any = "";
constructor(
private modalController: ModalController,
@@ -38,12 +38,7 @@ export class ViewMediaPage implements OnInit {
ngOnInit() {
console.log(this.image)
const encodedData = btoa(this.image);
const blob = new Blob([this.b64toBlob(encodedData)], { type: 'application/pdf' });
this.base64Sanitize = URL.createObjectURL(blob);
//this.base64Sanitize = this.sanitizer.bypassSecurityTrustResourceUrl(this.base64Sanitize);
this.base64Sanitize;
this.base64Sanitize = this.sanitizer.bypassSecurityTrustResourceUrl(this.image);
console.log(this.base64Sanitize)
}