Saving Documents - Sending Document to a Client Browser

Hello,
I am currently evaluating the Java version of Aspose.Words.
I note that the ‘save’ method within the .NET version allows the sending of the document to the client browser (OpenInWord / OpenInBrowser) but that this is not possible in the Java version.
Is this feature likely to be implemented in the Java version in the near future?
Thanks,
Eric.

Sending output to browser in the .NET version is possible because .NET provides “standard” classes such as HttpResponse etc. I’m not sure whether there is something like this in standard Java libraries, our Java developers will investigate.
In general, you can do that youself without any problems. You just need to save to the HTTP response stream and that’s it. You have Document.save(OutputStream), use it to save wherever you want it.

Is there any way I can display the newly created document directly to the user without running in a Servlet?

Hi, Eric,
We decided that analog for .Net Document.Save(…,HttpResponse response) method not needed in Java because 1) in .Net it is purely a convenience method and 2) .Net is much more monolithic platform in terms of access to a web. You the first who noticed the absence of this method and with few additional requests we will return the method to Java:)
You can find an example inside the Web demo project (demos\Aspose.Words.Demos.Web\ folder inside the Aspose.Words for Java download zip) – check DemoServlet.sendToBrowser() method and you will see two strings that needed to redirect Aspose.Words-generated document to a client’s browser:

response.setContentType("application/msword");
doc.save(response.getOutputStream(), SaveFormat.FORMAT_DOCUMENT);

You can’t get a ServletResponse object (and therefore dynamically send something directly to a client’s browser) without using some kind of servlet container, imo. Or you just want to open the document in a local computer?
Best Regards,