jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

$('iframe').attr('src', doc.output('datauristring')); does not work in IE11

Open cheindel opened this issue 12 years ago • 6 comments

Downloading of a PDF works, but embedding it in an iFrame does not work.

Works in IE11: doc.save()

Does not work in IE11: $('iframe').attr('src', doc.output('datauristring'));

You get no error message, but also no PDF in the iFrame.

Exact versions from my test:

  • jsPDF 1.0.88 (current release)
  • IE 11.0.9600.16521 / Update version: 11.0.4 KB2925418 (current patch level on Windows 7 and Surface 2 / Windows RT)

cheindel avatar Apr 07 '14 12:04 cheindel

According to this MSDN Article:

Data URIs are supported only for the following elements and/or attributes.

  • object (images only)
  • img
  • input type=image
  • link
  • CSS declarations that accept a URL,

IE so friendly as always...

diegocr avatar Apr 08 '14 17:04 diegocr

I've tried to use a blob url instead, but this seems to have problems too:

http://jsfiddle.net/dGLmr/9/

HTML7007: One or more blob URLs were revoked by closing the blob for which they were created. These URLs will no longer resolve as the data backing the URL has been freed.

Seems this has been already reported to Microsoft a few times (here, and here), but the staff keep closing these issues as "Not Reproducible"... Huh?

diegocr avatar Apr 08 '14 18:04 diegocr

I understand that we have to wait for Microsoft to get this issue fixed.

Until then, it would be nice if the jsPDF documentation could be updated on http://mrrio.github.io/jsPDF/doc/symbols/jsPDF.html#output and http://parall.ax/products/jspdf to make this limitation more clear to the developers that are using the jsPDF library. They should be aware of the problem so that they can individually ask Microsoft to support this with IE. ;-)

The current jsPDF documentation is not helpful in regards to this issue. Because the sample at https://github.com/MrRio/jsPDF/blob/master/examples/runner.html uses an iframe and the documentation did not state otherwise, I initially expected this to work in IE10+.

"Browser Compatibility: jsPDF will work in IE6+*, Firefox 3+, Chrome, Safari 3+, Opera. For IE9 and below, we lazily load a Flash shim called Downloadify which enables the files to be downloaded. (Current build does not have IE6-9 shim enabled))"

--> This text reads as if IE10+ would support the full functionality like Chrome & Co. do...

cheindel avatar Apr 28 '14 22:04 cheindel

Hi,

I am using IE 11 but i file is not getting donwloaded. It says file couldn't donwload.Try again. Is this a browser setting or it wont work in IE 11. Please assist.

Thanks

ankur2728 avatar Jun 16 '15 16:06 ankur2728

Hi,

Is there any progress with this issue? Any updates from Microsoft made in IE11? I am trying the same implementation, where jspdf perfectly works and renders inside iframe in Chrome, it does not renders in IE11 but i am to download.

Is there a fix available for IE 11?

Thanks.

aashish490 avatar Jan 15 '19 18:01 aashish490

It is simply not technically possible in IE11

Uzlopak avatar Jan 16 '19 04:01 Uzlopak