Show the PDF

When you click the button below, the PDF will open in a new window, just as if you have clicked on a link to a PDF document on a web page. This is just one way you can use the PDF, for example you could email it to a customer, download it, or save it to a file for later use.

 


Example Code

The code (without error handling) that will open the PDF as a web page is:

// theDoc references the current PDF document object byte[] theData = theDoc.GetData(); // Get the PDF data Response.ClearHeaders(); Response.ClearContent(); Response.Expires = -1000; Response.ContentType = "application/pdf"; Response.AddHeader("content-length", theData.Length.ToString()); Response.AddHeader("content-disposition", "inline; filename=ExampleSite.pdf"); // Send the PDF inline, ie. it will open in the browser Response.BinaryWrite(theData); HttpContext.Current.ApplicationInstance.CompleteRequest();