java.lang.Objectcom.pdfjet.Image
public 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, ImageType.BMP or ImageType.JET Please see Example_03 and Example_24.
Constructor Summary | |
---|---|
Image(PDF pdf,
java.io.InputStream inputStream,
int imageType)
The main constructor for the Image class. |
Method Summary | |
---|---|
float[] |
drawOn(Page page)
Draws this image on the specified page. |
float |
getHeight()
Returns the height of this image when drawn on the page. |
float |
getWidth()
Returns the width of this image when drawn on the page. |
void |
placeIn(Box box)
Places this image in the specified box. |
void |
scaleBy(double factor)
Scales this image by the specified factor. |
void |
scaleBy(float factor)
Scales this image by the specified factor. |
void |
scaleBy(float widthFactor,
float heightFactor)
Scales this image by the specified width and height factor. |
Image |
setActualText(java.lang.String actualText)
Sets the actual text for this image. |
Image |
setAltDescription(java.lang.String altDescription)
Sets the alternate description of this image. |
void |
setGoToAction(java.lang.String key)
Sets the destination key for the action. |
void |
setLocation(float x,
float y)
Sets the location of this image on the page to (x, y). |
void |
setPosition(double x,
double y)
Sets the position of this image on the page to (x, y). |
void |
setPosition(float x,
float y)
Sets the position of this image on the page to (x, y). |
void |
setRotate(int degrees)
Sets the image rotation to the specified number of degrees. |
void |
setRotateCW90(boolean rotate90)
Sets the rotate90 flag. |
void |
setURIAction(java.lang.String uri)
Sets the URI for the "click box" action. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Image(PDF pdf, java.io.InputStream inputStream, int imageType) throws java.lang.Exception
pdf
- the page to draw this image on.inputStream
- the input stream to read the image from.imageType
- ImageType.JPG, ImageType.PNG and ImageType.BMP.
java.lang.Exception
Method Detail |
---|
public void setPosition(double x, double y)
x
- the x coordinate of the top left corner of the image.y
- the y coordinate of the top left corner of the image.public void setPosition(float x, float y)
x
- the x coordinate of the top left corner of the image.y
- the y coordinate of the top left corner of the image.public void setLocation(float x, float y)
x
- the x coordinate of the top left corner of the image.y
- the y coordinate of the top left corner of the image.public void scaleBy(double factor)
factor
- the factor used to scale the image.public void scaleBy(float factor)
factor
- the factor used to scale the image.public void scaleBy(float widthFactor, float heightFactor)
Author: Pieter Libin, pieter@emweb.be
widthFactor
- the factor used to scale the width of the imageheightFactor
- the factor used to scale the height of the imagepublic void placeIn(Box box) throws java.lang.Exception
box
- the specified box.
java.lang.Exception
public void setURIAction(java.lang.String uri)
uri
- the URIpublic void setGoToAction(java.lang.String key)
key
- the destination name.public void setRotateCW90(boolean rotate90)
rotate90
- the flag.public void setRotate(int degrees)
degrees
- the number of degrees.public Image setAltDescription(java.lang.String altDescription)
altDescription
- the alternate description of the image.
public Image setActualText(java.lang.String actualText)
actualText
- the actual text for the image.
public float[] drawOn(Page page) throws java.lang.Exception
drawOn
in interface Drawable
page
- the page to draw this image on.
java.lang.Exception
public float getWidth()
public float getHeight()