Display PDF doesn't work with Byte[] attribute, in context Angular, spring and S3 application

24 views Asked by At

Good morning, I use Angular, Spring and AWS S3 for an application in which I display png, jpg, pdf files... I retrieve an Object from the backend which contains a Byte[], however I want to display a .pdf type file I get this error.

<img width="800px" [src]="'data:image/pdf;base64,'+ ressourceUI.bytes" alt="Image">

I also tried with this.

<img width="800px" [src]="'data:application/pdf;base64,'+ ressourceUI.bytes" alt="Image">

Its a same problem.

enter image description here enter image description here

Here is the error on the browser side

enter image description here How can I fix it

0

There are 0 answers