while converting a docx file in pdf file using Aspose i got this heap size
error.here is the code
this docx file is 44Mb
public void convertDoc(String Path, String destPath) throws Exception{
Document doc = new Document(Path); //At this line heap size error comes
doc.save(destPath);
System.out.println("doc converted to pdf");
}
Any suggestions?
Increasing the heap size should fix the issue.
If it doesn't, then check if you have high resolution images in your Word document. I have converted very large DOC files to PDF (without high res images) under 512 MB memory. But, some of the documents, even less than 50 pages, but having large sized images, they require large memory, even upto 3GB!!
Possible solutions:
I work as a Developer/Evangelist at Aspose.
Since you are loading a document larger than the heap size you will have to increase the heap size while running the program like this
java -Xmx512M myprogram
If you are using eclipse go to Run -> Run Configurations
and under Arguments Tab type -Xmx512m and click on RUN
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.