Free Support Forum - aspose.com

DocumentRenderer obsolete

I was using this code before to get an array of bitmaps but after upgrading, DocumentRenderer is no longer there.

DocumentRenderer renderer = new DocumentRenderer(_document);

Bitmap[] pages = renderer.GetPages();

How can I accomplish this same task?

Hi

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

Thanks for your request. You can use SaveToImage method. Please see the following link for more information:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/aspose.words.document.savetoimage_overloads.html

Please let me know in case of any issues, I will be glad to help you.

Best regards.

If I do this

MemoryStream tmpStream = new MemoryStream();

_document.SaveToImage(0, 1, stream, ImageFormat.Bmp, null);

how do I get all pages if I don't know the document page count? Can I just get the page count from the document?

Hi

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

Thanks for your request. Of course, you can. You should just use Document.PageCount property:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/aspose.words.document.pagecount.html

Best regards.

ok, great…thanks for your help