Unable to preview the pdf file/content using blob

Hi,

I am unable to preview the pdf file using blob. I am able to download but not able preview.

Some one please help me how to preview pdf file/content using blob.

From WebAPI I am receiving response content and converting it to blob (like response.blob())

let blobResponse = response.blob();

let fileUrl = (window.URL || window.webkitURL).createObjectURL(blobResponse);

This fileUrl I am opening in iframe. And with iframe & chrome browser able to preview the pdf content. But in IE11 not able to preview.

I have tried with readAsDataURL() also but no luck. This readAsDataURL() method returning the url but If I'm opening the url in browser then it is showing blank screen.

Please help me how to preview the pdf content in iframe/any other tag. Or any other solution.

Thanks In Advance

Kranthi Kumar Uppula

Try the MSDN forum.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

ms browsers still do not support blob and dataurl for pdfs.

here's an old demo.  compare.   Firefox and Chrome ok.  IE11, ms-Edge throw error.

https://prunemaster.github.io/snippets/dataurl/xhr-blob-to-Object--plus-dataURL.html?pdf_open_parameters.pdf

but if you check the msdn forum, all you'll find are threads that have been trolled to conceal the complaint.

5 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

 
 

Question Info


Last updated August 4, 2020 Views 4,019 Applies to:

Related Forums