Click here to Skip to main content
15,888,096 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to print document to a printer but i don't know way do it.
In C# use printDocument with method .Print(), but it return file format OutLook or pdf, not to my printer (Canon)

Please help me. Thank you.
Posted
Comments
F-ES Sitecore 17-Jun-15 5:54am    
What format is the document? Also "Improve question" and post your existing code.
Member 10338650 19-Jun-15 1:11am    
Thank you :D
Stoonce 17-Jul-15 2:52am    
Take a look at this article: Printing word documents in .NET framework
This approach, unlike the PrintDocument class, does not require you to set a default printer, you can just provide a name of your printer (it's based on System.Printing namespace).

1 solution

PrintDocument Class[^].
Make sure the printer is set as default.
 
Share this answer
 
Comments
Member 10338650 19-Jun-15 1:09am    
Thank for your help, but how to make the printer is set as default ?
My printer name is "Canon LBL 6200", And I used printDocument1.PrinterSettings.PrinterName= "Canon LBL 6200"
But it not run
Peter Leow 19-Jun-15 1:16am    
http://windows.microsoft.com/en-sg/windows/change-default-printer#1TC=windows-7
Member 10338650 19-Jun-15 5:25am    
yeah, it ran. Thank you very much, i'm very happy, thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900