title: How do I stream pdf online
body: <p>I am using itextSharp to generate a pdf document this is how I'am saving my pdf:
  <code>string file = "C:/MyDoc/FileName.pdf";</code>. If I run this program over the network then file path can vary. After doing a lot of research I have found out that I can do this: </p>
  
  <pre><code>            Response.ContentType = "application/pdf";
              Response.AddHeader("content-disposition", "attachment;" + "filename=FileName.pdf");
              Response.Write(document);
  
                Response.OutputStream.Flush();
               Response.OutputStream.Close();       
  </code></pre>
  
  <p>The question is that how would I declare <code>string file</code> in above code. The reason for doing this is because later on I am inserting page numbers to the pdf where file variable is passed on e.g.</p>