• 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 convert html to pdf?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
Actuaaly i want to convert from html or jsp to pdf file..But i never done before this work ..so anybody is there who can give me idea to do this work..Somebody has intimate me that itext tool is there by that we can convert html to pdf but i don't know how to use it exactly...?
pls give me info as soon as possible...
 
Sheriff
Posts: 67747
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
Moved to the Other Open Source Projects forum.
 
Marshal
Posts: 28245
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you google for "convert html to pdf" you will find a lot of products that do exactly that. If you have no idea even how to get started then I would suggest not to reinvent that wheel.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
iText can create PDF, but it can't read HTML, much less interpret its layout. You will have to do this (quite hard task) in your code, and then use the iText API to create appropriate PDF pages.

If instead of creating HTML you can create XML, and you're also willing to learn XSL-FO, you could use the Jakarta FOP library, which creates PDF from XML input by way of XSL-FO stylesheets.
 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is an example using itext convert html to pdf at www.onjava.com I recall. You can try to search on the site.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may also have a chance of using FOP if your HTML is actually XHTML. That would be a lot easier than trying to interpret the HTML yourself.
 
reply
    Bookmark Topic Watch Topic
  • New Topic