Aspose.Words Mailmerge on Includepicture not always working after changing from v 22.6 to v 22.7

Hi Aspose Support

We are using Aspose.Words mailmerge in our application to produce documents using existing .Docx documents as main documents for the mailmerge.

We are updateing Aspose.Words frequently and have reached beyond version 22.6.0 but found that version 22.7 and newer has a breaking flaw

We are using this Includepicture construct:

{ INCLUDEPICTURE { MERGEFIELD Department_Picture \* MERGEFORMAT } \* MERGEFORMAT }

The construct itself Works fine, but from v. 22.7.0 and forward the image in the resulting document is not fetched when it is in this format.

"https://portal.eseebase.com/floorplan/5181080/01/01/1088"

It is, however, fetched when in this format (in all versions:
"https://egbolig.dk/kunder/ththo/Test.png"

This is really a problem for us, as our customers depend on this to work.

We hope that you can do something about it, so that we continue using your, product.
I have added (or will add) a .net c# solution that replicates the scenario.

The application is attached in the zip file AsposeWordsTest.zip.

Also attached are:

  1. A word document that explains the application: GuideToAsposeWordsTest.docx (in a zip)
  2. A zip file (ExamplesOfWrongAndRightResultingDocuments.zip) containing Word and Pdf files that are the result of Aspose.Words mailmerges
    Two documents (a Word and a pdf that shows the expected behavior: ExpectedResult_produced_by_version_22_6.Docx and ExpectedResult_produced_by_version_22_6.Pdf
    Two documents (a Word and a pdf that shows wrong behavior:
    WrongResult_produced_by_version_22_7_To_version_22_11.Docx WrongResult_produced_by_version_22_7_To_version_22_11.Pdf
    NB - we are now using Aspose.Words version version 22.6.0.0 because we can’t update to newer versions as long as this behavior is present (license Aspose.Total.Net.Lic)

AsposeTests.zip (60.2 KB)
ExamplesOfWrongAndRightResultingDocuments.zip (316.0 KB)
GuideToAsposeWordsTest.zip (12.1 KB)

@StenBille Thank you for reporting the problem to us. I have logged it as WORDSNET-24568. We will keep you updated and let you know once the issue is resolved or we have more information for you.

@StenBille We have completed analysis of the issue. The problem occurs because the portal.eseebase.com remote server does not follow http spec and fails with valid header values. You may use following code snippet to workaround server issue:

doc.ResourceLoadingCallback = new ResourceLoadingCallback();
public class ResourceLoadingCallback : IResourceLoadingCallback
{
    public ResourceLoadingAction ResourceLoading(ResourceLoadingArgs args)
    {
        if (!args.OriginalUri.StartsWith("https://portal.eseebase.com", StringComparison.OrdinalIgnoreCase))
            return ResourceLoadingAction.Default;

        args.SetData(new WebClient().DownloadData(args.OriginalUri));
        return ResourceLoadingAction.UserProvided;
    }
}

Thank you for your answer - we will try out your temporary solution suggested by the code you provided.
When do you expect to have implemented handling of the circumstances in the normal functionality? (so that we do not need a ResourceLoadingCallBack class for this specific situation)

@StenBille Unfortunately, the issue is not yet scheduled for development. We will keep you updated and let you know once the issue is resolved or we have more information for you.