Ulf Dittmer wrote:You can use the iText library to create PDFs. If the HTML page consists of CSS-styled XHTML, then the FlyingSaucer library is also an option.
thanks for reply , I don't know how to use FlyingSaucer library , could you please just an example of it .
I have found three examples of conversion but still could work for me the programs , once I open the pdf file. what shall I do??
these are the links
http://www.java2s.com/Tutorial/Java/0419__PDF/ParsingHtml.htm
http://www.java2s.com/Tutorial/Java/0419__PDF/HtmlParserfromiText.htm
http://www.java2s.com/Tutorial/Java/0419__PDF/ParsingHtmlSnippets.htm
and aonther example is below
I have error here :
pdfDocument.add(new Paragraph(org.apache.commons.io.FileUtils.readFileToString(file)));
error is :
readFileToString(java.io.File,java.lang.String) in org.apache.commons.io.FileUtils cannot be applied to (java.io.File)
what is the solution ?? , I am using commons-io-2.0.1.jar for it. But still error available.
thanks a lot