0

I'm creating a PDF object in a partial with a base64-encoded string. It renders perfectly fine on Chrome, but all I get is a grey box in IE11. This is the HTML for the partial view:

@model byte[]
@{
    String base64EncodedPdf = System.Convert.ToBase64String(Model);
    Layout = null;
}

<object data="data:application/pdf;base64,@base64EncodedPdf" width="900" height="900"
        type="application/pdf"></object>
Jason L
  • 1,812
  • 2
  • 22
  • 43
  • Can you show us your controller's code? – Tushar Gupta Jan 13 '15 at 17:20
  • I've never tried object but embed and iframe always failed to load PDFs in IE. Kind of related http://stackoverflow.com/questions/11551197/mime-encoding-of-a-pdf-file-in-an-html-page, http://stackoverflow.com/questions/291813/recommended-way-to-embed-pdf-in-html – Musa Jan 13 '15 at 17:23
  • @TusharGupta Can you explain why you need the controller code? That the exact same HTML works on Chrome but doesn't work on IE does not look like a controller issue to me. – Jason L Jan 13 '15 at 17:28
  • See In controller there might be an issue that if you are using return File ...The header will be flushed which might be the case for non support in IE..If that's the case I recommend to use `return Rediect` – Tushar Gupta Jan 13 '15 at 17:35

0 Answers0