Thread: Developing a virtual PDF printer driver

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    6

    Developing a virtual PDF printer driver

    Hi All,

    I've got a project to develop a virtual pdf printer driver for windows in C++ programming language.

    I'm unsure how to develop this. Can you guys give me references on how to develop a virtual pdf printer driver. google only shows results for .NET languages but I need for C++ language only.

    Please advise with references and suggestions on how to proceed to develop this driver.

    Thanks,
    Sudhir.

  2. #2

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by bsudhir6 View Post
    Hi All,

    I've got a project to develop a virtual pdf printer driver for windows in C++ programming language.

    I'm unsure how to develop this. Can you guys give me references on how to develop a virtual pdf printer driver. google only shows results for .NET languages but I need for C++ language only.

    Please advise with references and suggestions on how to proceed to develop this driver.

    Thanks,
    Sudhir.
    Writing a Windows printer driver is a massive topic. You need to start by installing the WDK.

    Then, you need to familiarize yourself with the fundamentals of Windows printer driver architecture. An important question you need to answer up front is whether you'll be writing a v3 driver (GDI) or a v4 driver (XPS). Depending on that, you'll need to refer to the documentation either for the legacy GDI print subsystem or the XPS print subsystem.

    If writing GDI, you have three choices:

    * Write your driver completely from scratch by implementing a GDI print render DLL. You need to learn about the userspace DDI layer, and your job will be to translate GDI operations into appropriate PDF drawing commands.
    * Write your driver as a UniDrv plugin, which is basically a slightly easier way of doing the above, but affords less control.
    * Write your driver as a PsDrv plugin, which might be simpler in some ways as you can leverage the similarities between PostScript and PDF graphics language.

    If writing XPS, you can do things the hard way or the easy way:

    * Hard way: implement PDF conversion in a XPS print filter component. You'll need to have an entire XML processing layer, and know how to parse the (complicated) XPS data stream and convert from the XPS display list to a PDF graphics command sequence.
    * Easier way: go get an off-the-shelf XPS-to-PDF converter and configure a generic XPS printer device in Windows to feed into that converter. There are off the shelf products for cheap.

    If you take the do-it-yourself approaches, I estimate a person with zero knowledge of Windows printing and PDF could probably get this task done in about six months. If you're really, really fast on the learning curve.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Virtual Device Driver
    By xx3nvyxx in forum Windows Programming
    Replies: 8
    Last Post: 08-22-2006, 11:01 PM
  2. Virtual Printer Port
    By rich1984 in forum Windows Programming
    Replies: 2
    Last Post: 02-25-2005, 03:56 PM
  3. virtual audio driver
    By hellboi64 in forum Windows Programming
    Replies: 2
    Last Post: 09-10-2004, 05:21 PM
  4. printer driver programming
    By gamer in forum C++ Programming
    Replies: 5
    Last Post: 01-22-2004, 09:58 PM
  5. Printing to Printer via Device Driver
    By JamMan in forum C++ Programming
    Replies: 1
    Last Post: 11-19-2001, 05:20 PM