I am trying to display a base64-encoded PDF as a string in an iframe but when I load it in Chrome or Edge, a blank page is displayed. When I load the string in Firefox, it displays the PDF in the default Firefox PDF viewer.
The content itself is in the form: <iframe src='data:application/pdf;base64,{mydata}'></iframe>
.
I saw that there might be a length limitation on the data field for iframes in Chrome/Edge but not in Firefox. Some of my strings contain over 2 MB of data or maybe over 2000 characters in the string. However, I am not sure if that is an actual limitation.
I do know that there may be a solution using blobs, but I am working in .NET and am returning a ContentResult.
Any ideas?
References: