We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Empty PDF generated while converting HTMl to PDF using aspose words for java


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();



doc.saveToPdf(0, 1, outputFileName, options);

} catch (Exception e) {

System.out.println("Exception occurred while file conversion to pdf.");



return true;


I have attached a rar containing the HTML, the images it refers to and the empty PDF that it is generating.


<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I just answered this question here:


Best regards,