aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Saving Edited PDF Forms using iText Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Saving Edited PDF Forms using iText " Watch "Saving Edited PDF Forms using iText " New topic
Author

Saving Edited PDF Forms using iText

prinz reyes
Greenhorn

Joined: Mar 30, 2009
Posts: 8
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
Marshal

Joined: Mar 22, 2005
Posts: 41580
    
  54
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


Ping & DNS - my free Android networking tools app
prinz reyes
Greenhorn

Joined: Mar 30, 2009
Posts: 8
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
Marshal

Joined: Mar 22, 2005
Posts: 41580
    
  54
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

Joined: Mar 30, 2009
Posts: 8
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
Marshal

Joined: Mar 22, 2005
Posts: 41580
    
  54
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.
 
Consider Paul's rocket mass heater.
 
subject: Saving Edited PDF Forms using iText