Click here to Skip to main content
15,882,063 members
Please Sign up or sign in to vote.
4.67/5 (3 votes)
See more:
Hello

I've to write a virtual printer driver for windows 7 64bits, and i'm a beginner in driver development.

This driver will send all the data received from the soft (word, notepad,...), into a socket (a TCP server will process data later), nothing more, no rendering, no user interface.

But i didn't found great docs or samples, which simply explains what is needed to write a printer driver. Samples of WinDDK (tty, oemui) are too much complex, and i don't understand half of source code.

Could you help me?

Thanks

PS : sorry for my English level :)


@JackDingler :
thanks for answer, i didn't specify that i'm a student, so i can't pay someone :)
This driver is my work placement's topic.

I managed to simplify to source code, i understand better now

@Code-o-mat :
That's what i'm doing, i try to rewrite the tty (generic text only) sample of WinDDK.
Now i know, print driver must be learned by studying samples, because there is no docs or tutorials about it.
Thx


EDIT :
In fact I found that it was possible to write printer drivers with the Windows UniDrv.dll.
Do you think that it is possible to simply catch the output stream before any rendering, and simply transfer it to a server?
Posted
Updated 8-May-12 23:56pm
v3
Comments
Code-o-mat 9-May-12 11:12am    
I guess you would need to write a "Rendering Plug-In", (see here: http://msdn.microsoft.com/en-us/library/windows/hardware/ff561948%28v=vs.85%29.aspx ) which doesn't render but instead streams information through a socket.
By the way, if you want to react on someone's comment, use the "reply" link that appears in the top-right corner of the comments, if you want to react on a solution, click on the "Have a question or comment" link at the bottom-left part of the solution's box. This will send a notification to the person who wrote the comment/solution, otherwise they might not notice that you are "talking to them" by improving your own question.
pampalrashad 14-May-12 5:44am    
Thx for advices, i'm new on this website :)

I've study another example of WinDDK, named "oemdll/oemuni" which is a sample of rendering plug-in.
I compiled it (after adding some printf), and i discovered one function called DrvStartDoc().
I think that DrvStartDoc send data before rendering (by calling another function called EngWritePrinter() ). I currently trying to re-write it, but not succefully.
Code-o-mat 14-May-12 6:26am    
Welcome to Code Project then, and good luck with your project.
JackDingler 9-May-12 15:10pm    
Figuring out APIs and how to do things on the fly, based on limited samples is a common practice in the professional world.

Documentation is often wrong, out of date or just incomplete.

Even when the documentation is good, there's no guarantee that your implementation won't expose bugs, that will have you spending time to troubleshoot and work around.

The TTY sample is a great place to start. And it's all documented on the Microsoft Site. But at this level, much of their documentation assumes that you already understand how to write drivers.
pampalrashad 14-May-12 5:50am    
In fact, I never studied drivers, and Windows documentations are really hard for a newbie like me ^^

You'll have to work through it, to understand it.

What you're doing is complicated and hard.

Further, you will need to do some handshaking. Applications need to know what capabilities your print server supports. You'll soon want to report status back to the users.

The only way to make it simple is to pay someone else to do it. But keep in mind that people with experience in writing printer drivers are expensive.
 
Share this answer
 
Alternatively, you could try finding some free, open source, LGPL-ed, ... printer driver which has the features you require and creates some kind of file from the print commands, not sure what format, like a post-script file or somesuch and you could rewrite it so it will write the generated file to a socket instead of a file.
 
Share this answer
 
Have a look at what some very clever people have done here http://www.printerplusplus.com/[^]
this might be helpful to your learning especially as they provide source code.

Dont forget to share back here what you build - we all stand on the shoulders of giants and hard workers who go before us.
 
Share this answer
 
Comments
enhzflep 26-May-15 10:33am    
Perhaps you missed the date of the original post - it was 3 years and 20 days ago.

That said - the resource you've linked to appears to be an excellent resource for .NET programmers with a need similar to the OP. Take a 4 for that. :)

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