1
Answer

Trying to print a file which is .pmf file in c# application

I am trying to print a file which is .pmf file using print button which should display printer properties as well but after executing the below code I am getting a blank page as a result. Please, anybody can tell me what is wrong with the code shown below. I have added PrintDialog control from Toolbox to the Form in Visual Studio.
private void btn_Print_Click(object sender, EventArgs e)
{
PrintDialog printDlg = new PrintDialog();
PrintDocument printDoc = new PrintDocument();
printDoc.DocumentName = "D:\\Project_Folder\\Soil_Units_PMF\\pmf\\KUM1_1G1b_Soilunits_Profile.pmf";
printDlg.Document = printDoc;
printDlg.AllowSelection = true;
printDlg.AllowSomePages = true;
//Call ShowDialog
if (printDlg.ShowDialog() == DialogResult.OK)
{
printDoc.Print();
}
else
{
return;
}
}

Answers (1)

0
Photo of Dorababu Meka
NA 8.2k 1.2m 14y
I developed an application which was purely based on strings so what can i write my responsibilities
0
Photo of Mahesh Chand
2 286.9k 123.8m 14y
It all depends on the application and its type. If the application is a database driven for a bank, responsibilities will be different thank the application that is graphics and drawing intensive.

What exactly are you trying to accomplish?