Ignore Image inside word

Hi,

I.m buzy to try your product Aspose.word.

So far, so very good;-)

I'm a little question. sometimes we need to read word document with inside image. If it's the case, i receive a error message : Image file cannot be written to disk. When saving the document to a stream either HTMLExportImagesFolder should be specified or custom stream should be provided via HTMLExportImageSaving event Handler.

I'm not interested to save the image.

I try to find the solution in the documentation but without success.

Can you help me please?

Here is my C# code:

public string GetVacancieText(string _fileName)

{

var _file = ConfigurationManager.AppSettings["pathFilesVacancies"] + _fileName;

var doc = new Document(_file,LoadFormat.Auto,string.Empty);

Stream stream = new MemoryStream();

doc.Save(stream, SaveFormat.Html);

var bytes = new byte[stream.Length];

stream.Position = 0;

stream.Read(bytes, 0, (int) stream.Length);

var m_content = Encoding.UTF8.GetString(bytes);

stream.Close();

return m_content;

}

Thanks,

Yves.

If you don't want to save images during saving to HTML I think the best option will be to delete them from the document in memory before saving.

Use a code example here http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.drawing.shape.html

Scroll down to the example is called "Shows how to delete all images from a document." Do that before saving to a stream in the HTML format.

Hi Romand,

Thanks you for your answer. It was the solution.
Now it’s working perfect.

Thanks,

Yves.