Articles in this section
Category / Section

How to avoid generic error occurred in GDI+ while saving EMF image in Azure?

1 min read

Syncfusion Excel (XlsIO) library is a .NET Excel library used to create, read, and edit Excel documents. Using this library, you can manipulate Excel documents in Azure platform.

Azure platform does not support manipulation of images in EMF format. So, while using XlsIO in Azure platform, it will throw GDI+ exception when it comes across EMF images. To handle similar scenarios, XlsIO has an API called EnablePartialTrustCode to ensure whether XlsIO library is used in Azure. This will enable XlsIO to handle image manipulation according to Azure platform.

C#

ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
//For Azure platform
application.EnablePartialTrustCode = true;

 

VB.NET

Dim excelEngine As ExcelEngine = New ExcelEngine()
Dim application As IApplication = excelEngine.Excel
//For Azure platform
application.EnablePartialTrustCode = True

 

Learn more about Essential XlsIO through the documentation, where you will find features like importing and exporting in DataTable, appending multiple records to worksheet using Template Markers, exporting worksheet into CLR Objects etc., with respective code examples.

Refer here to explore the rich set of Syncfusion Excel (XlsIO) library features.

Note:

Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, include a license key in your projects. Refer the link to learn about generating and registering Syncfusion license key in your application to use the components without trail message.

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied