DynamicPDF by ceTe Software

com.cete.dynamicpdf.pageelements
Class Image

java.lang.Object
  |
  +--com.cete.dynamicpdf.PageElement
        |
        +--com.cete.dynamicpdf.pageelements.RotatingPageElement
              |
              +--com.cete.dynamicpdf.pageelements.Image
All Implemented Interfaces:
IArea, ICoordinate

public class Image
extends RotatingPageElement
implements IArea, ICoordinate

This class can be used to place images on a page.

View Example


Constructor Summary
Image(byte[] byteArray, float x, float y)
          Creates a new instance of Image.
Image(byte[] byteArray, float x, float y, float scale)
          Creates a new instance of Image.
Image(ImageData imageData, float x, float y)
          Creates a new instance of Image.
Image(ImageData imageData, float x, float y, float scale)
          Creates a new instance of Image.
Image(java.lang.String filePath, float x, float y)
          Creates a new instance of Image.
Image(java.lang.String filePath, float x, float y, float scale)
          Creates a new instance of Image.
 
Method Summary
protected  void drawRotated(PageWriter writer)
          Draws the image to the given PageWriter object.
 Align getAlign()
          Gets the Align enumeration that specifies horizontal alignment of the image on the X coordinate.
 float getHeight()
          Gets the height of the image.
 float getHorizontalDpi()
          Gets the horizontal dpi(also known as pixels per inch) of the image.
 ImageData getImageData()
          Get the image's ImageData object.
 float getScaleX()
          Gets the horizontal scale of the image.
 float getScaleY()
          Gets the vertical scale of the image.
 VAlign getVAlign()
          Gets the VAlign enumeration that specifies vertical alignment of the image on the Y coordinate.
 float getVerticalDpi()
          Gets the vertical dpi(also known as pixels per inch) of the image.
 float getWidth()
          Gets the width of the image.
 void setAlign(Align value)
          Sets the Align enumeration that specifies horizontal alignment of the image on the X coordinate.
 void setBounds(float maximumWidth, float maximumHeight)
          Scales the image to fit in the given box keeping the X and Y scale equal.
 void setDpi(float dpi)
          Scales the image to have the specified dpi(also known as pixels per inch).
 void setDpi(float horizontalDpi, float verticalDpi)
          Scales the image to have the specified dpi(also known as pixels per inch).
 void setHeight(float value)
          Sets the height of the image.
 void setHorizontalDpi(float dpiX)
          Sets the horizontal dpi(also known as pixels per inch) of the image.
 void setScaleX(float value)
          Sets the horizontal scale of the image.
 void setScaleY(float value)
          Sets the vertical scale of the image.
 void setSize(float width, float height)
          Scales the image to fit the exact width and height given.
 void setVAlign(VAlign value)
          Sets the VAlign enumeration that specifies vertical alignment of the image on the Y coordinate.
 void setVerticalDpi(float dpiY)
          Sets the vertical dpi(also known as pixels per inch) of the image.
 void setWidth(float value)
          Sets the width of the image.
 
Methods inherited from class com.cete.dynamicpdf.pageelements.RotatingPageElement
draw, getAngle, getX, getY, setAngle, setX, setY
 
Methods inherited from class com.cete.dynamicpdf.PageElement
getRequiredLicenseLevel, getStrID, setRequiredLicenseLevel, setStrID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cete.dynamicpdf.pageelements.ICoordinate
getX, getY, setX, setY
 

Constructor Detail

Image

public Image(java.lang.String filePath,
             float x,
             float y)
      throws java.io.FileNotFoundException
Creates a new instance of Image.

Parameters:
filePath - Physical file path of the image.
x - X coordinate of the image.
y - Y coordinate of the image.

Image

public Image(java.lang.String filePath,
             float x,
             float y,
             float scale)
      throws java.io.FileNotFoundException
Creates a new instance of Image.

Parameters:
filePath - Physical file path of the image.
x - X coordinate of the image.
y - Y coordinate of the image.
scale - The scale to use when rendering the image.

Image

public Image(byte[] byteArray,
             float x,
             float y)
Creates a new instance of Image.

Parameters:
byteArray - Byte Array containing the image data.
x - X coordinate of the image.
y - Y coordinate of the image.

Image

public Image(byte[] byteArray,
             float x,
             float y,
             float scale)
