Xsemmel/PrintEngine/PrintPreviewControl.xaml.cs
/// <summary>
/// Loads the specified FlowDocument document for print preview.
/// </summary>
Loads the specified FlowDocument document for print preview.
Loads the specified FlowDocument document for print preview .
public void LoadDocument(FlowDocument document)
        {
            string temp = Path.GetTempFileName();
            if (File.Exists(temp) == true)
                File.Delete(temp);
            XpsDocument xpsDoc = new XpsDocument(temp, FileAccess.ReadWrite);
            XpsDocumentWriter xpsWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc);
            xpsWriter.Write(((FlowDocument) document as IDocumentPaginatorSource).DocumentPaginator);
            _documentViewer.Document = xpsDoc.GetFixedDocumentSequence();
            xpsDoc.Close();
        }
public void LoadDocument ( FlowDocument document ) { string temp = Path . GetTempFileName ( ) ; if ( File . Exists ( temp ) == true ) File . Delete ( temp ) ; XpsDocument xpsDoc = new XpsDocument ( temp , FileAccess . ReadWrite ) ; XpsDocumentWriter xpsWriter = XpsDocument . CreateXpsDocumentWriter ( xpsDoc ) ; xpsWriter . Write ( ( ( FlowDocument ) document as IDocumentPaginatorSource ) . DocumentPaginator ) ; _documentViewer . Document = xpsDoc . GetFixedDocumentSequence ( ) ; xpsDoc . Close ( ) ; }
Loads the specified FlowDocument document for print preview.
Loads the specified FlowDocument document for print preview .
document
FlowDocument