Skip to main content

IPdfAdapterWithBitmapRendering Interface

Definition

Assembly:Avalonia.Controls.PdfViewer
Package:Avalonia.Controls.PdfViewer

Extension interface for adapters that support rendering to bitmaps.

public interface IPdfAdapterWithBitmapRendering

Implements: IPdfAdapter, IDisposable

Methods

NameDescription
RenderPageAsyncRenders a page to a bitmap.
RenderPageRegionAsyncRenders a rectangular region of a page to a bitmap (for tiled rendering).

RenderPageAsync Method

Renders a page to a bitmap.

public System.Threading.Tasks.Task<Avalonia.Media.Imaging.Bitmap> RenderPageAsync(Avalonia.Controls.Pdf.Core.IPdfPage page, double scale, double dpiScale, System.Threading.CancellationToken cancellationToken)

Parameters

page Avalonia.Controls.Pdf.Core.IPdfPage

The page to render.

scale double

Display (zoom) scale in DIPs.

dpiScale double

Device pixel ratio; the raster is sampled at scale * dpiScale pixels but the bitmap reports a DIP size of scale. Default 1.0.

cancellationToken System.Threading.CancellationToken

Cancellation token.

Returns

System.Threading.Tasks.Task<Avalonia.Media.Imaging.Bitmap>

RenderPageRegionAsync Method

Renders a rectangular region of a page to a bitmap (for tiled rendering).

public System.Threading.Tasks.Task<Avalonia.Media.Imaging.Bitmap> RenderPageRegionAsync(Avalonia.Controls.Pdf.Core.IPdfPage page, double scale, Avalonia.Rect region, System.Threading.CancellationToken cancellationToken)

Parameters

page Avalonia.Controls.Pdf.Core.IPdfPage

scale double

region Avalonia.Rect

cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task<Avalonia.Media.Imaging.Bitmap>