phihag / pdfform.js

Fill out PDF forms in pure JavaScript
Apache License 2.0
210 stars 73 forks source link

Support for Radio Buttons #9

Closed bestickley closed 5 years ago

bestickley commented 6 years ago

Hi,

Do you have any support for checkboxes? When I click "Fill and Download" on the demo, all of the fields are numbered in order but it skips the checkboxes.

For an example you can see the pdf I emailed you yesterday.

Thank you!

bestickley commented 6 years ago

*Correction: It's not picking up all checkboxes - a few are shown in the demo

bestickley commented 6 years ago

Hi Philipp,

The issue really is that radio buttons are not showing up, not sure if you would be able to build support in for that whenever you have time?

I'll edit the title of this issue to reflect this.

josepfdc commented 6 years ago

does not work with checkboxes or radio buttons in ""acrobat X form"

smettu007 commented 6 years ago

Any update on this issue? Or are there any specific instructions to follow to get radio buttons and checkboxes work?

bestickley commented 6 years ago

I worked around this issue by just using checkboxes instead of radio buttons on the pdf's I needed to edit.

smettu007 commented 6 years ago

@bestickley can you please provide a sample snippet on how to implement for checkboxes. Like a sample mock data and what needs to be done pdf's perspective? Any help would be really appreciated.

bestickley commented 6 years ago

I used the Acrobat Pro to go into the field and change the style of field from a radio to a checkbox. For the code, all you do is follow along with the examples and set the checkbox to either true or false

smettu007 commented 6 years ago

its not working with checkboxes. After generating the pdf there is no sign of its selection. Also i am unable to check that box manually form browser . Not sure what is causing it

bestickley commented 6 years ago

Have you tried uploading the pdf via the demo provided on this site and seeing if it works with both minipdf and PDF.js?

smettu007 commented 6 years ago

yes I did that in my very first try and it didn't work. May be something wrong with my pdf. Do you have any sample pdf that works? so I can test or use it for reference? Thanks for all the help

bestickley commented 6 years ago

welcome! Yes I do. I can send it to you?

smettu007 commented 6 years ago

@bestickley yes please. You can send it to subbumettu007@gmail.com. Thanks a lot.

dhrumil4u360 commented 5 years ago

@smettu007 @bestickley If anybody is still facing checkbox not working issue. It's probably due to PDF file. New version of PDFs are using checkbox export value as "On" unlike it was "Yes" by default before. Either this library need to be updated to handle this case or you can simply go ahead with editing PDF checkbox and set the export value of checkbox to be "Yes".

phihag commented 5 years ago

Thanks to Darius who sent me a short example file, pdfform.js v1.0.14 now supports radio buttons.

smettu007 commented 5 years ago

@phihag Thanks for adding radio buttons support

But i tried to fill radio buttons with this sample pdf and its not working. list_fields functions isnt even detecting this radio button group. i used adobe acrobat pro to create that form radio buttons.

Any help is appreciated.

dsny-tech commented 5 years ago

Following up on this, radio button form groups created in adobe acrobat pro are not being detected by the list_fields, and while checkboxes are, they don't seem to fill the PDF field as being checked. Any ideas @phihag ? Thank you