views:

38

answers:

1

I would like to generate a small Preview Image of the fist page of a FlowDocument (imagine a Thumbnail View of a collection of FlowDocuments). Can anyone recommend a good approach for doing this?

A: 

You should be able to do this by making your FlowDocument display the first page as you want it to appear in the thumbnail, then pointing a RenderTargetBitmap to the FlowDocument and saving the bitmap to disk. There is some code to do this in this article:

http://www.west-wind.com/weblog/posts/150676.aspx

Roland Acton
Remember that the size of your flowdocument will have a bearing on how quickly it will load. As such, you may want to pre-generate and cache the bitmap before you end up needing it in your application.
Hugo