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

Free Support Forum - aspose.com

Aspose.pdf PDF to HTML conversion giving error

Hi,


I am trying to convert PDF input stream to HTML and then saving it to ByteArrayOutputStream.
And I am getting following error for above conversion.

Save a document to a html stream is not supported. Please use method save to the file.

My code is as follows,

final ByteArrayOutputStream dstStream = new ByteArrayOutputStream();

// here ‘docInputStream’ is the InputStream of PDF document.

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(docInputStream);

pdfDocument.save(dstStream, new HtmlSaveOptions());

final ByteArrayInputStream srcStream = new ByteArrayInputStream(dstStream.toString(“utf-8”).getBytes(Charset.forName(“utf-8”)));

return srcStream;


Is saving document to HTML stream not supported by Aspose ? If yes, is there any workaround to deal with this ?

Hi Kalpesh,


Thanks for your inquiry. As stated in error message, I am afraid subjected feature is not supported at the moment. However we have logged an issue PDFNEWJAVA-33956 in our issue tracking system for same. We have plan to implement it in near future. We will update you via this forum thread as soon it is implemented and gets available for download.

We are sorry for the inconvenience caused.

Best Regards,