Hello,

I am trying to fill a textfield in an acroform designed with Adobe Designer
7.0

I’ve read many mailinglist posts related to this setfield method. They are
from the year 2005 and appear  various comments about “unicode is not fully
supported in form fields..”

I am wondering if it is corrected by now or if there is a known workaround.

 

The problem I am facing is related to spanish accentuated characters, that
get cut when filling the form with setfield.

 

Here is the code I am using:

 

Dim reader As New PdfReader("MyFormToFill.pdf")

Dim stamp1 As New PdfStamper(reader, New FileStream("MyFormFilled.pdf",
FileMode.Create))

Dim form1 As AcroFields = stamp1.AcroFields

form1.SetField("txtBox1", "àticó 1º1ª")

 

Always get the resulting form with the text “tic 11” in the textbox.

 

I also tried this other pieces of code with the same results.

A)

Dim bf As BaseFont = BaseFont.CreateFont(BaseFont.HELVETICA,
BaseFont.CP1252, BaseFont.NOT_EMBEDDED)

cb.BeginText()

cb.SetFontAndSize(bf, 10)

cb.SetTextMatrix(aSingles(1), aSingles(2))

cb.ShowText("àticó 1º1ª")

cb.EndText()

B)

Dim ph As New Phrase("àticó 1º1ª",
FontFactory.GetFont(FontFactory.HELVETICA, 10))

ColumnText.ShowTextAligned(cb, Element.ALIGN_LEFT, ph, aSingles(1) + 10,
aSingles(2) + 10, 0, PdfWriter.RUN_DIRECTION_LTR, 0)

 

I verified the font selected in the designer for "MyFormToFill.pdf", when
opened with acrobat reader, lets me introduce the text "àticó 1º1ª" as is.

 

Hopefully I am doing something wrong and setfield should be working, please
give me some light..

Thank you,

David

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to