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

Free Support Forum - aspose.com

Not able to open PDF file generated while server is running

Hi

I am using aspose.words to convert html to pdf file.

Please find html and code to invoke aspose words library here.

 

Tier</t

 

Tier Tier Value Rate
<= 100% 3%
> 100% 5%

 SignHere  

h>
Tier Value Rate
<= 100% 3%
> 100% 5%

 SignHere  



API that calls Aspose Words

public static void generateAsposePDFFromHtml(String html) throws Exception {
HttpURLConnection urlConnection = null;
ByteArrayInputStream input = new ByteArrayInputStream(html.getBytes(“UTF-8”));
com.aspose.words.LoadOptions loadOptions = new com.aspose.words.HtmlLoadOptions();
loadOptions.setLoadFormat(com.aspose.words.LoadFormat.HTML);
loadOptions.setEncoding(Charset.forName(“UTF-8”));
com.aspose.words.Document doc = new com.aspose.words.Document(input, loadOptions);
File localFile = new File(“AsposePDF.pdf”);
BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(localFile));
//out = new ByteArrayOutputStream();
doc.save(outputStream, com.aspose.words.SaveFormat.PDF);
}


Is there any connection that I need to close after generating PDF document?

PDF is accessible only if I stop application server.

Thanks

I did add , outstream close and instream close and it is opening now with out stopping server.


Hi there,


Thanks for your feedback. It is good to know that you have managed to resolve the issue at your end.

Please keep using Aspose.Words and feel free to contact us for any further assistance.

Best Regards,