Table of Contents

Method SaveAsPdf

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

SaveAsPdf(string, PdfGenerationOptions)

Saves the image as a single-page PDF file at the specified path.

public bool SaveAsPdf(string filePath, PdfGenerationOptions options = null)

Parameters

filePath string

The file path where to save the PDF.

options PdfGenerationOptions

Optional PDF generation options. Uses defaults if null.

Returns

bool

True if the PDF was saved successfully; otherwise, false.

Remarks

The page size is computed from the image dimensions and resolution (DPI). BINARY1 images are embedded as native 1-bit DeviceGray images for optimal file size.

Exceptions

ObjectDisposedException

Thrown if this instance has been disposed.

ArgumentNullException

Thrown if filePath is null.

Share