Given sample file is portion of main file which we want process with Aspose.words library methods,
it got stuck on calling below method, in code,
LayoutEnumerator enumerator = new LayoutEnumerator(document);
on initial investigation we found that, the page contains image is corrupted one, but still we are expecting Aspose.Words library should have safe exit & give proper error message but it got stuck for infinite time, it also affected CPU usage & memory.
Kindly look into this, we are expecting inbuilt handelling and stack trace with exit on error for this scenario.
PFA.
Fig7.docx (100.5 KB)
@ELSSAM_elsevier_com Unfortunately, I cannot reproduce the problem on my side using the latest 24.1 version of Aspose.Words. Please try using the latest version on your side and let us know if the problem still persists. And if the problem is still reproducible on your side, please provide full code required to reproduce the problem on our side.
@alexey.noskov I have tested with latest version still same issue, here is sample programme, i have used to test 24.1 version.
pom.xml
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>24.1</version>
<classifier>jdk17</classifier>
</dependency>
App.java
import com.aspose.words.Document;
import com.cp.utils.AsposeUtils;
public class App {
public static void main(String[] args) throws Exception {
String licenseContent = args[0];
String submissionFilePath = "tempFolder/Fig7.docx";
// Load Aspose License
AsposeUtils.setAsposeWordLicense(licenseContent);
Document document = new Document(submissionFilePath);
System.out.println("Started updatePageLayout() ! ");
document.updatePageLayout();
System.out.println("Completed updatePageLayout() ! ");
}
}
it gets stuck after printing => Started updatePageLayout() !
@ELSSAM_elsevier_com The problem is still not reproducible on my side. As I can see your document contains TIFF image. TIF format is not directly supported by Aspose.Words. To process TIF images you should add additional dependencies:
https://docs.aspose.com/words/java/system-requirements/#optional-dependencies
You can try adding the following to the POM file:
<dependency>
<groupId>javax.media.jai</groupId>
<artifactId>com.springsource.javax.media.jai.core</artifactId>
<version>1.1.3</version>
</dependency>
Thanks @alexey.noskov for this suggestion, it is working as expected, Sorry late for reply.
1 Like
The issues you have found earlier (filed as WORDSJAVA-2920) have been fixed in this Aspose.Words for Java 24.3 update.