Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Apr 26, 2017 2:41 pm

Hi,

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()

yogeshkad
 
Posts: 1
Joined: Wed Apr 26, 2017 2:30 pm

Thu Apr 27, 2017 2:11 am

Dear yogeshkad,

Thanks for your inquiry.
Spire.Doc support Azure cloud web app, but the conversion from word to image or other functions based on GDI is not supported, because GDI is not well supported on Azure Shared WebSite. So sorry for this.
If there is any good way to solve this issue in the futher, we will inform you.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc