lundi 28 décembre 2015

MVC3 FileContentResult returns corrupt pdf

I have an issue where pdfs are being corrupted when viewing. I can assure all of you that the source (test.pdf) pdf is not corrupt. Non pdf files will display correctly.

Running the following code displays the pdf with black blocks where the text should be.

public ActionResult ShowDoc()
        {
            return File(@"c:\temp\test.pdf", "application/pdf");
        }

Corrupt Display

With IE I get this message:

enter image description here

Please help.

Aucun commentaire:

Enregistrer un commentaire