I have sample large MS Word document (attached) that fails ToPDF conversion with following error:
at Syncfusion.Drawing.SkiaSharpHelper.Graphics..ctor (Syncfusion.Drawing.SkiaSharpHelper.Image image) [0x0004d] in <9830945476f34c658431c5c678b14bc7>:0
at Syncfusion.DocIORenderer.DocIORenderer.DrawDirectWordToPDF (Syncfusion.DocIO.DLS.Rendering.DocumentLayouter layouter) [0x000c7] in <74740658f7ce4bdab24bbaf90f722b8b>:0
at Syncfusion.DocIORenderer.DocIORenderer.ConvertToPDF (Syncfusion.DocIO.DLS.WordDocument wordDocument) [0x000c7] in <74740658f7ce4bdab24bbaf90f722b8b>:0
at Syncfusion.DocIORenderer.DocIORenderer.ConvertToPDF (System.IO.Stream stream) [0x00009] in <74740658f7ce4bdab24bbaf90f722b8b>:0
at company.OfficeConverter.OfficeConverter.WordToPdf (System.String filePath) [0x0008b] in company.OfficeConverter/OfficeConverter.cs:54
After that any subsequent call to render.ConvertToPDF(docStream) fails with OutOfMemoryException. I'm afraid that multiple conversions of smaller documents can do the same if the DocIO is leaking memory.
Sample code and document are attached to this post.
Could also be nice to have parameter to limit amount of pages to convert.
Hello Lokesh,
The sample you've provided works fine.
When I isolate my code it also seems to be working. I have created new page with only single UI button and then it works but when there are more UI elements the code crashes. I will try to replicate the problem in your sample and send it.
Regarding the limiting parameter:
I think it could be done as a DocIO Renderers' ConvertToPDF parameter - renderer could stop after it finishes X page. When rendering process is happening it is known how many pages have already been completed.
I am using latest version available today - 19.4.0.47