IPdfAdapterWithBitmapRendering Interface
Definition
Extension interface for adapters that support rendering to bitmaps.
public interface IPdfAdapterWithBitmapRendering
Methods
| Name | Description |
|---|---|
| RenderPageAsync | Renders a page to a bitmap. |
| RenderPageRegionAsync | Renders 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>