What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Adding image to PDF formAsked by vikramsonawane 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.
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/
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.
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.
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.
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.
Thanks Jim_R, that makes sense. Is there a way I can have image as input field in JotForms?
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.
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?
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.