User-1767092133 posted
Hello,
here is my iTextSharp (written in C#). The code compiled but I do not see any PDF file that is generated. I added the reference itextsharp.dll (version iTextsharp.5.0.0) What am I doing wrong. Will this happen once I deploy it on the IIS 6 server? I have
Adobe Acrobat Reader installed Adobe Reader 9.3.
Below is my source code.
using System;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Console.WriteLine("Chapter 1 example 1: Hello World");
// step 1: creation of a document-object
Document document = new Document();
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter.GetInstance(document, new FileStream("Chap0101.pdf", FileMode.Create));
// step 3: we open the document
document.Open();
// step 4: we add a paragraph to the document
document.Add(new Paragraph("Hello World"));
// step 5: we close the document
document.Close();
}
}