Hello,
We are using aspose words for java version 19.3 with java 8 environment.
I noticed that when trying to encrypt a document the save time is very long and random.
Sometime its a second and sometimes its 5 minutes.
I ran the following code 3 times:
private void testEnc(int attempt) {
System.out.println("attempt: " + attempt);
String pass = "12345";
try {
System.out.println("load start: " + new Date().toString());
Document doc = new Document("/tmp/enc.docx");
System.out.println("load end: " + new Date().toString());
OoxmlSaveOptions sa = new OoxmlSaveOptions();
sa.setPassword(pass);
System.out.println("save start: " + new Date().toString());
doc.save("/tmp/enc" + attempt + ".docx", sa);
System.out.println("save end: " + new Date().toString());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
with the following output:
attempt: 1
load start: Sun Mar 24 13:14:01 IST 2019
load end: Sun Mar 24 13:14:02 IST 2019
save start: Sun Mar 24 13:14:02 IST 2019
save end: Sun Mar 24 13:15:20 IST 2019
attempt: 2
load start: Sun Mar 24 13:15:20 IST 2019
load end: Sun Mar 24 13:15:20 IST 2019
save start: Sun Mar 24 13:15:20 IST 2019
save end: Sun Mar 24 13:17:00 IST 2019
attempt: 3
load start: Sun Mar 24 13:17:00 IST 2019
load end: Sun Mar 24 13:17:00 IST 2019
save start: Sun Mar 24 13:17:00 IST 2019
save end: Sun Mar 24 13:18:35 IST 2019
As you can see its 1:18 for 1st attempt, 1:40 for the second and 2:35 for the third.
The enc.docx document is almost empty contains only one sentence.enc_problem.zip (7.3 KB)
I uploaded the tested document.
Execute it several times because as I said it is random and it can work either fast or get stuck forever.