Free Support Forum -

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?


<?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:

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?


<?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:

Best regards.

ok, great…thanks for your help