title: The type or namespace name 'PrintDocument' could not be found (are you missing a using directive or an assembly reference?)
body: <p>I had an old Windows Form App with this code:</p>
  
  <pre><code>public static void PrintTheNumber(int numberOfLabels, string toPrint)
  {
      PrintDocument p = new PrintDocument();
      p.PrintPage += delegate (object sender1, PrintPageEventArgs e1)
      {
          e1.Graphics.DrawString(toPrint, new Font("Times New Roman", 12),
              new SolidBrush(Color.Black),
              new RectangleF(0, 0, p.DefaultPageSettings.PrintableArea.Width, p.DefaultPageSettings.PrintableArea.Height));
      };
  
      try
      {
          p.PrinterSettings.Copies = (short)numberOfLabels;
          p.Print();
      }
      catch (Exception ex)
      {
          throw new Exception("Printer error!");
      }
  }
  </code></pre>
  
  <p>And now I am converting it to WPF and I get exactly this error from my question.</p>
  
  <p>I am stuck and don't know how to print now with WPF. If anyone could explain it to me what is the problem?</p>
  
  <p>I just want to print a string on a click of a button. </p>