We are using this product in our application. everything was working well on the our VPS server. now when we are moving to Azure cloud web app. we are getting GDI+ error.
error is coming when user is uploading MS word file and application converting it to images. same code is working on local dev enviourment. also on same azure web app site if user upload pdf file then code is able to convert pdf to image using Spire.pdf reference.
we are using version 5.5.141.3035
Sample code is
- Code: Select all
Spire.License.LicenseProvider.SetLicenseFileName("Spire_license_elic_doc.xml");
try
{
List<MarkupImageDetails> files = new List<MarkupImageDetails>();
Document doc = new Document();
if (fileExtension == ".doc")
{
doc.LoadFromFile(Filepath, Spire.Doc.FileFormat.Doc);
}
else
{
doc.LoadFromFile(Filepath, Spire.Doc.FileFormat.Docx);
}
Below is details error message in Azure web app
Error Message:A generic error occurred in GDI+.
Stack Trace: at System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, String description)
at System.Drawing.Imaging.Metafile..ctor(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type)
at spr?.?(PageSetup A_0, ImageType A_1, MemoryStream A_2, Int32 A_3, GraphicsUnit A_4)
at spr?.?(PageSetup A_0, ImageType A_1, MemoryStream A_2, Int32 A_3)
at spr?.?()
at spr?.?(Document A_0)
at Spire.Doc.Document.?()
at Spire.Doc.Document.get_PageCount()