Table of Contents

Method RenderPageAsPnmBytesAsync

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

RenderPageAsPnmBytesAsync(string, int, PdfRenderOptions, CancellationToken)

Renders one page and returns it as a PNM-encoded byte array.

public static Task<byte[]> RenderPageAsPnmBytesAsync(string inputPath, int pageIndex, PdfRenderOptions options = null, CancellationToken cancellationToken = default)

Parameters

inputPath string

Path to the source PDF.

pageIndex int

Zero-based index of the page to render.

options PdfRenderOptions

Render options.

cancellationToken CancellationToken

Cancels the operation.

Returns

Task<byte[]>

Examples

using LMKit.Document.Pdf;

byte[] pnm = PdfRenderer.RenderPageAsPnmBytes("report.pdf", pageIndex: 0);
Share