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 :( :(
please help me :)
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)
{
}
}