Method SaveAsPdf
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
filePathstringThe file path where to save the PDF.
optionsPdfGenerationOptionsOptional 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
filePathis null.