For the XPS print path, filters are the primary way that a driver prepares print data for the printer. In versions of the Microsoft Windows operating system before Windows Vista, print processors and rendering modules did the work of filters.
An XPS filter is a DLL that exports DllGetClassObject and DllCanUnloadNow functions. The filter pipeline manager calls these functions when it loads and unloads the XPS filter DLL. After loading the filter DLL, the filter pipeline manager does the following:
Calls DllGetClassObject to obtain a reference to the filter object's IClassFactory interface.
Calls the IPrintPipelineFilter::InitializeFilter method to initialize the filter object.
Before unloading the filter DLL, the filter pipeline manager calls DllCanUnloadNow.
Note In some older XPS filters, the DllGetClassObject function retrieves a reference to the filter's IPrintPipelineFilter interface instead of to an IClassFactory interface. For backward compatibility, the filter pipeline manager in Windows Vista and later versions of Windows will continue to support these filters. However, for new filter designs, DllGetClassObject should retrieve a reference to an IClassFactory interface.
XPS filters make the printing subsystem more robust, because the filters run in a process different from the spooler. This "sandboxing" both protects against failures and allows a plug-in to run with different security permissions. XPSDrv also enables you to reuse filters across families of printers to lower costs and development time.
For maximum flexibility and reuse, each filter should perform a specific print processing function. For example, one filter would only apply a watermark, while another would only perform accounting.
Windows Vista does not include any filters in-box, but the following sample filters are included in the Windows Driver Kit (WDK) in the \Src\Print\Xpsdrvsmpl\Src\Filters folder:
For more information about the filter pipeline manager, see XPSDrv Render Module.
For more information about implementing filters, see Implementing XPS Filters.
For more information about asynchronous notifications in print filters, see Asynchronous Notifications in Print Filters.
You must configure filters by using the filter pipeline configuration file.
For information about how to debug the print filter pipeline service, see Attaching a Debugger to the Print Filter Pipeline Service.
In Windows 7, XPS filters can use the XPS rasterization service to convert fixed pages in XPS documents to bitmaps.
For information about the way Windows uses GPU acceleration for XPS rasterization, see XPSRas GPU Usage Decision Tree.
For more information about XPS filters, see the following white papers at the WHDC Web site:
Build date: 1/29/2014