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.

Thu Apr 21, 2016 12:53 pm

Hi all,
I am running Spire.Office version=2.13.4 targetFramework=net452 and trying to turn a .docx file into an array of bitmaps. Quite simple code actually:

Code: Select all
   public WordDocV2(Stream memoryStream, FileName attachmentFileName)
        {
            Logger.Debug("Converting Word to Images");
            SpireDoc.Document doc = new SpireDoc.Document(memoryStream, SpireDoc.FileFormat.Auto);
         
// Blows up here  \/   \/
            Image[] images = doc.SaveToImages(ImageType.Bitmap);
            Images = new List<BitmapMetaData>();
            foreach (var image in images)
            {
                var meta = BitmapHelper.SaveTempBitMap((Bitmap) image, false);
                Images.Add(meta);
            }
}


it churns on this for about 30 seconds and keeps allocating memory until it finally blow up with this error:

An unhandled exception of type 'System.StackOverflowException' occurred in System.Drawing.dll
It looks like a loop of some sort....
I am able to look at the docx file in Word without any problem.

Thoughts?

TalMcMahon
 
Posts: 7
Joined: Thu Apr 21, 2016 12:40 pm

Fri Apr 22, 2016 3:22 am

Hi,

Thanks for your posting.
To help us replicate and investigate your issue, please share your .docx file. You can also send it to amy.zhao@e-iceblue.com.
Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc