Storing images in Mhtml fails when images are not unique

This is a continuation of my problem mentioned here:
https://forum.aspose.com/t/33196

The part where the file was not correctly send through Mail has been resolved,

what remains is that Words will mangle the document if a single image is repeated several times.

I’ll repeat the most important comment of the other thread here:
I have created some example files:

  1. working.docx, when parsed this template will include an image in the email.
  2. broken.docx, when parsed, not a single image will be seen in the email
  3. parsed.mhtml, the raw bytes of the parsed template (broken.docx) as it is created by Words and will be loaded in Mail.
  4. InputDataSet, the dataset that will be loaded by the GetData(true) method.
  5. Relevant source files involved in parsing.

Notes:
Because of the inclusion of actual production code and data, the zip file is password protected.
(the password is contents of the subject field of this threat)

The file will be removed once I receive a reply.

The process starts at:

ParseWordTemplateOptions - line 121 - internal void SaveDocument

As you can tell ‘parsed.mhtml’ does include two images, but there should be an image on every row, there should be several different ones. When this file is send through Mail, the image placeholders are there.

I hope this information is sufficient.

Please advice on how to tackle this problem.
Greetings Bas.

Hi Wouter,


Thanks for your inquiry. I see that you’re using a very old version of Aspose.Words i.e. Aspose.Words for .NET 13.1.0.0; could you please upgrade to the latest version of Aspose.Words i.e. 14.6.0 and see how it goes on your end. You can download it from the following link:
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/default.aspx

I hope, this helps.

Best regards,

I had already upgraded the versions somewhere last week, though that may have been after creating the zipfile.

I have just checked anyway, but even with the latest version, the images are not visible.

Greetings, Bas.

Hi Wouter,


Thanks for the additional information. Unfortunately, at the moment, we’re not able to reproduce this issue on our end because some bits of code are missing from your shared code. We suggest you please create a standalone runnable simple console application that helps us reproduce the same problem on our end and attach it here for testing. As soon as you get this application ready, we’ll investigate the issue further and provide you more information. Thanks for your cooperation.

Best regards,

Hello,


A suicidal SSD disk decided to ruin my week by terminating its life unexpectedly, which is why it took me a little longer before I was able to create a reproduction for you.

It’s not a console application as I just copied the problematic webservice and then just removed all code not relevant to the problem…
Which is quite a bit faster than trying to reproduce the problem in a stand alone console.
Either way, it works and the problem is still there.

Notes:
) Broken.Docx is the file that contains the template, take a look at it BEFORE parsing,
as it attempts to highlight the problem areas. (The layout is screwed AFTER parsing, so that’s why you should look beforehand.)
) All Urls in the Data.xml file refer to images available on a public server and have been confirmed to exist at the moment of writing.
) When you press F5 to start the solution, you’ll be taken to the main/only asmx that’s in the project, and it contains only one method, which should be invoked to reproduce the problem.
) It will automatically open the parsed file, to make inspection of the results easier.
) The Broken.Docx is parsed twice by the code, this enabled us to exclude ‘table-start/end’ markers in the template for simple scenarios (keeping with the idea that simple things should be simple):
a) the first time it is parsed with the original hierarchal dataset.
b) second time with a flattened copy of the dataset where all the tables are merged into one
and only the first row of the table is used.
) The zip is password protected, it’s the id of the post that I am replying to right now 5…7.

If you need any more information / assistance, please let me know.
Please note that we are using a company account, and that I am actually
Bas and not Wouter.

Also, not related:
if you go to the login page, and just immediately hit the OpenId login button, (and y7ou are not actually an OpenId user)…
Then you will receive a nasty asp.net error message.

Greetings,
Bas.

Hi Bas,

We are testing the issue at our end and will get back to you soon. Sorry for the inconvenience.

Best Regards,

Hi Bas,


Thanks for being patient. Does this problem occurs only when exporting to MHTML or it occurs even when converting to DOCX format?

Please find attached a couple of simplified input/output documents, when executing the following two lines of code, Aspose.Words does not preserve images in output MHTML. I have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-10477. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Document doc = new Document(MyDir + @“in-simplified.docx”);

doc.Save(MyDir + @“out.mhtml”);


Best regards,

Hi,


I am slightly confused, are you waiting for feedback on these files?

Greetzing.
(Sorry, we’ve been very busy with other work.)

Hi Bas,


Thanks for your inquiry.
Bas:
As you can tell ‘parsed.mhtml’ does include two images, but there should be an image on every row, there should be several different ones. When this file is send through Mail, the image placeholders are there.
After an initial analysis, it seems the problem occurs because these invisible images have zero height. We will inform you via this thread as soon as WORDSNET-10477 is resolved. We apologize for your inconvenience.

Best regards,

Hi,


I am inquiring as to the status, we have a release coming up in the next 3 weeks, and we need to know whether we can make this feature part of the release or not.

Kindly awaiting your reply,
Bas.
Hi Bas,

Thanks for your inquiry. I would like to share with you that issues are addressed and resolved based on first come first serve basis. Currently, your issue is pending for analysis and is in the queue. We will update you via this forum thread once there is any update available on your issue.

Thank you for your patience and understanding.

It’s been quite a while,
any news?

Hi Bas,

Thanks for your inquiry. I have verified the status of WORDSNET-10477 from our issue tracking system. Currently, this issue is under 'In Review' phase. Hopefully, the fix of this issue will be available in April 2015 release (v15.4.0). Please note that this estimate is not final at the moment. We will update you via this forum thread once this issue is resolved.

We appreciate your patience.

The issues you have found earlier (filed as WORDSNET-10477) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.