Last post May 22, 2009 01:26 AM by qwe123kids
May 21, 2009 12:08 PM|nakins|LINK
I'm trying to use iText sharp to fill in a pdf and write the filed in pdf with a new name to a directory. I'm not getting any errors when I run it, nor see anything has I write the code. But I must be doing something wrong or leaving something out. It may
be that I'm not doing the file write to the directory correctly.
Here is the code I have so far. I took out some of the fields to make it shorter. thanks for any insight you can provide.
Public Sub fill_form(ByVal Source As Object, ByVal e As EventArgs)
Dim newFile As String = "D:\Inetpub\wwwroot\info\pdfs\" + data1.Text + ".pdf"
Dim ps As PdfStamper = Nothing
Dim path As String = Request.MapPath("newpdf.pdf")
If File.Exists(path) Then
Dim r As New PdfReader(New RandomAccessFileOrArray(path), Nothing)
ps = New PdfStamper(r, New FileStream(newFile, FileMode.Create))
Dim af As AcroFields = ps.AcroFields
ps.FormFlattening = True
Label1.Text = "No file found"
If ps IsNot Nothing Then
May 22, 2009 01:26 AM|qwe123kids|LINK
check the baove link