• 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

Can a servlet convert a html page into pdf

 
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can a servlet convert a html page into pdf document?
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With a 3rd party library that does so. I'd search for something like java pdf generation.
 
Saloon Keeper
Posts: 7600
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the HTML is actually CSS-styled XHTML, then the FlyingSaucer library can help. Otherwise, OpenOffice in server mode might do, possibly via a library such as JODConverter.
 
Greenhorn
Posts: 11
Objective C Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The question in not really clear: the servlet does not convert anything. The servlet "composes" the response and this response can be HTML, PDF or any other MIME format.

The conversion you need can be done with multiple libraries but instead of a servlet...
what about a filter that converts the output of an HTML response (maybe prepared by a JSP)??

It's only an idea
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, my requirement is that i have to provide a pdf cnversion facility in Formulae.html(mathematics). That html is just informative. If the user clicks pdf conversion link, it will cnverts the contents of html into pdf.
 
Ernesto Arroyo
Greenhorn
Posts: 11
Objective C Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you were generating XHTML you could easily convert to PDF with... ¿XSL-FO? (not sure about this acronym).

Google for FOP (Formatting Object to PDF) or http://xml.apache.org/dist/fop/
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic