GetField Returns wrong data


#1

We are prototyping Aspose.PDF.kit. In the prototype, I am generating a Fillable PDF from a XML file. When reading the PDF and using GetField to return the field value, the first field is returning the text of a question on the form.

The field in question is a radio button. If I toggle that button, the proper field value is return.

I have verified that when creating the Fillable PDF, the proper field value is stored.

Any thoughts?

Thanks,

Chips


#2

Thanks for considering Aspose.Kit.

Form.GetField() will return the value of a field, including radio button field. We test and find nothing wrong. Could you please upload your PDF document as an attachment? We will solve it ASAP.

Best regards.


#3

I think I might have had a somewhat corrupted PDF. We are using a product which will create form and Fillable PDFs. When I tried to duplicate with another newly created PDF from a new form, I could not. My only conculsion was that the original PDF had something wrong with it.


#4

It might be useful to understand what is going on after all.

Attached is a zip file containing 2 PDF's that are giving bad field values.

You will notice the field value for b12c96nfQ1_01_GeneralHealth_Good.0 is not what it should be. It should be blank. It is giving the text of the question above the buttons. Clicking on the submit button will put all the fields in a email (to me). This is a quick way of seeing the field values.

b12c96nfQ1_01_GeneralHealth_Good.0=In general, would you say your health is

Thanks,

Chips


#5

Dear Chips,

Have you forgotten to attach the pdf file?

Best regards.


#6

Oops - I thought I did. I have modified the post to include a bad PDF


#7

Dear Chips,

I downloaded your PDF and reproduced your problem. I checked the document, and found you are right, there is something wrong with it. The field you mentioned DOES have a value of "In general, would you say your health is", which implies that our method GetField() works well. Besides, there are some fields even having NO values at all, such as b12c96nfQ1_01_GeneralHealth_VeryGood.0, b12c96nfQ1_01_GeneralHealth_Fair.0 and b12c96nfQ1_01_GeneralHealth_Poor.0, so GetField() returns nothing but a NULL.

Anyway, they can all be checked by Aspose.Kit.FillField(). So please check the product you employ to generate this document and try again.

Best regards.


#8

Thanks for looking into this. I kind of figured that the PDF itself was the issue. Once I regenerated the PDF, everything seemed to work fine.

Thanks,

Chips