Last post Nov 11, 2011 04:50 PM by atconway
Nov 10, 2011 11:03 AM|feltnerk|LINK
I have been trying to get a uniform font for my pdf that I populate with iTextSharp and have been unsuccessful.
I have tried researching the issue, and have only found articles that are using C++ and have been unsuccessful in converting this code to something that vb.net will use.
Beyond that, I need to find the correct use of iTextSharp, so that I can format all of my acrofields as one uniform font.
Dim pdfReader As New PdfReader(pdfTemplate) Dim pdfStamper As New PdfStamper(pdfReader, New FileStream(newFile, FileMode.Create)) Dim pdfFormFields As AcroFields = pdfStamper.AcroFields pdfFormFields.SetField("firstname", firstname.Text) pdfFormFields.SetField("middlename", middlename.Text) pdfFormFields.SetField("lastname", lastname.Text)
' flatten the form to remove editting options, set it to false ' to leave the form open to subsequent manual edits pdfStamper.FormFlattening = True pdfStamper.FreeTextFlattening = True ' close the pdf pdfStamper.Close()
Nov 10, 2011 11:04 AM|feltnerk|LINK
Also, I have tried changing the format of the PDF template, and that did not help.
Nov 10, 2011 11:42 AM|atconway|LINK
Our own user @Mikesdotnetting has a great series of articles on using iTextSharp for .NET since all of the provided documentation is in Java, and one
specifically on fonts that should answer your questions:
iTextSharp - Working with Fonts:
Nov 10, 2011 11:45 AM|feltnerk|LINK
I have seen that and I was unable to convert it to a working funtion for VB.net
Nov 11, 2011 04:50 PM|atconway|LINK
Is there some specific piece of C# code that you were having trouble into VB.NET that you can post to take a look at and help? I assume you have already used a converter as well, but just in case here is a link:
Tools for Converting C# code to VB.NET (or vice versa) and a little => ... Function(), Lambdas too: