Free Support Forum - aspose.com

OutOfMemoryException when converting large doc file into PDF

Hi,

We are using Aspose to convert DOC files to PDF files and then to merge the generated PDF files into one PDF file.

The problem:

When at least one of the DOC files is large (>50 MB) we start getting OutOfMemoryException specially when running the code for the second time.

The code dies Here :

Document doc = new Document(fileName);

doc.Save(fileName + ".pdf", SaveFormat.Pdf); // exactly here

return fileName + ".pdf";


looks like it tries loading the whole file into the memory before converting it to PDF. Is there a way to improve the code to fix this ?

Thanks in advance !

Hi there,

Thanks for your inquiry. Please try latest version of Aspose.Words for .NET 16.11.0.

If you still face problem, please ZIP your input document, upload it to Dropbox and share the download link here for testing. We will investigate the issue on our end and provide you more information.