Free Support Forum - aspose.com

Saving document to Java OutputStream

We’re currently evaluating Aspose.Words (in addition to Aspose.Slides) for several report generation tasks.

Aspose.Slides supports a presentation.write(outputStream) which is good as we can stream that directly from our servlet and the API seems to provide the functionality we think we’ll need.

Aspose.Words supports a variety of save methods, of which document.save(Stream, int) seems likely. However, that class is obfuscated and there’s no reference to it from the API. Is it possible to save a document directly to a stream - we don’t want to have to create a document on the server filesystem just to read it back again to stream.

This raises another point - the API “documentation” for both products is extremely sparse - much guesswork is required to identify which class to use for constants and even how to use the API in general. Why is this all so poorly documented? Do you actually get better docs when you buy a licence or is this all there is?

Hi, Ranulf!



Thank you for your interest.



Aspose.Words for Java will support Document.save() to java.io.OutputStream in the next release, that will be published in the begin of the next week. If you have other suggestions about of what core java IO classes we need to support in Aspose.Words for Java - always welcome.



About apidoc for Aspose.Words for Java – it is still under construction. We scheduled to close it in this month. The 95% of docs are the same in Net and Java versions of Aspose.Words. So we decided to maintain single source of docs + little (but intelligent:) engine that will generate javadoc from this source. Additionally, there are many small but annoying issues that we can’t address by standard javadoc. For instance, you mentioned the huge amount of constants that will clutter up entire javadoc – in new doc we moving them into separate section, independently of package name. So we hope that new documentation will be much more useful than standard javadoc.



Best Regards,

You are right that "int" in document.save(String, int) is an enumerated value, but in the Java version represented as an integer constant. We are making sure the references to the proper classes that define the constants are included everywhere in the API documentation.

Added Document.Save to OutputStream in Aspose.Words for Java 1.0.1.