Images in HTML are not rendering in documents

We have few images in sharepoint Picture document library. while genrating the report, we are converting the entire report to an HTML format as below giving this HTML as input to Aspose.words.
The images in this HTML are not rendering if we not enable the Ananymouns access at web application level.

<br />
<table border='1' cellspacing='0' cellpadding='2' width='100%'>
    <tr>
        <td align='left'>
            "COLOMBIA -- country-specific regulatory strategy" - Development Strategy
        </td>
        <td align='right'>
            GRS
        </td>
    </tr>
</table>
<table border='1' cellspacing='0' cellpadding='2' width='100%'>
    <tr>
        <td align='right'>
            Last Modified on 15-AUG-2012 12:59 PM by Jinka, Ramakrishna
        </td>
    </tr>
</table>
<br /><b>        EXECUTIVE SUMMARY<br /></b>
<br />
<img alt="test" src="http://amrcldw182:4533/Lists/GRSLGImageLibrary/Tofacitinib%20Citrate%20Chemical%20Structure%20of%20CP-690%20550-10.jpg" />Test is success
<br />
<br />

If you have find any solution then please let us know the solution.

Hi Ramakrishna,

Thanks for your inquiry and sorry for the delayed response. I am afraid, currently there is no way you can set network credentials using Aspose.Words. I have linked your request to appropriate feature (WORDSNET-927) in our issue tracking system. You will be notified as soon as this feature is supported. Sorry for the inconvenience.

Moreover, in the mean time, you may want to use the following code snippet as a temporary work around:

public class ImageLoadingWithCredentialsHandler : IResourceLoadingCallback
{
    public ImageLoadingWithCredentialsHandler()
    {
        mWebClient = new WebClient();
    }
    public ResourceLoadingAction ResourceLoading(ResourceLoadingArgs args)
    {
        if (args.ResourceType == ResourceType.Image)
        {
            Uri uri = new Uri(args.Uri);
            if (uri.Host == "www.aspose.com")
                mWebClient.Credentials = new NetworkCredential("User1", "akjdlsfkjs");
            else
                mWebClient.Credentials = new NetworkCredential("SomeOtherUserID", "wiurlnlvs");
            // Download the bytes from the location referenced by the URI.
            byte[] imageBytes = mWebClient.DownloadData(args.Uri);
            args.SetData(imageBytes);
            return ResourceLoadingAction.UserProvided;
        }
        else
        {
            return ResourceLoadingAction.Default;
        }
    }
    private WebClient mWebClient;
}

I hope, this will help.

Best Regards,

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

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