We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Clone Table Rows & Resize Images in Word Document in Delphi Application running over Azure 2016 Data-center

this line of code:
Aspose.Words.Drawing.Shape image = builder.InsertImage(fileName);
is causing me some grief, but it’s complicated.

it will work on my system, and many other systems. it has been deployed to 15 client sites, as well as several internal systems, and it works fine on them.

it is called within a custom dll that has been developed over the past several years.

however…
it will NOT work on a virtual (azure) 2016 Datacenter machine.
It crashes so hard that exceptions are not caught - I have that code in a try catch block, the catch block is supposed to write the error message to a log file, and it’s not happening, I just get a kernalbase exception in the system event log.

it ALSO works when running in a standalone program, on that same machine.

Aspose version 19.9
.Net version 4.5.2
Full code (currently)
public void insertImage(string fileName, bool forceResize)
{
NoWordLogging nwl = new NoWordLogging();
NoWordLogging.writeLog(“Create builder”);
Aspose.Words.DocumentBuilder builder = new DocumentBuilder(m_Document.AsposeDocument);
NoWordLogging.writeLog("Builder created, create image from " + fileName);
try
{

            Aspose.Words.Drawing.Shape image = builder.InsertImage(fileName);
            NoWordLogging.writeLog("Image Created, resize image");
        }
        catch (Exception E)
        {
            NoWordLogging.writeLog(" exception :" + E.Message);

        }
        //           if (forceResize)
        //              resizeImage(image);
        //           m_Cell.FirstParagraph.AppendChild(image);           
    }

log file:
Create builder
Builder created, create image from C:\CompanyFiles_provantagesoftware\tmpImages\858_8547E9451282637E_11.tif

(and that’s it, that’s the entire log file)

edit: more:
I changed the code to the following:
public void insertImage(string fileName, bool forceResize)
{
NoWordLogging nwl = new NoWordLogging();
NoWordLogging.writeLog(“Create builder”);
Aspose.Words.DocumentBuilder builder = new DocumentBuilder(m_Document.AsposeDocument);
System.Drawing.Image dImage = null;
NoWordLogging.writeLog(“Builder created, create image from " + fileName);
try
{
dImage = System.Drawing.Image.FromFile(fileName);
NoWordLogging.writeLog(“Image Created, assign image”);
}
catch (Exception E)
{
NoWordLogging.writeLog(” exception :" + E.Message);

        }
        try
        {
            Aspose.Words.Drawing.Shape image = builder.InsertImage(dImage);
            NoWordLogging.writeLog("Image Created, resize image");
        }
        catch (Exception E)
        {
            NoWordLogging.writeLog(" exception :" + E.Message);

        }

        //           if (forceResize)
        //              resizeImage(image);
        //           m_Cell.FirstParagraph.AppendChild(image);           
    }

the builder.addImage is still blowing up.
my log results:
Create builder
Builder created, create image from C:\CompanyFiles_provantagesoftware\tmpImages\858_86804E1300B8A565_11.tif
Image Created, assign image
edit(again)
updated to Aspose.words version 19.12, and it is still broken

@conniem,

To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:

  • Your simplified input Word document
  • The Image file you are getting this problem with
  • Aspose.Words for .NET 19.12 generated output DOCX file showing the undesired behavior (if any)
  • Please also create a standalone simple Console or ASP.NET application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size.
  • Please also list the complete steps that we can perform on our end to be able to reproduce the exact problem.

As soon as you get these pieces of information ready, we will start investigation into your scenario and provide you more information. Thanks for your cooperation and reporting this problem to us.

well, since I can’t recreate in a standalone c# app, but CAN recreate in a smaller delphi application, that code is attached.
zip contentst: delphi application asposeTest.
noword.dll - com object wrapper
1.tif - the image I’m attempting to attach
test.dot - the word template
expected.docx - the results of running on NOT datacenter.(ran on my windows7 system)

there is no result when running ON datacenter 2016 because it blows up adding the image.AsposeTest.zip (6.8 MB)

@conniem,

We are checking this scenario on our end and will get back to you soon with our findings.

AsposeTest.zip (631.6 KB)

More notes:
the problem is somewhere in the cloneUDF procedure, or in setting the leftindent of the table after the cloneUDF procedure is called.

attached:
beforeUDF.docx - before the cloneUDF is called
(if clonedUDF is COMMENTED, no blowup, and I get a result)

afterUDFbeforeLeftIndent.docx - after cloneUDF, before I set the left indent

afterLeftIndentbeforeImage - just before I call insert image - this blows up consistently on 2016 datacenter.

afterUDFNoLeftIndent.docx - I commented the code that is setting the left indent
once I do this, then I no longer blow up on 2016 datacenter
// ActiveTable.AsposeTable.LeftIndent := tLeft;
//

noleftIndentbeforeImage - just before I call insert image, when left indent has been commented. this will work on 2016 datacenter.

result.docx - the result from 2016 datacenter, when leftindent is commented.

@conniem,

Thanks for the additional information. Please spare us some time for the investigation of this issue. We will get back to you with our findings soon.

by the way, I just had a client crash with that, they are running Windows server 2016 standard.

any progress with this?

@conniem,

We are preparing the required Delphi environment on Windows Server 2016 platform to simulate the environment as that of yours. As soon as everything is setup, we will test your scenario and post the results here for your kind reference. We apologize for your inconvenience.

Please also ZIP and share the COM object Wrapper .NET project (source code of NoWord.dll) here for our reference.

It would be great if you please also create a small video demonstrating the steps for reproducing the issue on our end.

Thanks for being patient and your cooperation.

attached is the delphi code and the executable, as well as the code for noword wrapper
as far as recreating the issue, start up asposetest.exe. press the button that says ‘Do It’.

AsposeTest.zip (6.5 MB)

NoWord.zip (88.1 KB)

@conniem,

Thanks for the additional information. I am afraid, I have not observed any errors on Windows 10. Please check, I managed to successfully produce following five documents on Windows 10 machine.

We will also check the scenario over Windows Server 2016 and post the results here soon for your kind reference.

@conniem,

You are right, the application crashes on Windows Server OS. We managed to observe this behavior on Windows Server VM machine on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-19962. We will further look into the details of this problem and will keep you updated on the status of the linked issue. We apologize for your inconvenience.

Like I said in my original post : very weird, very specific, not easily isolated

@conniem,

Your issue (WORDSNET-19962) is currently ‘pending for analysis’ and is in the queue. We will inform you via this thread as soon as this issue will be resolved or any further updates may be available in future. We apologize for your inconvenience.