Thank you for your interest in Syncfusion products.
Essential DocIO uses GDI+ functionalities for converting a Word document to PDF. Whereas some of the GDI+ functionalities are not supported in Windows Azure websites and this is known limitation in Windows Azure environment. Hence the mentioned error is thrown while deploying the Word to PDF conversion in Azure websites. As a workaround, kindly use Azure cloud services to convert Word documents to PDF and call this service from Azure web site.
Please let us know if you have any other questions.
Greetings from Syncfusion.
From the given details, we suspect that the input Word document contains metafile images. 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 already considered this exception problem at our end and will provide fix to skip the exception to convert the given Word document as PDF. The fix will be included in our 2018 Volume 4 SP1 release which is expected to be rolled out in February 2019.
Also, could you please provide us the input Word document which used at your end. Thereby, we will check and provide you the confirmation whether the reported problem will be fixed in 2018 Volume 4 SP1 release.
Note: If you have any confidential data in your Word document, please replace with some dummy data and provide us the same. We just need your document to recreate the problem you face.
I'm using Syncfusion.DocToPdfConverter.ClientProfile (version 126.96.36.199) to convert a Word document in PDF.
Code runs in a Dynamics 365 CE plugin (cloud hosted).
I'm getting this error:
System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: A generic error occurred in GDI+. (Fault Detail is equal to Exception details:
Message: A generic error occurred in GDI+.
There are no images in the Word document, just plain text and some tables.
The GDI+ eception should be fixed, as described in previous posts. So what's causing this exception?
The previous updates and solutions in the forums are related to Support for Word to PDF conversion in Azure environment.
But you are facing the problem in a Dynamics 365 CE plugin (cloud hosted). We have already analyzed about the Word to PDF conversion feasibility in this environment and found that Microsoft Dynamics has limited support for GDI+. So Word to PDF conversion is not supported in Microsoft Dynamics using DocToPDFConverter (internally used GDI+) which is already a known limitation.
To resolve this problem, we suggest you to use the Syncfusion.DocIORenderer.Net.Core NuGet package in which internally we used the SkiaSharp library to convert a Word document to PDF and provide us confirmation whether the reported problem gets resolved or not using this solution.
Refer the below code snippet to convert Word to PDF using DocIORenderer.
//Open the existing Word document.
using (WordDocument wordDocument = new WordDocument(inputDocumentStream, FormatType.Automatic))
//Create an instance of DocIORenderer.
using (DocIORenderer renderer = new DocIORenderer())
//Convert Word document into PDF document.
using (PdfDocument pdfDocument = renderer.ConvertToPDF(wordDocument))
//Save the PDF.
MemoryStream pdfStream = new MemoryStream();