Iframe src set large base64 data

rozochkin picture rozochkin · Feb 27, 2015 · Viewed 51.6k times · Source

I have iframe for PDF preview and ton of base64 data (more than 10mb).

<iframe src="" type="application/pdf"></iframe>'

How can i use this data? When i try to set a data:

$("iframe").attr("src", data);

Some browsers are crashing.

I don't have src link. This data received by ajax. Any suggestions?

Answer

Oliv picture Oliv · Feb 16, 2016

Try this: Maybe it's too late:

<iframe src="data:application/pdf;base64,YOUR_BINARY_DATA" height="100%" width="100%"></iframe>