We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ASPOSE Word not able to covert huge text file (>50MB) to PDF


We are trying to convert a huge text file > 50 MB into PDF.

Code ===
License wordsLicense = new License();


Document doc = new Document(“Test.txt”);


We are getting Java heap error.

Should we split the text files in smaller file and then covert to PDF?



Thanks for your inquiry. Please note there is no limitation of file size in Aspose.Words. Aspose.Words processes files in memory, so file size limitation for processing depends upon your system resources. Aspose.Words needs 10 times more memory than the original document size to build a DOM in the memory.

So it seems you are getting issue because your IDE Java heap space might not be enough for high memory spikes when processing large documents. In this case, the easy way to workaround is to increase the heap space for the JVM. You may increase JVM heap settings to -Xmx4G -Xms4G. It will work in most of the cases.

However, if the issue persists then please share your source file. You may share your file via some free file sharing service e.g. Dropbox, Google drive etc. We will look into the issue and will guide you accordingly.

A post was split to a new topic: Convert TXT to PDF