Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Saving Edited PDF Forms using iText

 
prinz reyes
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I generated a registration form in java using iText. The form was editable so my users can input their name, age and other details. I have to save the form afterwards so that i can get the data that the user wrote in my pdf form.

I can write the details in my pdf file but when im saving the file i am prompted that the data i provided will not be saved and if i want to have a copy of the completed form i should print it.

Is there any way that i can save my form after user input so that i can get their data?

Thank you.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An extensive example of how to create a submittable PDF form using iText can be found at http://www.geek-tutorials.com/java/itext/itext_acroform_javascript.php
 
prinz reyes
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your quick response. I tried the link you gave me but i still have problem.

what if i want to save the data directly to the database after clicking POST?

Or should i say i want to save a copy of the completed form to another pdf form?
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what if i want to save the data directly to the database after clicking POST?

I'm not sure what you're asking. You can't submit a PDF to a DB - it needs to go through an active server component -like a servlet- in one of the available modes (PdfAction.SUBMIT_...). The server then can do with the data whatever it pleases (save it, ignore it, etc.).
 
prinz reyes
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again for your reply..

here's what i really want to do.

1. i created a from using iText that is editable.
2. then user can download it and save it example in their desktop.
3. user provide data in the required fields and then save the file.
4. Upload the completed file to a site or email it.

but the problem is after i edit or fill up the form i cannot save it.

Do you have any idea?

Im really sorry for the disturbance.


 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not a disturbance at all. Answering questions and clearing up confusion is what this site is all about.

but the problem is after i edit or fill up the form i cannot save it.

Right. Adobe Reader can't save filled-in forms, only the Professional version (which costs money) can do that. But Reader can submit a filled-in form, and the example I linked to shows how to create a PDF that allows you to do that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic