Microsoft Edge不渲染Pdf流

本文关键字:Pdf Edge Microsoft | 更新日期: 2023-09-27 18:07:10

我有以下应用程序作为FileStreamResult返回PDF文档。Microsoft Edge无法呈现PDF文档。有人知道怎么解决这个问题吗?或者这是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");
}

谢谢Niranjan

Microsoft Edge不渲染Pdf流

此问题在更新Windows 10新更新后修复。非常感谢您的回复。