We are trying to evalualte this product whether it meets our requirements. We use JAVA here. I need some example for converting HTML ( preferably with CSS, images, hyperlinks, etc..) into PDF.
thanks alot
Bontu A
We are trying to evalualte this product whether it meets our requirements. We use JAVA here. I need some example for converting HTML ( preferably with CSS, images, hyperlinks, etc..) into PDF.
thanks alot
Bontu A
Hi Bontu,
Hi Bontu,
Hi Bontu,
Thanks for your patience. We have good news for you, your requested feature has been implemented in Aspose.Pdf for Java 4.3.0. Please download latest version and try following code snippet for the purpose.
StringBuffer sb = new StringBuffer(1024);
BufferedReader reader = new BufferedReader(new FileReader(
myDir + "htmltest123.html"));
char[] chars = new char[1024];
while((reader.read(chars)) > -1){
sb.append(String.valueOf(chars));
}
reader.close();
//Instantiate Pdf object by calling its empty constructor
Pdf pdf1 = new Pdf();
//Create a new section in the Pdf object
Section sec1 = pdf1.getSections().add();
//Create a new text paragraph and pass the text to its constructor as argument
Text text1 = new Text(sec1, sb.toString());
// use the following method to render the HTML tags accordingly
text1.isHtmlTagSupported(true);
// add text paragraph to paragraphs collection of section object
sec1.getParagraphs().add(text1);
// save the resultant PDF document
pdf1.save(myDir + "HTMLtoPDF_java.pdf");
Please feel free to contact us for any further assistance.
Best Regards,