Class Renderer

A helper class for rendering pages in a Document

Inheritance
System.Object
Renderer
Namespace: PSPDFKit
Assembly: PSPDFKit.dll
Syntax
public static class Renderer

Methods

RenderPageAsync(Int32, Document, RenderOptions)

Renders the specified page in an open Document to a Windows.UI.Xaml.Media.Imaging.WriteableBitmap. The method must be called on the UI thread.

Declaration
public static IAsyncOperation<WriteableBitmap> RenderPageAsync(int pageIndex, Document document, RenderOptions options)
Parameters
Type Name Description
System.Int32 pageIndex

Page to be rendered.

Document document

Document with the open document.

RenderOptions options

Options to control the render. See RenderOptions.

Returns
Type Description
Windows.Foundation.IAsyncOperation<Windows.UI.Xaml.Media.Imaging.WriteableBitmap>

A page rendered into a Windows.UI.Xaml.Media.Imaging.WriteableBitmap.

RenderPageToSoftwareBitmapAsync(Int32, Document, RenderOptions)

Renders the specified page in an open Document to a Windows.Graphics.Imaging.SoftwareBitmap. The method can be called on any thread.

Declaration
public static IAsyncOperation<SoftwareBitmap> RenderPageToSoftwareBitmapAsync(int pageIndex, Document document, RenderOptions options)
Parameters
Type Name Description
System.Int32 pageIndex

Page to be rendered.

Document document

Document with the open document.

RenderOptions options

Options to control the render. See RenderOptions.

Returns
Type Description
Windows.Foundation.IAsyncOperation<Windows.Graphics.Imaging.SoftwareBitmap>

A page rendered into a Windows.Graphics.Imaging.SoftwareBitmap.

RenderTileAsync(Int32, Rect, Document, RenderOptions)

Renders a tile in the specified page in an open Document to a Windows.UI.Xaml.Media.Imaging.WriteableBitmap. The method must be called on the UI thread.

Declaration
public static IAsyncOperation<WriteableBitmap> RenderTileAsync(int pageIndex, Rect pageRegionToRender, Document document, RenderOptions options)
Parameters
Type Name Description
System.Int32 pageIndex

Page to be rendered.

Windows.Foundation.Rect pageRegionToRender

The region of the page to be rendered in PDF units with the origin (0,0) in the top left of the page.

Document document

Document with the open document.

RenderOptions options

Options to control the render. See RenderOptions.

Returns
Type Description
Windows.Foundation.IAsyncOperation<Windows.UI.Xaml.Media.Imaging.WriteableBitmap>

A tile rendered into a Windows.UI.Xaml.Media.Imaging.WriteableBitmap.

RenderTileToSoftwareBitmapAsync(Int32, Rect, Document, RenderOptions)

Renders a tile in the specified page in an open Document to a Windows.Graphics.Imaging.SoftwareBitmap. The method can be called on any thread.

Declaration
public static IAsyncOperation<SoftwareBitmap> RenderTileToSoftwareBitmapAsync(int pageIndex, Rect pageRegionToRender, Document document, RenderOptions options)
Parameters
Type Name Description
System.Int32 pageIndex

Page to be rendered.

Windows.Foundation.Rect pageRegionToRender

The region of the page to be rendered in PDF units with the origin (0,0) in the top left of the page.

Document document

Document with the open document.

RenderOptions options

Options to control the render. See RenderOptions.

Returns
Type Description
Windows.Foundation.IAsyncOperation<Windows.Graphics.Imaging.SoftwareBitmap>

A tile rendered into a Windows.Graphics.Imaging.SoftwareBitmap.