title: Printing a WPF FlowDocument
body: <p>I'm building a demo app in WPF, which is new to me.  I'm currently displaying text in a FlowDocument, and need to print it.</p>
  
  <p>The code I'm using looks like this:</p>
  
  <pre><code>        PrintDialog pd = new PrintDialog();
          fd.PageHeight = pd.PrintableAreaHeight;
          fd.PageWidth = pd.PrintableAreaWidth;
          fd.PagePadding = new Thickness(50);
          fd.ColumnGap = 0;
          fd.ColumnWidth = pd.PrintableAreaWidth;
  
          IDocumentPaginatorSource dps = fd;
          pd.PrintDocument(dps.DocumentPaginator, "flow doc");
  </code></pre>
  
  <p>fd is my FlowDocument, and for now I'm using the default printer instead of allowing the user to specify print options.  It works OK, except that after the document prints, the FlowDocument displayed on screen has changed to to use the settings I specified for printing.  </p>
  
  <p>I can fix this by manually resetting everything after I print, but is this the best way?  Should I make a copy of the FlowDocument before I print it?  Or is there another approach I should consider?</p>