How can I produce a “print preview” of a FlowDocument in a WPF application?

Taking the hint from the comment added to my question, I did this: private string _previewWindowXaml = @”<Window xmlns=”http://schemas.microsoft.com/netfx/2007/xaml/presentation” xmlns:x =’http://schemas.microsoft.com/winfx/2006/xaml’ Title=”Print Preview – @@TITLE” Height=”200″ Width=”300″ WindowStartupLocation =’CenterOwner’> <DocumentViewer Name=”dv1″/> </Window>”; internal void DoPreview(string title) { string fileName = System.IO.Path.GetRandomFileName(); FlowDocumentScrollViewer visual = (FlowDocumentScrollViewer)(_parent.FindName(“fdsv1”)); try { // write the XPS document using (XpsDocument doc … Read more