Last post May 31, 2010 07:31 AM by TATWORTH
May 06, 2010 07:00 AM|m-burgess|LINK
Am currently developing an application in vb.net to write information to a pdf, using itextsharp 5.0.2.
I have been able to add images and paragraps to the pdf without any problem.
I build up my document as shown below
' Create instance of iTextSharp object
Dim doc As New Document(PageSize.A4, 75, 75, 50, 50)
' Get full path of file
Dim path As String = System.Web.HttpContext.Current.Server.MapPath("~/authenticated/letters/" + _debt.DebtId.ToString + "-stage1-letter.pdf")
' Create writer to listen to this document and write to stream
PdfWriter.GetInstance(doc, New FileStream(path, FileMode.Create))
' Open document
' Setup default font
Dim fontBold As Font = FontFactory.GetFont("Tahoma", 11, Font.BOLD)
Dim fontDefault As Font = FontFactory.GetFont("Tahoma", 11, Font.NORMAL)
' Get relevant letterhead logo
Dim headerImage As Image = Image.GetInstance(System.Web.HttpContext.Current.Server.MapPath(_pcLogoPath))
Then to add a new paragraph i am using..
Dim p1 As New Paragraph
p1.Font = fontDefault
p1.SpacingAfter = 10
I am trying to create a footer on the pdf document. Therefore I need to create a new paragraph which is positioned absolute bottom. This is the latest version of iText (5.0.2) and i know that they have removed the headerfooter feature, which was included
in previous versions. I have searched and searched for possible solutions but cannot find anything suitable.
Has anyone had a similar issue or know of a fix?
May 31, 2010 07:31 AM|TATWORTH|LINK
You can also try asking at