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

OutOfMemory exception during WordToPdf in combination with embedded word documents

Using the latest verison of syncfusion, when trying to convert a word document to pdf, an OutOfMemoryException is thrown.
Is this type of document supported ?
Note : the exception only happens when the application is deployed to an Azure environment (and seems to run fine on our local machine)
System.OutOfMemoryException: Out of memory.
   at System.Drawing.Image.Clone()
   at Syncfusion.Pdf.Graphics.PdfMetafile.Save()
   at Syncfusion.Pdf.Graphics.PdfGraphics.DrawImage(PdfImage image, Single x, Single y, Single width, Single height)
   at Syncfusion.Pdf.Graphics.PdfGraphics.DrawImage(PdfImage image, RectangleF rectangle)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.DrawInlinePictureShape(WPicture picture, RectangleF bounds, SizeF size, Image image)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.DrawPicture(WPicture picture, LayoutedWidget ltwidget)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(IWidget widget, LayoutedWidget layoutedWidget)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(LayoutedWidget layoutedWidget, Boolean isHaveToInitLayoutInfo)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(LayoutedWidget layoutedWidget, Boolean isHaveToInitLayoutInfo)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(LayoutedWidget layoutedWidget, Boolean isHaveToInitLayoutInfo)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(LayoutedWidget layoutedWidget, Boolean isHaveToInitLayoutInfo)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(LayoutedWidget layoutedWidget, Boolean isHaveToInitLayoutInfo)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(LayoutedWidget layoutedWidget, Boolean isHaveToInitLayoutInfo)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(LayoutedWidget layoutedWidget, Boolean isHaveToInitLayoutInfo)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(LayoutedWidget layoutedWidget, Boolean isHaveToInitLayoutInfo)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(LayoutedWidget layoutedWidget, Boolean isHaveToInitLayoutInfo)
   at Syncfusion.DocToPdfConverter.Rendering.PDFDrawingContext.Draw(Page page)
   at Syncfusion.DocToPDFConverter.DocToPDFConverter.DrawDirectWordToPDF(DocumentLayouter layouter)

Attachment: syncfusionembeddedword_1d5f92ab.zip

1 Reply

PK Prakash Kumar D Syncfusion Team December 4, 2018 08:41 AM UTC

Hi Bart, 
 
Thank you for contacting Syncfusion support. 
 
On further analyzing the given Word document, we have found that embedded Word document is used as EMF image. Currently, the metafile images (*.wmf, *.emf) in Word document are not supported while converting to PDF in Azure environment which is already a known limitation. We have considered this exception problem at our end and will provide fix to skip the exception to convert the given Word document as PDF. This fix will be included in our 2018 Volume 4 SP1 release which is expected to available at the end of January 2018 tentatively. 
 
Please refer the below KB to know more about known limitation Azure environment while converting Word document as PDF: 
 
Regards, 
Prakash Kumar 


Loader.
Live Chat Icon For mobile
Up arrow icon