Bewerken

Delen via


Customized Data Stream Compression

Important

The modern print platform is Windows' preferred means of communicating with printers. We recommend that you use Microsoft's IPP inbox class driver, along with Print Support Apps (PSA), to customize the print experience in Windows 10 and 11 for printer device development.

For more information, see Modern print platform and the Print support app design guide.

Unidrv allows you to perform data compression operations using customized code. To perform customized compression operations, perform the following steps:

  1. Provide a rendering plug-in that implements the IPrintOemUni::Compression method.

  2. Include a CmdEnableOEMComp command entry in the printer's GPD file.

The IPrintOemUni::Compression method receives scan line data as input. The method must compress the data and then return the result to Unidrv. The CmdEnableOEMComp command entry specifies the command that must be sent to the printer so that the printer can accept the compressed data. For each scan line that is to be sent to the printer, Unidrv calls IPrintOemUni::Compression to compress the scan line data. Then, if this is the only compression method available, Unidrv sends to the printer the command specified by the CmdEnableOEMComp command entry, followed by the compressed data.

If the printer minidriver contains GPD entries that also enable Unidrv-supported compression methods, Unidrv tries each compression algorithm for each scan line and chooses the algorithm that produces the best result. For more information about Unidrv's compression capabilities, see Compressing Raster Data.

Only one customized compression method can be enabled at one time.