I’m using Aspose behind a Jersey REST Web Service.
I’m having problems with com.aspose.words.FileFormatUtil.detectFileFormat(InputStream). This works but when I then pass the InputStream to com.aspose.words.Document(InputStream) and call com.aspose.words.Document.save(OutputStream, SaveFormat). I get an empty pdf created.
If I leave out the call to detectFileFormat then save part works. It’s only when I call detectFileFormat then save that I get empty pdf documents.
Since Java 1.5 (2005), so over a decade ago https://docs.oracle.com/javase/1.5.0/docs/api/java/io/InputStream.html
.
It has three methods markSupported(), reset() and mark(marklimit). The idea is before using the InputStream you say how many bytes your about to read, then when you call reset() the pointer in the stream returns to where you marked. Any chance your able to update your code as this might be a critical issue to use to use Aspose.