I’m trying Aspose.Words for Android with the restricted evaluation version (free download). Unfortunately, I have problems already when trying the simplest examples: whenever saving a document (be it read from an existing file or a newly created one), a file is created with the name I specify, but this file is empty (0 bytes). The problem occurs with .docx, .doc, and .txt files; I haven’t tried other formats yet.
Here’s the code of one example which doesn’t work:
Document doc = new Document(); DocumentBuilder docb = new DocumentBuilder(doc); docb.writeln("Test"); FileOutputStream stream = new FileOutputStream("/sdcard/Documents/FormatTest.doc"); doc.save(stream, SaveFormat.DOC); stream.close();
No exception is thrown, and I can’t find anything helpful in the logs.
It doesn’t seem to be a problem related to permissions or other general Android storing issues: when I write a bunch of bytes directly to the FileOutputStream with stream.write(…), the bytes are written correctly.
I’m using Android 9 and Aspose.Words v. 20.9.0.
Thank you very much in advance for any help!