title: wpf print screen
body: <p>I have a WPF window that I want to dump to a printer.  I found this code and it is a good start, but there are a couple problems with it and I don't know what I am doing.</p>
  
  <pre><code>PrintDialog printDialog = new PrintDialog ( );
  if ( printDialog.ShowDialog ( ) == true )
  {
      PrintCapabilities capabilities = printDialog.PrintQueue.GetPrintCapabilities ( printDialog.PrintTicket );
  
      double scale = Math.Min ( capabilities.PageImageableArea.ExtentWidth / this.ActualWidth,
          capabilities.PageImageableArea.ExtentHeight / this.ActualHeight );
  
      this.LayoutTransform = new ScaleTransform ( scale, scale );
      Size size = new Size ( capabilities.PageImageableArea.ExtentWidth, capabilities.PageImageableArea.ExtentHeight );
  
      this.Measure ( size );
      this.Arrange ( new Rect 
          ( new Point ( capabilities.PageImageableArea.OriginWidth, capabilities.PageImageableArea.OriginHeight ), 
              size ) );
  
      printDialog.PrintVisual ( this, "Well Information" );
  }
  </code></pre>
  
  <p>I am printing to a regular 8.5x11 page, portrait.  What I get is a page that is about 9 inches tall (there are about 1 inch gray bands across the top and bottom) and about half the screen (left to right). Ideally, what I want is a landscape print (by default, I realize that the user can change that) that shows all of the screen, scaled as necessary.</p>