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

Free Support Forum - aspose.com

SaveToImage Change from 9.0 to 9.2


In Words 9.0 I displayed a preview of a document as an image using the method below. Can you show me how to do the same with the new unified Save method of 9.3?

Dim stream As New MemoryStream()
m_Document.SaveToImage(_CurrentPage, 1, stream, ImageFormat.Bmp, Nothing)

This would create a single page image I could display to the user page number

Basically I want to have a preview window for a document that the user can view a particular page of a document, which I did using the above method

Thanks Bruce


I resolved it myself as below

MemoryStream stream = new MemoryStream();

Aspose.Words.Saving.ImageSaveOptions opts = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Tiff);


opts.PageIndex = _CurrentPage;

opts.PageCount = 1;

m_Document.Save(stream, opts);

Image image = Image.FromStream(stream);

Hi Bruce,

It's great you have resolved the problem already. For future reference you can find information on how to change any code members to the new API in the migration article here.