Show pdf in new tab MVC C# RRS feed

  • Question

  • Hi, I'm trying to show a pdf file in a new tab, Can you help me? I can download but not top open in new tab.

    I have the file in Stream or Byte[] array

    I'm using MVC and entity framework

    public ActionResult ShowPDFLabel() { System.IO.Stream file = //get file

    Response.ContentType = "Application/pdf"; return File(file, "application/pdf", "somefile.pdf"); }

    <a class="btn btn-sm btn-info" href="Entry/ShowPDFLabel" target="_blank" ><i class="fa fa-barcode"></i> @Resources.Print @Resources.Labels</a>

    • Edited by agg9505 Monday, August 21, 2017 5:32 PM
    • Moved by Sabah ShariqMVP Monday, August 21, 2017 9:35 PM Moved From Visual C#
    Monday, August 21, 2017 5:28 PM


All replies