Saturday, February 02, 2008

Custom XPS Printer Driver Magic

Adrian Ford - Generating XPS Automagically

"I got a mail overnight asking about ways to automatically generate XPS from applications, specifically asking for a way to enable existing applications that don't have knowledge of XPS to generate XPS content. The Microsoft XPS Document Writer (MXDW) allows you to do this, irrespective of whether you're using the .Net or Win32 platforms. There's two ways that applications can invoke MXDW. The first is via the normal action of a user printing, where MXDW is explicitly selected as the target printer. When using this route MXDW displays a 'Save As' dialog so the user can set the target XPS filename. The second route is where the application programmatically selects MXDW as the printer, in this case it can automatically set the output filename by setting lpszOutput in DOCINFO [1] [2]. ...

...

If you don't want users to select the filename (perhaps you want the file saved to some magic folder for further processing), and you're not in a position to modify the application to support setting the destination with DOCINFO, then there is another option [3]. Microsoft makes available the core components of MXDW as part of the Windows Driver Kit (available on Microsoft Connect and MSDN Subscriber Downloads). Using the WDK it is possible to build a custom XPS print driver (XPSDrv) that automates the output process, including doing much more than just setting a destination filename automatically.

..."

XPS has not yet come up at work (where I do EDD, Electronic Data Discovery) as a possible output/delivery format, but I think it's only a matter of time.

There's a ton of goodness in XPS and I believe it will fit well in the Legal/Litigation Support/EDD world.

Why? Think redaction (where text is "blacked out", marked over, redacted because it's privileged, private, confidential information). With XPS you can REALLY redact a document, physically removing and replacing the redacted text. No cut-n-paste recovery, no hiding it or just covering it up, but text nuked, gone, removed, for now and forever. It's also a open format and easy to delve into (at it's heart, it's a zip with XML in it...).

So I'm keeping a minor watch on the XPS space and the above post is something I may be able to use on day...(i.e. Creating a special/specific implementation/instance of a XPS printer where I can control its output, file name, etc.)

No comments: