Hi,
I am trying to convert an HTML to PDF. I am not getting any exception, but the pdf generated is empty.Can you please verify if the approach used is correct?
Code snippet.
String outputFileName;
public boolean convert(String fileName)
{
Document doc;
outputFileName = fileName + ".pdf";
try
{
doc = new Document(fileName, LoadFormat.HTML, null);
PdfOptions options = new PdfOptions();
options.setHeadingsOutlineLevels(3);
options.setExpandedOutlineLevels(1);
doc.saveToPdf(0, 1, outputFileName, options);
}
catch (Exception e)
{
System.out.println("Exception occurred while file conversion to pdf.");
e.printStackTrace();
}
return true;
}
I have attached the HTMl file. It has references to some images, but since i m able to attach only one file, i cant add those image files.
Thanks for your request. I cannot reproduce the problem on my side using the latest version of Aspose.Words for Java. I use the following code for testing:
Document doc = new Document("C:\\Temp\\HtmlThumb.html", LoadFormat.HTML, null);
PdfOptions options = new PdfOptions();
options.setHeadingsOutlineLevels(3);
options.setExpandedOutlineLevels(1);
doc.saveToPdf(0, doc.getPageCount(), "C:\\Temp\\HtmlThumb.pdf", options);
Hi,
I downloaded the latest zip Java 4.0.2 Beta. From that i am using the jar for jdk 1.5
But the pdf generated is still empty.i.e with a message
Evaluation Only. Created with Aspose.Words. Copyright 2003-2008 Aspose Pty Ltd.
In this case you will get all pages of your document. You use the evaluation version. If you would like to test Aspose.Words without the evaluation version limitations, you can request a 30-day Temporary License. Please refer to https://purchase.aspose.com/temporary-license