We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Converting large .docx to pdf

Thread ID:





142517 Feb 7,2019 11:44 AM UTC Feb 11,2019 12:09 PM UTC ASP.NET MVC 3
Tags: DocIO
Asked On February 7, 2019 11:44 AM UTC

I am using the following code to convert a docx to pdf:
PdfDocument pdfDocument = new PdfDocument();
string filePath = Server.MapPath(new Uri(fileName).LocalPath);
if (fileName != null)
string fileExt = Path.GetExtension(fileName).Replace(".", "").ToUpper();
if (fileExt == EFileExtension.DOC.ToString() || fileExt == EFileExtension.DOCX.ToString())
DocToPDFConverter converter = new DocToPDFConverter();
Stream readFile = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
pdfDocument = converter.ConvertToPDF(readFile);
However when the size of the docx file is above 2mb, I am getting an out of memory error.
Any help please?

Dilli Babu Nandha Gopal [Syncfusion]
Replied On February 8, 2019 06:54 AM UTC

Hi Alis, 

Thank you for contacting Syncfusion support. 

We suspect that the reported issue might be document specific i.e., elements presented in the document. So, kindly share us the issue causing input document which will be helpful for us to provide you a prompt solution at the earliest. 

If you have any confidential data in your Word document, please replace with some dummy data and provide us the same or send to support@syncfusion.com by mentioning this forum. We just need your document to recreate the problem you face. 

Dilli babu. 

Replied On February 8, 2019 07:34 AM UTC

Hello Dilli,

I have attached the word document.  

Also the error message I am getting is:
System.OutOfMemoryException occurred
  Source=<Cannot evaluate the exception source>
<Cannot evaluate the exception stack trace>

Thank you for your help.

Attachment: Syncfusion_ee4bb9af.7z

Vijay Ramachandran [Syncfusion]
Replied On February 11, 2019 12:09 PM UTC

Hi Alisha,

Thank you for your details.

We are unable to reproduce the reported OutOfMemoryException issue while converting the given Word document as PDF. Please find the project which we have used at our end to reproduce the issue from below.

Please find the machine configuration:
Windows 10 
8 GB 
Intel Core I5 
Visual Studio version 
Project target mode 
Product version 

Could you please provide us your machine configuration along with the product version details? Thereby we can setup the same environment and reproduce the issue.

Vijay R


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon