How to chain printer drivers? RRS feed

  • Question

  • Hi,

    I am currently working on an XPS driver (based on XpsDrvSmpl from WinDDK6000) in which some content (images and text) is added to the document stream.
    Currently, the result of the print operation is an XPS file on disk (I configured the driver with a local file port) which, if a hard copy is required, needs to be opened in an XPS viewer and be printed to a physical printer.

    Is there a way to somehow send the XPS output from my driver directly to another printer driver without extra user interaction?
    Some possible approaches:
    - Is it possible to externally chain printer drivers? ie in Windows, specifying one printer driver as output for another.
    - Is it possible to configure the print spooler from within the XPS driver code to send the generated output to another printer?
    - Is it possible to branch the XPS stream from within the XPS driver and send it both to the driver's configured output (standard) and to another printer?

    Bert Vingerhoets
    Friday, February 29, 2008 9:28 AM

All replies

  • 1) no. This is not possible


    2) I'm not aware of port duplication functionality as the one you describe.


    3) I don't think anybody had tried that, but I see no reason why a filter in the pipeline won't be able to do this. One thing to be careful about is to avoid recursive calls into self. Make sure that your filter impersonates the current user when it makes the outbound WritePrinter call to the second printer.


    In any case, the path you're exploring is quite dangerous. It's probably far easier to have an external file daemon that listens for print notifications and dispatches the XPS PDL file to whatever destinations desired (a second printer, a file share, etc)



    Hope that helps.


    Saturday, April 5, 2008 9:23 AM