Method SavePageAsBmp
SavePageAsBmp(string, int, string, PdfRenderOptions, bool, CancellationToken)
Renders one page and writes it as BMP to a file.
public static void SavePageAsBmp(string inputPath, int pageIndex, string outputPath, PdfRenderOptions options = null, bool rle = false, CancellationToken cancellationToken = default)
Parameters
inputPathstringPath to the source PDF.
pageIndexintZero-based index of the page to render.
outputPathstringDestination file path.
optionsPdfRenderOptionsRender options.
rleboolWhen true, BMP output uses RLE compression.
cancellationTokenCancellationTokenCancels the operation.
Examples
using LMKit.Document.Pdf;
PdfRenderer.SavePageAsBmp("report.pdf", pageIndex: 0, "page-1.bmp");
// RLE-compressed BMP for legacy Windows pipelines
PdfRenderer.SavePageAsBmp("report.pdf", 0, "page-1.bmp", rle: true);
SavePageAsBmp(string, int, Stream, PdfRenderOptions, bool, CancellationToken)
Renders one page and writes it as BMP to a writable stream.
public static void SavePageAsBmp(string inputPath, int pageIndex, Stream outputStream, PdfRenderOptions options = null, bool rle = false, CancellationToken cancellationToken = default)
Parameters
inputPathstringPath to the source PDF.
pageIndexintZero-based index of the page to render.
outputStreamStreamWritable destination stream.
optionsPdfRenderOptionsRender options.
rleboolWhen true, BMP output uses RLE compression.
cancellationTokenCancellationTokenCancels the operation.
Examples
using System.IO;
using LMKit.Document.Pdf;
using MemoryStream output = new();
PdfRenderer.SavePageAsBmp("report.pdf", pageIndex: 0, output);