DynamicPDF by ceTe Software

com.cete.dynamicpdf.pageelements
Class Image

java.lang.Object
  extended by com.cete.dynamicpdf.PageElement
      extended by com.cete.dynamicpdf.pageelements.TaggablePageElement
          extended by com.cete.dynamicpdf.pageelements.RotatingPageElement
              extended by 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.

Licensing:
The use of the GIF image type is a DynamicPDF Generator Community Edition feature. All other image types (JPEG, JPEG 2000, PNG, BMP, EMF, EXIF, TIFF and WMF) are a DynamicPDF Generator Professional Edition feature, except for the use of 64 bit PNG images (in this case see below). One of the following licenses is required for non-evaluation usage:

Use of 64 bit PNG images with this class is an Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:

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.
 java.lang.String getAlternateText()
          Gets the alternate text of the image.
 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 setAlternateText(java.lang.String alternateText)
          Sets the alternate text of the image.
 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.pageelements.TaggablePageElement
getTag, getTagOrder, setTag, setTagOrder
 
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.

Throws:
java.io.FileNotFoundException
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.

Throws:
java.io.FileNotFoundException - If the physical file path of the image is not found.
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.

Returns:
the alignment of the image.
See Also:
Align

setAlign

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

Parameters:
value - the alignment of the image.
See Also:
Align

getVAlign

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

Returns:
the vertical alignment of the image.
See Also:
VAlign

setVAlign

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

Parameters:
value - the vertical alignment of the image.
See Also:
VAlign

getScaleX

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

Returns:
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.

Parameters:
value - the horizontal scale of the image.

getScaleY

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

Returns:
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.

Parameters:
value - the vertical scale of the image.

getHorizontalDpi

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

Returns:
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.

Parameters:
dpiX - the horizontal dpi(also known as pixels per inch) of the image.

getVerticalDpi

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

Returns:
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.

Parameters:
dpiY - the vertical dpi(also known as pixels per inch) of the image.

getWidth

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

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

setWidth

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

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

getHeight

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

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

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 height of the image.

getImageData

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

Returns:
the image data.
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.

getAlternateText

public java.lang.String getAlternateText()
Gets the alternate text of the image.

Returns:
the alternate text of the image.

setAlternateText

public void setAlternateText(java.lang.String alternateText)
Sets the alternate text of the image.

Parameters:
alternateText - the alternate text of the image.

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.07 for Java generated on Aug 12, 2020
© Copyright 2020, ceTe Software