Reputation: 11
I have the following application returning a PDF document as a FileStreamResult. Microsoft Edge is not rendering the PDF document. Anyone know how to fix this? or This is a known issue of Microsoft Edge?
public FileStreamResult Get()
{
MemoryStream workStream = new MemoryStream();
Document document = new Document();
PdfWriter.GetInstance(document, workStream).CloseStream = false;
document.Open();
document.Add( new Paragraph("Hello World") );
document.Add( new Paragraph( DateTime.Now.ToString() ) );
document.Close();
byte[] byteInfo = workStream.ToArray();
workStream.Write( byteInfo, 0, byteInfo.Length );
workStream.Position = 0;
return new FileStreamResult(workStream, "application/pdf");
}
Thanks Niranjan
Upvotes: 0
Views: 1492
Reputation: 11
This is fixed after updating the Windows 10 new updates. Thanks a lot for the responses.
Upvotes: 1