DynamicPDF by ceTe Software

com.cete.dynamicpdf.imaging
Class ImageData

java.lang.Object
  |
  +--com.cete.dynamicpdf.Resource
        |
        +--com.cete.dynamicpdf.imaging.ImageData
Direct Known Subclasses:
GifImageData, Jpeg2000ImageData, JpegImageData, PngImageData, TiffImageData

public abstract class ImageData
extends Resource

Class represents the data of an image.

Licensing:
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:


Constructor Summary
protected ImageData()
          Initializes a new instance of the ImageData class.
 
Method Summary
 void draw(PageWriter writer, float pdfX, float pdfY, float width, float height)
          Draws the image data to the given PageWriter object.
abstract  int getHeight()
          Gets the pixel height of the image data.
 float getHorizontalDpi()
          Gets the horizontal dpi(also known as pixels per inch) of the image data.
static ImageData getImage(byte[] byteArray)
          Returns an ImageData of the correct type for the given Stream.
static ImageData getImage(java.lang.String filePath)
          Returns an ImageData of the correct type for the given physical file path.
 boolean getInterpolate()
          Gets a value indicating is image interpolation should be used by the PDF viewer when viewing the Image.
 Page getPage()
          Returns a Page object containing the image as a background.
 Page getPage(float margins)
          Returns a Page object containing the image as a background.
 float getPointHeight()
          Calculates the height of the image in points.
 float getPointWidth()
          Calculates the width of the image in points.
 ResourceType getResourceType()
          Gets the type of resource.
abstract  float getScaleX()
          Gets the X scale of the image data.
abstract  float getScaleY()
          Gets the Y scale of the image data.
 float getVerticalDpi()
          Gets the vertical dpi(also known as pixels per inch) of the image data.
abstract  int getWidth()
          Gets the pixel width of the image data.
 void setInterpolate(boolean value)
          Sets a value indicating is image interpolation should be used by the PDF viewer when viewing the Image.
 
Methods inherited from class com.cete.dynamicpdf.Resource
draw, getRequiredPdfObjects, getUid, newUid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageData

protected ImageData()
Initializes a new instance of the ImageData class.

See Also:
ImageData
Method Detail

getImage

public static ImageData getImage(java.lang.String filePath)
                          throws java.io.FileNotFoundException
Returns an ImageData of the correct type for the given physical file path.

Throws:
java.io.FileNotFoundException - if physical file path of the image is not found.
Parameters:
filePath - Physical file path of the image.
See Also:
ImageData

getImage

public static ImageData getImage(byte[] byteArray)
Returns an ImageData of the correct type for the given Stream.

Throws:
GeneratorException - if Byte Array is null.
Parameters:
byteArray - Byte Array containing the image data.
See Also:
ImageData

getWidth

public abstract int getWidth()
Gets the pixel width of the image data.


getHeight

public abstract int getHeight()
Gets the pixel height of the image data.


getScaleX

public abstract float getScaleX()
Gets the X scale of the image data.


getScaleY

public abstract float getScaleY()
Gets the Y scale of the image data.


getHorizontalDpi

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


getVerticalDpi

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


getPointWidth

public float getPointWidth()
Calculates the width of the image in points.

Returns:
The width of the image in points.

getPointHeight

public float getPointHeight()
Calculates the height of the image in points.

Returns:
The height of the image in points.

getPage

public Page getPage(float margins)
Returns a Page object containing the image as a background.

Parameters:
margins - The margins of the page.
Returns:
Page with the image as a background.
See Also:
Page

getPage

public Page getPage()
Returns a Page object containing the image as a background.

Returns:
Page with the image as a background.
See Also:
Page

draw

public void draw(PageWriter writer,
                 float pdfX,
                 float pdfY,
                 float width,
                 float height)
Draws the image data to the given PageWriter object.

Parameters:
writer - PageWriter class to receive the image data's output.
pdfX - X PDF coordinate for the image when drawn.
pdfY - Y PDF Coordinate for the image when drawn.
width - Width of the image when drawn.
height - Height of the image when drawn.
See Also:
PageWriter

setInterpolate

public void setInterpolate(boolean value)
Sets a value indicating is image interpolation should be used by the PDF viewer when viewing the Image.


getInterpolate

public boolean getInterpolate()
Gets a value indicating is image interpolation should be used by the PDF viewer when viewing the Image.


getResourceType

public ResourceType getResourceType()
Gets the type of resource.

Overrides:
getResourceType in class Resource
See Also:
ResourceType

DynamicPDF by ceTe Software

API Reference for DynamicPDFTM v4.0.1 for Java generated on October 06, 2006
© Copyright 2006, ceTe Software