• 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 create the PDF in java from the String(containing HTML tags basically HTML string ) in java

 
Ranch Hand
Posts: 153
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the HTML of some page in the String format
for example :-
String sPDFContent="<table><tr><td>Chetan</td></tr><tr><td>test</td></tr></table>";
This String i want to convert in the PDF format .

This all i m doing because i want to send the PDF file which will generated dynamically, as an attachment in the e-mail.


If someone having more easy and better answer,suggest.

Thanks to everyone in advance.
 
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read this page for a synopsis of all the libraries to choose from:

http://java-source.net/open-source/pdf-libraries
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use iTextPdf libraries !

http://itextpdf.com/

 
Sheriff
Posts: 22788
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
+1 on iText for simple HTML documents. For more advanced documents I've used Yahp with some success. It's not perfect but better than a lot of commercial products I've tried.
 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Guys thanks a lot for your suggestion .

Finally i got solution after all...


I used PD4ML,PD4PageMark classes and pd4ml.render(urlstring, fos); method of PD4ML class .



Have a great day .....

Njoy....
reply
    Bookmark Topic Watch Topic
  • New Topic