Method RenderPageAsPnmBytesAsync
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
inputPathstringPath to the source PDF.
pageIndexintZero-based index of the page to render.
optionsPdfRenderOptionsRender options.
cancellationTokenCancellationTokenCancels the operation.
Returns
Examples
using LMKit.Document.Pdf;
byte[] pnm = PdfRenderer.RenderPageAsPnmBytes("report.pdf", pageIndex: 0);