Opait PDF Library
Public Member Functions | Static Public Member Functions | Properties | List of all members
Opait.Pdf.Api.PdfImage Class Reference

Class represents a multi-page image for embedding in PDF documents. More...

Inheritance diagram for Opait.Pdf.Api.PdfImage:

Public Member Functions

PdfImagePage GetPage (int pageNumber)
 Gets the image page at the specified index. More...
 
void AddPage (PdfImagePage imagePage)
 Add the specified page to the image file. More...
 
void Save (string fileName)
 Saves the image to the specified path. More...
 
void Save (Stream stream, FileFormat fileFormat)
 Saves the image to the specified stream. More...
 
void Dispose ()
 Closes the image file when all references are released.
 

Static Public Member Functions

static PdfImage Create ()
 Create a new image file. More...
 
static PdfImage FromFile (string fileName)
 Creates an instance of the PdfImage from the specified file. More...
 
static PdfImage FromStream (Stream stream)
 Creates an instance of the PdfImage from the specified stream. More...
 

Properties

int PageCount [get]
 Gets the number of pages in the image document.
 
int JpegQuality [get, set]
 Gets or sets the quality percentile for JPEG compression. Default is 75.
 

Detailed Description

Class represents a multi-page image for embedding in PDF documents.

Member Function Documentation

◆ AddPage()

void Opait.Pdf.Api.PdfImage.AddPage ( PdfImagePage  imagePage)

Add the specified page to the image file.

Parameters
imagePageThe image page to add.

◆ Create()

static PdfImage Opait.Pdf.Api.PdfImage.Create ( )
static

Create a new image file.

Returns
A newly created instance of PdfImage.

◆ FromFile()

static PdfImage Opait.Pdf.Api.PdfImage.FromFile ( string  fileName)
static

Creates an instance of the PdfImage from the specified file.

Parameters
fileNameThe path to the file.
Returns
An instance of the PdfImage, or null for error.

◆ FromStream()

static PdfImage Opait.Pdf.Api.PdfImage.FromStream ( Stream  stream)
static

Creates an instance of the PdfImage from the specified stream.

Parameters
streamThe image stream. Caller should not release this stream.
Returns
An instance of the PdfImage, or null for error.

◆ GetPage()

PdfImagePage Opait.Pdf.Api.PdfImage.GetPage ( int  pageNumber)

Gets the image page at the specified index.

Parameters
pageNumberThe zero-based index of the image page.
Returns
The image page at the requested index.

◆ Save() [1/2]

void Opait.Pdf.Api.PdfImage.Save ( Stream  stream,
FileFormat  fileFormat 
)

Saves the image to the specified stream.

Parameters
streamOpen stream for saving image.
fileFormatFile format of the saved image.

◆ Save() [2/2]

void Opait.Pdf.Api.PdfImage.Save ( string  fileName)

Saves the image to the specified path.

Parameters
fileNameThe path to the saved image.