*
The moose likes XML and Related Technologies and the fly likes FO:creating editable PDF? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "FO:creating editable PDF?" Watch "FO:creating editable PDF?" New topic
Author

FO:creating editable PDF?

Monty Guppy
Ranch Hand

Joined: Sep 15, 2001
Posts: 49
Hi,
Is it possible to create an editable PDF using Formatting Objects?
I want to be able to let my users be able to download a PDF template from the web. Then I want them to populate certain fields in the PDF document, and save that PDF. When they upload that PDF again, I want to read their input and update my DB. (Since there is a lot of fields to be updated which would take several hours, I can't do this in the same session, hence the need for them to do this offline.)
I read somewhere that some publishers use the above method for publishing stories/ Reports in a pre-formatted manner. They get the XML of the story or a Report, and apply it to a PDF template, instead of creating PDFs each time for creating the same report or similar story.
Anybodyhaving experience doing something cool like this.
Thanks
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Prateek,
I have never heard of using Formating Objects as a gui tool.
Its for publishing content to different data formats (most popular at the moment: pdf).
Scenario I know is:
You have the xml for the data. A xslt-engine using a xslt file converts that xml file to a .fo file. This .fo file can be rendered into a pdf with a xsl-fo engine (its called engine?) like apache.xml.fop.
In this process the data of the xml file can be set dynamically by the client. You could use a swing application for that task. Then you exchange the xml file between client and server. The client can fill the text-nodes of the xml using a swing-app. The server can do all the rest (.fo generation with xslt, pdf generation with fop) after client has uploaded the xml file.
Axel
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi Prateek,
I think Alex suggestion is wise although I'm not convinced about why users should be using a SWING application for that purpose.
A Web application would best fit web users. So you may provide an HTML form for users to enter their data.
The HTML form could include a preview and submit button. The preview button would generate a PDF file using the technique described by Alex. When the users use the submit button, you could then commit the users data into your database and generate the final PDF document.
Cheers
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Beno�t and Prateek,
Personally, I am not a fan of swing. I suggested because of
Originally posted by Prateek Gupta:

(Since there is a lot of fields to be updated which would take several hours, I can't do this in the same session, hence the need for them to do this offline.)
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Alex & Prateek
I see Alex's point, anyway the are other ways than just using session parameters when developping a web application. You could force the users to be registered, so that they each have a distinct user id. Then every time they log in, the user id is associated to the session. When the session has expired, the users have to login again, or the login id could be retreived from a cookie (for convenience).
Submissions via the form could be stored in a staging table (if a J2EE is used, using a entity EJB would be appropriate) where every piece of data would be associated with the user id. Once submitted, the staging data would then be consolidated to create the final PDF file.
Cheers
Monty Guppy
Ranch Hand

Joined: Sep 15, 2001
Posts: 49
Beno�t and Alex,
Would be so kind as to look at the following javaranch post to get an understanding of what I am trying to do, and then, if possible, share your comments.
http://www.coderanch.com/t/355760/Servlets/java/Ideas-downloading-updating-uploading-data
Thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: FO:creating editable PDF?
 
Similar Threads
Convert Editable Pdf into Non-Editable Pdf
Jasper Reports - Problem while viewing report in JSP
Swing
PDF->XSL->XML
XML