Creates a new instance of Image.

Parameters:
byteArray - Byte Array containing the image data.
x - X coordinate of the image.
y - Y coordinate of the image.
scale - The scale to use when rendering the image.

Image

public Image(ImageData imageData,
             float x,
             float y)
Creates a new instance of Image.

Parameters:
imageData - ImageData object containing the image data.
x - X coordinate of the image.
y - Y coordinate of the image.
See Also:
ImageData

Image

public Image(ImageData imageData,
             float x,
             float y,
             float scale)
Creates a new instance of Image.

Parameters:
imageData - ImageData object containing the image data.
x - X coordinate of the image.
y - Y coordinate of the image.
scale - The scale to use when rendering the image.
See Also:
ImageData
Method Detail

getAlign

public Align getAlign()
Gets the Align enumeration that specifies horizontal alignment of the image on the X coordinate.

See Also:
Align

setAlign

public void setAlign(Align value)
Sets the Align enumeration that specifies horizontal alignment of the image on the X coordinate.

See Also:
Align

getVAlign

public VAlign getVAlign()
Gets the VAlign enumeration that specifies vertical alignment of the image on the Y coordinate.

See Also:
VAlign

setVAlign

public void setVAlign(VAlign value)
Sets the VAlign enumeration that specifies vertical alignment of the image on the Y coordinate.

See Also:
VAlign

getScaleX

public float getScaleX()
Gets the horizontal scale of the image.


setScaleX

public void setScaleX(float value)
Sets the horizontal scale of the image. Setting this value affects the getHorizontalDpi property.


getScaleY

public float getScaleY()
Gets the vertical scale of the image.


setScaleY

public void setScaleY(float value)
Sets the vertical scale of the image. Setting this value affects the getVerticalDpiproperty.


getHorizontalDpi

public float getHorizontalDpi()
Gets the horizontal dpi(also known as pixels per inch) of the image.


setHorizontalDpi

public void setHorizontalDpi(float dpiX)
Sets the horizontal dpi(also known as pixels per inch) of the image. Setting this value affects the getScaleX property.


getVerticalDpi

public float getVerticalDpi()
Gets the vertical dpi(also known as pixels per inch) of the image.


setVerticalDpi

public void setVerticalDpi(float dpiY)
Sets the vertical dpi(also known as pixels per inch) of the image. Setting this value affects the getScaleY property.


getWidth

public float getWidth()
Gets the width of the image.

Specified by:
getWidth in interface IArea
Returns:
the float width of the area.

setWidth

public void setWidth(float value)
Sets the width of the image.

Specified by:
setWidth in interface IArea
Parameters:
value - the float width of the area.

getHeight

public float getHeight()
Gets the height of the image.

Specified by:
getHeight in interface IArea
Overrides:
getHeight in class RotatingPageElement
Returns:
the float height of the area.

setHeight

public void setHeight(float value)
Sets the height of the image.

Specified by:
setHeight in interface IArea
Overrides:
setHeight in class RotatingPageElement
Parameters:
value - the float height of the area.

getImageData

public ImageData getImageData()
Get the image's ImageData object.

See Also:
ImageData

drawRotated

protected void drawRotated(PageWriter writer)
Draws the image to the given PageWriter object.

Specified by:
drawRotated in class RotatingPageElement
Parameters:
writer - PageWriter object to receive the image's output.
See Also:
PageWriter

setBounds

public void setBounds(float maximumWidth,
                      float maximumHeight)
Scales the image to fit in the given box keeping the X and Y scale equal.

Parameters:
maximumWidth - The maximum width.
maximumHeight - The maximum height.

setSize

public void setSize(float width,
                    float height)
Scales the image to fit the exact width and height given.

Parameters:
width - Width of image.
height - Height of image.

setDpi

public void setDpi(float dpi)
Scales the image to have the specified dpi(also known as pixels per inch).

Parameters:
dpi - DPI of the image.

setDpi

public void setDpi(float horizontalDpi,
                   float verticalDpi)
Scales the image to have the specified dpi(also known as pixels per inch).

Parameters:
horizontalDpi - Horizontal dpi of the image.
verticalDpi - Horizontal dpi of the image.

DynamicPDF by ceTe Software

API Reference for DynamicPDF™ for Java generated on December 20, 2005
© Copyright 2005, ceTe Software