I have a PDF whose content is encrypted as a base64 string. I am trying to display it in an embed
element. It works fine in Chrome and other browsers except Microsoft Edge and Internet Explorer.
success: function (data, textStatus, xhr) {
$("#url").html("");
$("#url").append("<embed src="" + data.encodeUrl + "" class="iframe"></embed>");
$("#cameraLink").modal('show');
}
3
Answers
I have changed my code, But it only works with newer version of EDGE and has same problem with older version of EDGE and I.E.
The Data Protocol are supported only for the following elements and/or attributes:
As far as I know, Internet Explorer and the legacy version of Microsoft Edge does not support the use of DATA URIs as the source of
iframe
orembed
.As an alternative workaround, in the IE browser and the legacy version of Microsoft Edge, I suggest you could download the PDF file first, then, using browser to display the PDF file.
You could refer to the following code:
This worked for me:
Using
<iframe>
wrapped inside the<object>
tag, which i open in a new window.