I'm having hard times with this issue. I've a PDF File with fields so the user can fill them.
I'm using iTextSharp (on vb.net) to open the PDF file, read the fields and write the data back (and show it to the user).
Doc is not locked nor does it have any security measure.
I read it as follows:
Dim readerPDF As New PdfReader(Application.StartupPath & "\PDF\" & filename)
Dim pathTemp = IO.Path.GetTempFileName & ".pdf"
Dim stamperPDF As New PdfStamper(readerPDF, New IO.FileStream(pathTemp, IO.FileMode.Create))
Dim pdfFormFields As AcroFields = stamperPDF.AcroFields
then I simply loop pdfFormFields (I already have the key for each field saved in the database.
For each f as field_keys
pdfFormFields.SetField(f, "dummy text")
Next
This works great for every text input, no problems there. When I have a multiline field this thing goes nasty.
Filling using this approach gives me:
But If I open the original PDF file with Adobe Reader and I write the same I get:
So... I don't even know how to look this up on the internet. Is iTextSharp not supporting this or am I missing something?
EDIT: Link to PDF
EDIT: The itext dll was outdated. Download the lastest one and the problem still occurs.