Alex Gordon
Alex Gordon

Reputation: 60851

Text Field doesnt show up in PDF

I am wondering if the following is a known issue and whether there is a solution for it. After searching on google, I could not find anyone with a similar issue.

I am using c#/itextsharp to create a PDF

I've succesfully created about 5 pdfs from 5 different templates that I created; however this one is giving me a lot of tzaras.

I have a text field on the template called PractitionerName1.

I am inserting data into it like this:

string firstName1 = dr["my:PractitionerFirstName1"].ToString();
            string lastName1 = dr["my:PractitionerLastName1"].ToString();
string fPhysician1 = firstName1 + " " + lastName1;
 cPdf.InsertTextFieldValue("PractionerName1", fPhysician1);

doesn't work.

When I create a new text field named Text1 and do the same exact thing but do:

cPdf.InsertTextFieldValue("Text1", fPhysician1);

It works.

If I change the name of Text1 to PractitionerName1 on the template then it doesn't work.

There is no error message.

What am I doing wrong? how can I correctly insert the data into my PractitionerName1 field?

Upvotes: 0

Views: 321

Answers (1)

Jonathan
Jonathan

Reputation: 1719

Maybe this is a typo in your question, but it looks like the name you're using to set the field does not match the field name.

cPdf.InsertTextFieldValue("PractionerName1", fPhysician1);

should be

cPdf.InsertTextFieldValue("PractitionerName1", fPhysician1);

Upvotes: 2

Related Questions