title: open PDF in new tab C#
body: <p>i want to open the PDF file in new tab when i display it on the web.
  but without clicking just a function that open the file in a new tab.
  this is my display function:</p>
  
  <pre><code>private void DisplayPage()
      {        
          string path = CanvasWritingStepImages._pdfName;
          WebClient client = new WebClient();
          Byte[] buffer = client.DownloadData(path);
  
          if (buffer != null)
          {
              Response.ContentType = "application/pdf";
              Response.AddHeader("Content-Disposition", "inline; filename=Formulike.pdf");
              Response.AddHeader("content-length", buffer.Length.ToString());
              Response.BinaryWrite(buffer);
          }
          else
          {
              logger.Error("Buffer was Null!");
              throw new Exception("PDF ERROR");
          }
      }
  </code></pre>
  
  <p>i'm using "iTextSharp" to work with the PDF file.
  it's important that the PDF file will be open on a new tab without any clicking just by the function. 
  i just found with button click that open a new tab.</p>
  
  <p>i tried this:
  <a href="https://stackoverflow.com/questions/8294057/how-to-open-pdf-file-in-a-new-tab-or-window-instead-of-downloading-it-using-asp">How to open PDF file in a new tab or window instead of downloading it (using asp.net)?</a></p>