• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to asynchronously create PDF in web applications?

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to create a PDF file dynamically
using the data from the database, it might take from 5 sec to 10 min. Meanwhile, I don't like to wait idle, any solution?

any help appreciated!!
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked at the apache FOP services: http://xml.apache.org/fop/

You would construct an XML file from a database call and then create an fo stylesheet to render it to PDF.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't push the data from the server to the client so you'll have to wait.
Only alternative would be to have the user enter an email address and use JavaMail to send them the PDF as an email attachment.
 
Ranch Hand
Posts: 219
Firefox Browser Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
use library PD4ML ...
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen Wenting:
You can't push the data from the server to the client so you'll have to wait.
Only alternative would be to have the user enter an email address and use JavaMail to send them the PDF as an email attachment.



He means to say that you can't send the response without any request. So, either the user will have to wait for the response after placing the request or a thread can be spawned at server side that runs asynchronously and composes the PDF file and then send this file through email which can be taken as a input parameter from the user. In the later case, the user will not have to wait for the time that is used in composing the PDF as that task has been delegated asynchronously to an independent thread.
reply
    Bookmark Topic Watch Topic
  • New Topic