title: Print a file(PDf) by using PrintDialog in C#
body: <p>Hello everybody this is my code that I try get a file with Open File Dialog And print the file
   But its printing an Empty page :( :(</p>
  
  <h2> please help me :)</h2>
  
  <pre><code>   private void tsmprint_Click(object sender, EventArgs e)
      {
          try
          {
              if (openFileDialog1.ShowDialog()==DialogResult.OK)
              {
                  PrintDocument Pd = new PrintDocument();
  
                  Pd.DocumentName = openFileDialog1.FileName;
  
                   printDialog1.Document = Pd;
                  if (printDialog1.ShowDialog()==DialogResult.OK)
                  {
                      Pd.Print();
                  }
  
              }
          }
          catch (Exception)
          {
  
          }
      }
  </code></pre>