Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create the PDF in java from the String(containing HTML tags basically HTML string ) in java

 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • 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.
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • 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
 
Sri Harsha Yenuganti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use iTextPdf libraries !

http://itextpdf.com/

 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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 Java Tomcat Server
  • Mark post as helpful
  • send pies
  • 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....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic