Hello Guys I want to show a dynamic pdf. At first it was showing me CORS error. I solved that using DOM Sanitizer. Now it is showing me unsafe url Any Help is appreciated.
HTML Code :
<iframe src="{{Url}}"></iframe>
TS Code : Here pdfSrc stores the dynamic generated pdf path;
this.pdfSrc = 'http://192.168.1.183/' + this.pdfPath;
this.Url = this.sanitizer.bypassSecurityTrustUrl(this.pdfSrc);
Finally got the solution just changed the HTML Part & TS PART AS BELOW
<iframe [src]='Url' width="100%" height="1000px"></iframe>
constructor(private sanitizer:DomSanitizer){}
this.Url = this.sanitizer.bypassSecurityTrustResourceUrl(this.pdfSrc);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With