Table of Contents

Class Image

Namespace
PDFjet.NET
Assembly
PDFjet.dll

Used to create image objects and draw them on a page. The image type can be one of the following: ImageType.JPG, ImageType.PNG or ImageType.BMP

Please see Example_32 and Example_14.

public class Image : IDrawable
Inheritance
Image
Implements
Inherited Members

Constructors

Image(PDF, PDFobj)

Creates an image from an image object read from an existing PDF.

public Image(PDF pdf, PDFobj obj)

Parameters

pdf PDF
obj PDFobj

Image(PDF, Stream)

The main constructor for the Image class.

public Image(PDF pdf, Stream inputStream)

Parameters

pdf PDF

the page to draw this image on.

inputStream Stream

the input stream to read the image from.

Image(PDF, string)

Convenience constructor for the Image class.

public Image(PDF pdf, string filePath)

Parameters

pdf PDF

the PDF to which we add this image.

filePath string

the file path to the image file.

Image(List<PDFobj>, Stream)

Constructor used to attach images to existing PDF.

public Image(List<PDFobj> objects, Stream inputStream)

Parameters

objects List<PDFobj>

the objects of the existing PDF.

inputStream Stream

the input stream to read the image from.

Methods

DrawOn(Page)

Draws this image on the specified page.

public float[] DrawOn(Page page)

Parameters

page Page

the page to draw on.

Returns

float[]

x and y coordinates of the bottom right corner of this component.

GetHeight()

Returns the height of this image when drawn on the page, its width before it is turned when it is turned a quarter of the way. The scaling is take into account.

public float GetHeight()

Returns

float

h - the height of this image.

GetWidth()

Returns the width of this image when drawn on the page, its height before it is turned when it is turned a quarter of the way. The scaling is take into account.

public float GetWidth()

Returns

float

w - the width of this image.

ResizeHeight(float)

Resizes the image to the specified height.

public Image ResizeHeight(float height)

Parameters

height float

the specified height.

Returns

Image

ResizeToFit(Page, bool)

Resizes the image to fit the page.

public void ResizeToFit(Page page, bool keepAspectRatio)

Parameters

page Page

the PDF page

keepAspectRatio bool

flag

ResizeWidth(float)

Resizes the image to the specified width.

public Image ResizeWidth(float width)

Parameters

width float

the specified width.

Returns

Image

ScaleBy(float)

Scales this image by the specified factor.

public Image ScaleBy(float factor)

Parameters

factor float

the factor used to scale the image.

Returns

Image

this Image object.

ScaleBy(float, float)

Scales this image by the specified width and height factor.

Author: Pieter Libin, pieter@emweb.be

public Image ScaleBy(float widthFactor, float heightFactor)

Parameters

widthFactor float

the factor used to scale the width of the image

heightFactor float

the factor used to scale the height of the image

Returns

Image

this Image object.

SetActualText(string)

Sets the actual text for this image.

public Image SetActualText(string actualText)

Parameters

actualText string

the actual text for the image.

Returns

Image

this Image.

SetAltDescription(string)

Sets the alternate description of this image.

public Image SetAltDescription(string altDescription)

Parameters

altDescription string

the alternate description of the image.

Returns

Image

this Image.

SetFlipUpsideDown(bool)

Sets whether this image is drawn upside down.

public Image SetFlipUpsideDown(bool flipUpsideDown)

Parameters

flipUpsideDown bool

true to draw this image upside down.

Returns

Image

this Image object.

SetGoToAction(string)

Sets the destination key for the action.

public Image SetGoToAction(string key)

Parameters

key string

the destination name.

Returns

Image

this Image object.

SetLanguage(string)

Sets the language of this image.

public Image SetLanguage(string language)

Parameters

language string

the language, for example "en-US".

Returns

Image

this Image.

SetLocation(float, float)

Sets the location of this image on the page to (x, y).

public Image SetLocation(float x, float y)

Parameters

x float

the x coordinate of the top left corner of the image.

y float

the y coordinate of the top left corner of the image.

Returns

Image

SetRotation(int)

Rotates this image clockwise by 0, 90, 180 or 270 degrees, as every rotation in PDFjet turns.

public Image SetRotation(int degrees)

Parameters

degrees int

Returns

Image

SetURIAction(string)

Sets the URI for the "click box" action.

public Image SetURIAction(string uri)

Parameters

uri string

the URI

Returns

Image

this Image object.