Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, December 12, 2016 4:29 PM
Hello Everyone,
Please help me how to print the HTML document in c# without using the web browser control.
I have tried with the same code but it will popup the print dialog box. How can i disable the dialog box and print to default printer.?
using (Process printProcess = new Process())
{
string systemPath = Environment.GetFolderPath(Environment.SpecialFolder.System);
printProcess.StartInfo.FileName = systemPath + @"\rundll32.exe";
printProcess.StartInfo.Arguments = systemPath + @"\mshtml.dll,PrintHTML """ + document + @"""";
printProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
printProcess.Start();
}
.
I have tried with the below code but not working.Please help me how to print the HTML page without web browser control.
All replies (2)
Monday, December 12, 2016 6:48 PM
Hello,
See the following marked answer.
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
VB Forums - moderator
Tuesday, December 13, 2016 10:46 AM
Hi Dine.553,
Thank you for posting here.
>>Please help me how to print the HTML document in c# without using the web browser control.
You could download the source file from the Print HTML in C# with or without the web browser control and the print dialog.
It has a explanation in the link.
I hope this would be helpful to you.
Best Regards,
Wendy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].