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


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

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




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


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


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


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,