- vikramsonawaneAsked on January 25, 2017 at 03:31 AM
I have created a form using JotForm and I'm filling up the form programmatically (using iText). I'm able to fill text field values without any issue. Problem is I'm not able to see the image field when I scan through the form I created using JotForm; Once I'm able to get an handle to the image field, I'll be able to populate the image.
Any help on this would be much appreciated.
- JotForm SupportJim_RAnswered on January 25, 2017 at 04:13 AM
Hello VS, we can better understand how to help if you could share more information on what you're doing (and how you're doing it) via iText.
IINM, you're using iText to programmatically fill out the form, and you mentioned it works great, except for the image field.
Can you give us a bit of background on how you're doing it? Are you using our APIs? Also, which iText are you using specifically - This one http://itextpdf.com/ or this one https://sourceforge.net/projects/itext/
- vikramsonawaneAnswered on January 25, 2017 at 04:24 AM
We are using iText 7 API (http://itextpdf.com/) and reading the form using Pdf AcroForm API (PdfAcroForm.getAcroForm) & then getting all the fields present on the form using form.getFormFields().
Issue is that I'm able to see all the fields other than the image field that I originally added during form creation on JotForm website.
- JotForm SupportJim_RAnswered on January 25, 2017 at 04:43 AM
Thanks for clearing that up. Do you have a text dump or log of what you're getting when you use the form.getFormFields() class?
It's a bit hard for us to do blind troubleshooting and debugging. I'm also citing our Developers Forum and API documentation to see if you can find some info on this. We also have a separate and dedicated team that you can reach at email@example.com but for now, let us know if you have something that will help us figure out why the image field is not present.
- vikramsonawaneAnswered on January 25, 2017 at 05:00 AM
Following is the form screen shot.
and following is the map content for the getFormFields() method call -
If you notice the highlighted text, it hasn't returned the field information pertaining to the form image placeholder.
- JotForm SupportJim_RAnswered on January 25, 2017 at 06:21 AM
That was helpful and you're correct. The Image Field was not included on the map content you posted:
I can only assume that, that method is only gathering "actual input fields" and skips anything that is not an input field (in this case, an Image Field). There's a way for us to test this with your help.
Try adding a Text Field to your form and run the method again.
If form.getFormFields() will skip that too, then we can safely deduce that it's only generating results from input fields.
- vikramsonawaneAnswered on January 25, 2017 at 06:44 AM
Thanks Jim_R, that makes sense. Is there a way I can have image as input field in JotForms?
- JotForm SupportJim_RAnswered on January 25, 2017 at 07:50 AM
Glad everything's cleared up now. But I'm afraid what you're asking is not possible. Textboxes, Checkboxes, Radio Buttons, and any field that requires user input are the only ones considered as input fields.
The rest that only serves to display information (e.g. Text Field, Image Field, and perhaps our Form Collapse and Page Break tools) can never be considered as an input.
- vikramsonawaneAnswered on January 27, 2017 at 08:16 AM
Is there a way I could have my own field names. Just to give an example, in my earlier response I have share the content of the fields map:
Every field is prefixed with some details (q15_, q16_, etc). In the field level configuration, I just have name, yourEmail16, etc. Why is it adding the suffix & is there a way I could not have that?
- JotForm SupportChriistianAnswered on January 27, 2017 at 09:43 AM
The field name prefix on the provided content cannot be removed or replaced. The prefix (q15_, a16_, etc.) are system generated. You can only update the Unique Name of the field in your form. This is the name that comes after the prefix.
Do let us know if you need further assistance.