title: WPF Printing from a TextBox
body: <p>I am having trouble printing from a TextBox in WPF</p>
  
  <p>My Textbox will only contain a number between 1 and 999</p>
  
  <p>I wanted to print font size 72 and the text enclosed within a 4" box (so they can cut around the edges)</p>
  
  <pre><code>    private void InvokePrint(String contentToPrint)
      {
          // Create the print dialog object and set options
          PrintDialog pDialog = new PrintDialog();
          pDialog.PageRangeSelection = PageRangeSelection.AllPages;
          pDialog.UserPageRangeEnabled = true;
  
          // Display the dialog. This returns true if the user presses the Print button.
          Nullable&lt;Boolean&gt; print = pDialog.ShowDialog();
          if (print == true)
          {
              FixedDocumentSequence fixedDocSeq = xpsDocument.GetFixedDocumentSequence();
              pDialog.PrintDocument(fixedDocSeq.DocumentPaginator, "Printing Label");
          }
      }
  </code></pre>
  
  <p>I got the code from Microsoft's site but they are using an XPS printer. I want to use the default selected printer (usually an HP).</p>
  
  <p>Any help would greatly be appreciated</p>