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

Free Support Forum - aspose.com

Missing 'ImageSaving'-Property in HtmlSaveOptions

With
reference to your Release Notes for 9.2.0 Aspose Words I could not find
the property ‘ImageSaving’ in the class ‘HtmlSaveOptions’.

So
how should I have to change the code to get the same result.

private static Dictionary<string, MemoryStream> mImagesList = new Dictionary<string, MemoryStream>();

public static MemoryStream ConvertDocToZippedHtml(Document doc)
{

//Create memory stream where output zip file will be stored

MemoryStream zipStream = new MemoryStream();

//Create zip archive

ZipOutputStream zip = new ZipOutputStream(zipStream);



//Spacify HtmlExportImageSaving event handler

doc.SaveOptions.HtmlExportImageSaving += new ExportImageSavingEventHandler(HtmlExportImageSaving_ZipImage);

//Specify image folder aliase

doc.SaveOptions.HtmlExportImagesFolderAlias = “images/”;



//Save document to stream in HTML format

MemoryStream htmlStream = new MemoryStream();

doc.Save(htmlStream, SaveFormat.Html);



//Put HTML into the zip archive

ZipEntry htmlEntry = new ZipEntry(“index.html”);

zip.PutNextEntry(htmlEntry);

zip.Write(htmlStream.GetBuffer(), 0, (int)htmlStream.Length);



//Loop through all images

foreach (KeyValuePair<string, MemoryStream> img in mImagesList)
{

ZipEntry imgEntry = new ZipEntry(string.Format(“images/{0}”, img.Key));

zip.PutNextEntry(imgEntry);

zip.Write(img.Value.GetBuffer(), 0, (int)img.Value.Length);

}

//Finish zip stream

zip.Finish();



return zipStream;

}

private static void HtmlExportImageSaving_ZipImage(object sender, ExportImageSavingEventArgs e)
{

MemoryStream imgStream = new MemoryStream();

e.ImageStream = imgStream;

e.KeepImageStreamOpen = true;



mImagesList.Add(e.ImageFileName, imgStream);

}

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. There were some breaking changes in Aspose.Words API. Please see Aspose.Words 9.2.0 release notes:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/entry247974.aspx

Now you should use HtmlSaveOptions:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.saving.htmlsaveoptions.html

Also the following video might be useful for you:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/entry247976.aspx

Best regards.