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
inputPathstringPath to the source PDF file.
pageIndexintZero-based page index to render.
outputPathstringPath where the image will be saved. The file extension determines the format:
.png,.bmp, or.jpg/.jpeg.zoomdoubleZoom 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
inputPathoroutputPathisnull.- FileNotFoundException
Thrown when
inputPathdoes not exist.- ArgumentException
Thrown when the output file extension is not supported.