Welcome Guest Search | Active Topics | Sign In | Register

Problems filling PDF Form from XFDF Options
creality
Posted: Tuesday, March 5, 2024 7:02:01 AM
Rank: Advanced Member
Groups: Member

Joined: 12/9/2014
Posts: 79
Hi all,
I am having some troubles when filling some PDFs.

For ex.:
In the Pdf there is two checkboxes with the same name; one with "Export value" as "S" and the other with export value as "N".
The behaviour I expected if want check one of them is some as:

var currentField = pdfDocument.Fields["CheckboxName"];
currentField.Value = "S";

This doesn't work, and no one of checkboxes is checked.
I see in doc about "1" and "0" for checkboxes value property, and see Checked property of "PdfCheckboxField" too, but I don't know who is who.

I debug a little, and see that in my Ex. "currentField" is "PdfGenericField" type with two children with "PdfCheckboxField" type. I could iterate children and "check it manually", but both of them have Checked "false" and Value "0", and no other props about, so I don't know what child have export value "S" nor "N" to check it according.

Something similar occurs with RadioButtons and RadioButtonGroups.

Thank you.

Regards,
Eduardo.
eo_support
Posted: Tuesday, March 5, 2024 10:37:38 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

Can you send the PDF file to us so that we can take a look? You can send the files to us through contact us page.

Thanks!
creality
Posted: Tuesday, March 5, 2024 1:11:23 PM
Rank: Advanced Member
Groups: Member

Joined: 12/9/2014
Posts: 79
Hi,
I send you two PDFs with forms that we use and I want to fill with your library.

Thanks.
eo_support
Posted: Wednesday, March 6, 2024 4:00:44 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
We have received the test file. However can you let us know the name of the field that you are having problems with? There are over 200 fields in your file.
creality
Posted: Thursday, March 7, 2024 4:23:17 AM
Rank: Advanced Member
Groups: Member

Joined: 12/9/2014
Posts: 79
Thank you and sorry for being late. I have a lot of work this week.

I answer your email with that information.
I paste here part of the answer in case it is useful to someone else.

The problem arises from the use of XFDF. We use XFDF from at least 10 years ago, so we prepare our PDFs accordingly.
When I "open" an XFDF file, Adobe Reader open the clean PDF and fill it with the XFDF data.
Another option if you don't want to "change" the actual behaviour of fields and Value prop., and by far better for us, is to add or implement XFDF support to your library.

Otherwise, as I saw in my first post, the desired behavior, for ex with TIPO_JORNADA is as follows.
In the I420_2023N.pdf, I have 4 radiobuttons with name "TIPO_JORNADA", each of them with a different export value, in this case: D, S, M, A.

If I want to "check" or "select" the second one, I want to be able to do the following:

var currentField = pdfDocument.Fields["TIPO_JORNADA"];
currentField.Value = "S";

In the case that this behavior is not possible, at least I want to know the Export value of the field.

Thanks.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.