Table of Contents

Method RenderToFile

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

RenderToFile(string, int, string, double)

Renders a single page from a PDF file and saves it as an image file.

public static void RenderToFile(string inputPath, int pageIndex, string outputPath, double zoom = 2)

Parameters

inputPath string

Path to the source PDF file.

pageIndex int

Zero-based page index to render.

outputPath string

Path where the image will be saved. The file extension determines the format: .png, .bmp, or .jpg/.jpeg.

zoom double

Zoom factor for rendering. Default is 2.0.

Examples

using LMKit.Document.Pdf;

PdfToImage.RenderToFile("report.pdf", 0, "page1.png", zoom: 3.0);

Exceptions

ArgumentNullException

Thrown when inputPath or outputPath is null.

FileNotFoundException

Thrown when inputPath does not exist.

ArgumentException

Thrown when the output file extension is not supported.