In windows application iam using System.Diagnostics.Process.Start(filepath) to open the file and i would to click the print option thro programatically.
Whether we can able to achieve this in windows application. Kindly help me.
Open any type of file,click print button programatically.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
SenthilkumarRank #387 · 6.5K pointsPosted Dec 9, 2011, 10:59 PM EST
when you open the file, if you want to print that document then .net supports to print the document.
You have to use the System.Drawing.Print namespace.
Any way you know the path of the document, then you have to use the streamreader to read the file and we have to fix the number of lines per page.
The PrintDocument class will be used to set the peoperties and print() method will be used to print.
Please go through this link, you will get the code.
http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.print.aspx
Thanks,
Senthil.