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

Free Support Forum - aspose.com

Image distorted while geting html using ASPOSE

Hi,

We are using Aspose.Words.dll version 10.5.0.0 to generate
word document by taking Aspose HTML from the input document. The input
document may have figures and tables.

when we convert input word document into html using ASPOSE it will provide all the html propely except image of attached input document.All parts of image in not coming proper or in others word image is distorted.

Please find the below code for your reference which we used for geting html of input word document.

string htmlText = string.Empty;
Aspose.Words.Document doc = new Aspose.Words.Document(filepath);
if (doc.Sections != null && doc.Sections.Count > 1)
{
    doc.Sections.RemoveAt(0);
    string lStrImageFolder = string.Empty;
    lStrImageFolder = FolderPath + "/" + ConfigurationManager.AppSettings["HTMLFileFolderName"].ToString();
    string tempDir = Path.Combine(Server.MapPath(lStrImageFolder));
    if (!Directory.Exists(tempDir))
        Directory.CreateDirectory(tempDir);
    Aspose.Words.Saving.HtmlSaveOptions saveOptions = new Aspose.Words.Saving.HtmlSaveOptions();
    saveOptions.ImagesFolder = tempDir;
    saveOptions.CssStyleSheetType = Aspose.Words.Saving.CssStyleSheetType.Embedded;
    saveOptions.SaveFormat = SaveFormat.Html;
    saveOptions.ImagesFolderAlias = ConfigurationManager.AppSettings["HTMLFileFolderName"].ToString();
    doc.JoinRunsWithSameFormatting();
    doc.ExpandTableStylesToDirectFormatting();
    MemoryStream htmlStream = new MemoryStream();
    doc.Save(htmlStream, saveOptions);
    htmlText = Encoding.UTF8.GetString(htmlStream.GetBuffer());
    htmlStream.Close();
    this.HTMLFilePath = FolderPath + "/" + ConfigurationManager.AppSettings["HTMLFileName"].ToString();
    StreamWriter sr = new System.IO.StreamWriter(Server.MapPath(this.HTMLFilePath), false, Encoding.Default);
    StringBuilder strStylePath = new StringBuilder();
    strStylePath.Append(htmlText);
    sr.Write(strStylePath.ToString());
    sr.Close();
}

So can you please help us on this problem or let us know what is the problem why this image in not coming proply in html

Thanks
Samanvay

Hi Samanvay,

Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 10.7.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. Your request has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for inconvenience.

Best Regards,

Hi,

Please let us know the approximate time you need to fix this issue. This issue is occuring in our production site so any quick help will be very helpful for us.

Thanks
Samanvay

Hi,

Thanks for your inquiry.

This issue is pending for analysis and is in the queue. Unfortunately, at the moment I cannot provide you any reliable estimate regarding this issue. However, you will surely be notified as soon as it is resolved.

We apologize for the inconvenience.

Best Regards,

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


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