Class Image
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
Image(PDF, Stream)
The main constructor for the Image class.
public Image(PDF pdf, Stream inputStream)
Parameters
Image(PDF, string)
Convenience constructor for the Image class.
public Image(PDF pdf, string filePath)
Parameters
Image(List<PDFobj>, Stream)
Constructor used to attach images to existing PDF.
public Image(List<PDFobj> objects, Stream inputStream)
Parameters
objectsList<PDFobj>the objects of the existing PDF.
inputStreamStreamthe input stream to read the image from.
Methods
DrawOn(Page)
Draws this image on the specified page.
public float[] DrawOn(Page page)
Parameters
pagePagethe 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
heightfloatthe specified height.
Returns
ResizeToFit(Page, bool)
Resizes the image to fit the page.
public void ResizeToFit(Page page, bool keepAspectRatio)
Parameters
ResizeWidth(float)
Resizes the image to the specified width.
public Image ResizeWidth(float width)
Parameters
widthfloatthe specified width.
Returns
ScaleBy(float)
Scales this image by the specified factor.
public Image ScaleBy(float factor)
Parameters
factorfloatthe 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
widthFactorfloatthe factor used to scale the width of the image
heightFactorfloatthe 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
actualTextstringthe actual text for the image.
Returns
- Image
this Image.
SetAltDescription(string)
Sets the alternate description of this image.
public Image SetAltDescription(string altDescription)
Parameters
altDescriptionstringthe 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
flipUpsideDownbooltrue 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
keystringthe destination name.
Returns
- Image
this Image object.
SetLanguage(string)
Sets the language of this image.
public Image SetLanguage(string language)
Parameters
languagestringthe 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
xfloatthe x coordinate of the top left corner of the image.
yfloatthe y coordinate of the top left corner of the image.
Returns
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
degreesint
Returns
SetURIAction(string)
Sets the URI for the "click box" action.
public Image SetURIAction(string uri)
Parameters
uristringthe URI
Returns
- Image
this Image object.