I'm dynamically creating some PDF files through my application, and I need to use several components (TextField, CheckBox, RadioButtons etc), and then submit the values to server. One of the requirements says that the user needs to be able to select and send files along with the other values. I did not find a specific component to this, and so I'm asking for some help with this situation.
Is there a way to create some kind of Input File, File Chooser, etc, and attach it on the generated PDF file? And then send this selected file to server?
I've prepared an example that explains how to create such a field when creating a document from scratch: FileSelectionExample
A file selection field is created just like any other text field, except that you have to set a flag using the
In the full example, I also added a second field and after selecting the file with the
browseForFileToSubmit() method, I set the focus to that other field. I'm doing this because the file name only becomes visible in the file selection field after that field loses focus.
Click How to send a file to the server through a PDF? if you want to see how to answer this question in iText 5.