Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't check a checkbox in the PDF #32

Closed
andyatkinson opened this issue Sep 3, 2015 · 6 comments
Closed

Can't check a checkbox in the PDF #32

andyatkinson opened this issue Sep 3, 2015 · 6 comments

Comments

@andyatkinson
Copy link

Hello. I seem to be having a similar issue to #22. I haven't been able to solve it using the solution there.

By running pdftk with dump_data_fields I'm able to see the following. I also opened up the PDF (it is a IRS W9 form) in OS X Preview, checked the box, ran pdftk again and see the same FieldStateOption values (it was suggested as a verification in the other issue).

FieldType: Button
FieldName: topmostSubform[0].Page1[0].FederalClassification[0].c1_1[0]
FieldFlags: 0
FieldValue: 1
FieldJustification: Left
FieldStateOption: 1
FieldStateOption: Off

I keep filling the checkbox with '1' per the FieldStateOption value I want (checked) but I'm not able to see the checkbox get checked in the PDF that is created.

Any other tips or suggestions? Thanks.

@jkraemer
Copy link
Owner

jkraemer commented Sep 3, 2015

Andy,

please compare the relevant dump_data_fields output of the empty PDF
form (checkbox off), PDF filled out and saved manually with Preview
(where the checkbox is on) and the one where you filled in '1' via
pdf_forms (where the checkbox is supposed to be on but isn't).

The FieldStateOption values are supposed to stay the same all the time

  • they represent the possible values that can be set for the field. The
    FieldValue is the relevant piece that's supposed to change when
    checking / unchecking the box.

Cheers,
Jens

Am 2015-09-03 07:47, schrieb Andy Atkinson:

Hello. I seem to be having a similar issue to the linked one. I
haven't been able to solve it using the solution there.

#22 [1]

By running pdftk with dump_data_fields I'm able to see the following.
I also opened up the PDF (it is a IRS W9 form) in OS X Preview,
checked the box, ran pdftk again and see the same FieldStateOption
values.

FieldType: Button
FieldName: topmostSubform[0].Page1[0].FederalClassification[0].c1_1[0]
FieldFlags: 0
FieldValue: 1
FieldJustification: Left
FieldStateOption: 1
FieldStateOption: Off```

However I keep filling the form with '1' and am not able to see the
checkbox get checked in the output PDF.

Any more tips? Thanks.

Reply to this email directly or view it on GitHub [2].

Links:

[1] #22
[2] #32

@andyatkinson
Copy link
Author

@jkraemer Thanks for the quick response.

Below is the before and after checking the box and saving the PDF as a new PDF.

FieldType: Button
FieldName: topmostSubform[0].Page1[0].FederalClassification[0].c1_1[0]
FieldFlags: 0
FieldJustification: Left
FieldStateOption: 1
FieldStateOption: Off
FieldType: Button
FieldName: topmostSubform[0].Page1[0].FederalClassification[0].c1_1[0]
FieldFlags: 0
FieldValue: 1
FieldJustification: Left
FieldStateOption: 1
FieldStateOption: Off

I noticed that FieldValue was added and has a value of 1 after checking the box. However when supplying a value of "1" (as a string) using pdftk, after opening the result PDF, the box isn't checked. :( Any other thoughts?

@jkraemer
Copy link
Owner

jkraemer commented Sep 4, 2015

so what does the dump_data_fields output of the last PDF (filled via pdf_forms) look like? Does it set the FieldValue but the box is not checked or is the FieldValue not set at all? Did you really double check if the FieldStateOptions contain any whitespace that you might be missing?

@andyatkinson
Copy link
Author

@jkraemer For now I've worked around the issue by creating new fields using LibreOffice. I can even specify the name of the field which makes it much easier to link up the code that supplies the values I want to put into the output PDF. I'll try to answer your question above soon as well. If you want to try it yourself, I was using the US IRS W9 form which has some pre-filled checkboxes for the federal tax classification. Thanks.

@nabidefacto
Copy link

For the US IRS W9,
I found out, that values for checkboxes (topmostSubform[0].Page1[0].FederalClassification[0].c1_1[0] and etc), need to be integers from 1 to 7.

@jkraemer
Copy link
Owner

From that field name I would tell this is a hell of a form :) I assume this can be closed then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants