I found and succesfully tested the following code on IIS 7 (a different Pdf file is opened each time I choose a different document).
However I am not sure how to generate the Pdf file into a new tab each time a new document is requested. I prefer a new tab instead of having the Pdf file open in the same window as the form. Any ideas? (Thank you in advance.)
To avoid the original problem on IIS, MemoryStream was used:
_DocMemoryStream = new MemoryStream();
_Document = new Document(PageSize.A4, 1, 1, 10, 10);
_PdfWriter = PdfWriter.GetInstance(_Document, _DocMemoryStream);
_Document.Open();
Response.Clear();
Response.ContentType = "application/pdf";
_DeLetterDocument.Close();
_PdfWriter.Flush();
Response.OutputStream.Write(_DocMemoryStream.GetBuffer(), 0, _DocMemoryStream.GetBuffer().Length);
Response.OutputStream.Flush();
Response.OutputStream.Close();
Response.End();