मैं कोणीय 2 का उपयोग कर रहा हूं। मुझे बैकएंड एपीआई से बीएलओबी के रूप में पीडीएफ प्रतिक्रिया मिल रही है। पीडीएफ आईफ्रेम में ठीक दिख रहा है लेकिन यह शीर्षक को 'अज्ञात' के रूप में दिखा रहा है। क्या कोई मार्गदर्शन कर सकता है?आईफ़्रेम में पीडीएफ शीर्षक को 'बेनामी' के रूप में दिखा रहा है
एचटीएमएल कोड:
<iframe id="showPDFIframe" allowtransparency="false" title="TestPDF" width="100%" height="800" [attr.src]="dataLocalUrl" type="application/pdf"></iframe>
pdf.component.ts
pdfDownload: any;
protected dataLocalUrl: SafeResourceUrl;
ngOnInit() {
this.requestOptions = this.createRequestOptions();
this.requestOptions.responseType = ResponseContentType.Blob;
this._pdfModelService.showPDF(this.requestOptions)
.subscribe((res) => {
this.pdfDownload = res;
this.dataLocalUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(res));
}, err => {
console.log(err);
})
}
pdfModelService.ts
showPDF(options?: RequestOptions): any {
return this._http.get(this.endpoints.showPDF.uri, options)
.map((res) => {
return new Blob([res], { type: 'application/pdf' })
});
}
दिखा रहा है 10
नोट: बैकएंड एपीआई बाइट्स देता है जिसे हमने बीएलओबी में डाला था।
आप अपनी प्रतिक्रिया हेडर दिखाने सकते हैं? –