IXpsRasterizationFactory2::CreateRasterizer method

The CreateRasterizer method creates an XPS rasterizer object that can convert content from XPS to PWG Raster using the XPS Rasterization Service. PWG Raster supports non-square DPIs.

Syntax

HRESULT CreateRasterizer(
  IXpsOMPage              *xpsPage,
  FLOAT                   DPIX,
  FLOAT                   DPIY,
  XPSRAS_RENDERING_MODE   nonTextRenderingMode,
  XPSRAS_RENDERING_MODE   textRenderingMode,
  XPSRAS_PIXEL_FORMAT     pixelFormat,
  XPSRAS_BACKGROUND_COLOR backgroundColor,
  IXpsRasterizer          **ppIXpsRasterizer
);

Parameters

xpsPage

DPIX

DPIY

nonTextRenderingMode

Rendering mode for nontext items in the rasterized output. This parameter indicates whether to generate antialiased output. Set this parameter to one of the following XPSRAS_RENDERING_MODE enumeration values:

  • XPSRAS_RENDERING_MODE_ANTIALIASED
  • XPSRAS_RENDERING_MODE_ALIASED

textRenderingMode

Rendering mode for text in the rasterized output. This parameter indicates whether to generate antialiased output. Set this parameter to one of the following XPSRAS_RENDERING_MODE enumeration values:

  • XPSRAS_RENDERING_MODE_ANTIALIASED
  • XPSRAS_RENDERING_MODE_ALIASED

pixelFormat

Allows a caller to select the pixel format used by the IWICBitmap returned by IXpsRasterizer::RasterizeRect. Set this parameter to one of the following XPSRAS_PIXEL_FORMAT enumeration values:

  • XPSRAS_PIXEL_FORMAT_32BPP_PBGRA_UINT_SRGB
  • XPSRAS_PIXEL_FORMAT_64BPP_PRGBA_HALF_SCRGB
  • XPSRAS_PIXEL_FORMAT_128BPP_PRGBA_FLOAT_SCRGB

backgroundColor

Allows a caller to select background color. Set this parameter to one of the following XPSRAS_BACKGROUND_COLOR enumeration values:

  • XPSRAS_BACKGROUND_COLOR_TRANSPARENT
  • XPSRAS_BACKGROUND_COLOR_OPAQUE
The default background color is XPSRAS_BACKGROUND_COLOR_TRANSPARENT.

ppIXpsRasterizer

Return Value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

   
Minimum supported client Windows 10
Target Platform Desktop
Header xpsrassvc.h (include Xpsrassvc.h)

See Also

IXpsRasterizationFactory2