Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to display base64 encoded pdf in IE?

Tags:

pdf

base64

I’m try to display pdf file which is embedded using base64 encoding in an html.

Below is the code I have written for this. The pdf file is displayed in chrome and firefox but not internet explorer. Any Idea how to get it working in IE?

<object data="data:application/pdf;base64,Base64String =" type="application/pdf" width="100%" height="100%"/>
like image 386
ali zafari Avatar asked Jan 14 '15 20:01

ali zafari


People also ask

Can you Base64 encode a PDF?

Base64 encoding is used to encode binary data, such as a PDF file, into an ASCII string format that is compatible with systems that can only handle text. For example, email attachments and binary uploads in HTML forms are converted and transmitted as Base64 encoded data.

What does Base64 string look like?

Base-64 maps 3 bytes (8 x 3 = 24 bits) in 4 characters that span 6-bits (6 x 4 = 24 bits). The result looks something like "TWFuIGlzIGRpc3Rpb...".


1 Answers

I believe the correct answer is you can't. http://msdn.microsoft.com/en-us/library/cc848897(v=vs.85).aspx

Base64 encoding in IE only works for certain image types and not PDF.

like image 96
Kevin Brown Avatar answered Oct 01 '22 03:10

Kevin Brown