Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,

I need urgent requirement for creating c# windows services . In that send printer name and and text . that services will print the text to particular printer which i send the printer name . Is it possible? Please help me to do this.

Thanks in advance
Athi varathan.

What I have tried:

I want to create exe for windows services to print options.
Posted
Updated 5-May-16 21:22pm
Comments
Patrice T 6-May-16 3:04am    
Why can't you print directly from your app ?
Why do you need a service to print ?

1 solution

I would think it is possible.

As you say that you want to send text, I assume you want to send raw data to the printer.
This is an article that describes how: https://support.microsoft.com/en-us/kb/322091[^]

If that is not the case you can use the PrintDocument Class (System.Drawing.Printing)[^], but then you need to render graphics in the event PrintPage.

Decide how you want to do it and write an app that you can use to debug your code.

Next step is to learn how to write a Windows Service. On MSDN you can find this article: Walkthrough: Creating a Windows Service Application in the Component Designer[^]

After that it is a matter of combining the two.

Note: It is only urgent for you, not for us.
 
Share this answer
 

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