com.lowagie.text

Class Image

Implemented Interfaces:
Element, MarkupAttributes
Known Direct Subclasses:
ImgCCITT, ImgPostscript, ImgRaw, ImgTemplate, ImgWMF, Jpeg, Watermark

public abstract class Image
extends Rectangle
implements Element, MarkupAttributes

An Image is the representation of a graphic element (JPEG, PNG or GIF) that has to be inserted into the document
See Also:
Element, Rectangle

Field Summary

static int
AX
This represents a coordinate in the transformation matrix.
static int
AY
This represents a coordinate in the transformation matrix.
static int
BX
This represents a coordinate in the transformation matrix.
static int
BY
This represents a coordinate in the transformation matrix.
static int
CX
This represents a coordinate in the transformation matrix.
static int
CY
This represents a coordinate in the transformation matrix.
static int
DEFAULT
this is a kind of image alignment.
static int
DX
This represents a coordinate in the transformation matrix.
static int
DY
This represents a coordinate in the transformation matrix.
static int
LEFT
this is a kind of image alignment.
static int
MIDDLE
this is a kind of image alignment.
static int
ORIGINAL_BMP
type of image
static int
ORIGINAL_GIF
type of image
static int
ORIGINAL_JPEG
type of image
static int
ORIGINAL_NONE
type of image
static int
ORIGINAL_PNG
type of image
static int
ORIGINAL_PS
type of image
static int
ORIGINAL_TIFF
type of image
static int
ORIGINAL_WMF
type of image
static int
RIGHT
this is a kind of image alignment.
static int
TEXTWRAP
this is a kind of image alignment.
static int
UNDERLYING
this is a kind of image alignment.
private float
XYRatio
Holds value of property XYRatio.
protected float
absoluteX
This is the absolute X-position of the image.
protected float
absoluteY
This is the absolute Y-position of the image.
private PdfDictionary
additional
protected int
alignment
The alignment of the Image.
protected String
alt
Text that can be shown instead of the image.
protected Annotation
annotation
if the annotation is not null the image will be clickable.
protected int
bpc
this is the bits per component of the raw image.
protected int
colorspace
this is the colorspace of a jpeg-image.
protected boolean
deflated
Holds value of property deflated.
protected int
dpiX
Holds value of property dpiX.
protected int
dpiY
Holds value of property dpiY.
protected Image
imageMask
protected float
indentationLeft
the indentation to the left.
protected float
indentationRight
the indentation to the right.
protected boolean
interpolation
Holds value of property interpolation.
protected boolean
invert
Image color inversion
protected PdfOCG
layer
protected Properties
markupAttributes
Contains extra markupAttributes
protected boolean
mask
protected Long
mySerialId
protected byte[]
originalData
Holds value of property originalData.
protected int
originalType
Holds value of property originalType.
protected float
plainHeight
This is the width of the image without rotation.
protected float
plainWidth
This is the width of the image without rotation.
protected ICC_Profile
profile
ICC Profile attached
protected byte[]
rawData
The raw data of the image.
protected float
rotation
This is the rotation of the image.
protected float
scaledHeight
This is the original height of the image taking rotation into account.
protected float
scaledWidth
This is the scaled width of the image taking rotation into account.
(package private) static long
serialId
private boolean
smask
Holds value of property smask.
protected float
spacingAfter
The spacing after the image.
protected float
spacingBefore
The spacing before the image.
protected PdfTemplate[]
template
The template to be treated as an image.
protected int[]
transparency
this is the transparency information of the raw image
protected int
type
The imagetype.
protected URL
url
The URL of the image.
private float
widthPercentage
Holds value of property widthPercentage.

Fields inherited from class com.lowagie.text.Rectangle

BOTTOM, BOX, LEFT, NO_BORDER, RIGHT, TOP, UNDEFINED, background, border, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, color, grayFill, llx, lly, markupAttributes, rotation, urx, ury, useVariableBorders

Fields inherited from interface com.lowagie.text.Element

ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITTG3_1D, CCITTG3_2D, CCITTG4, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE

Constructor Summary

Image(URL url)
Constructs an Image -object, using an url .
Image(Image image)
Constructs an Image -object, using an url .

Method Summary

float
absoluteX()
Returns the absolute X position.
float
absoluteY()
Returns the absolute Y position.
int
alignment()
Gets the alignment for the image.
String
alt()
Gets the alternative text for the image.
Annotation
annotation()
Gets the annotation.
int
bpc()
Gets the bpc for the image.
int
colorspace()
Gets the colorspace for the image.
PdfDictionary
getAdditional()
Getter for property indexed.
int
getDpiX()
Gets the dots-per-inch in the X direction.
int
getDpiY()
Gets the dots-per-inch in the Y direction.
ICC_Profile
getICCProfile()
Gets the images ICC profile.
Image
getImageMask()
Gets the explicit masking.
static Image
getInstance(Properties attributes)
Returns an Image that has been constructed taking in account the value of some attributes .
static Image
getInstance(String filename)
Gets an instance of an Image.
static Image
getInstance(URL url)
Gets an instance of an Image.
static Image
getInstance(Image image)
gets an instance of an Image
static Image
getInstance(PdfTemplate template)
gets an instance of an Image
static Image
getInstance(imgb[] )
gets an instance of an Image
static Image
getInstance(int width, int height, boolean reverseBits, int typeCCITT, int parameters, byte[] data)
Creates an Image with CCITT G3 or G4 compression.
static Image
getInstance(int width, int height, boolean reverseBits, int typeCCITT, int parameters, byte[] data, transparency[] )
Creates an Image with CCITT G3 or G4 compression.
static Image
getInstance(int width, int height, int components, int bpc, data[] )
Gets an instance of an Image in raw mode.
static Image
getInstance(int width, int height, int components, int bpc, data[] , transparency[] )
Gets an instance of an Image in raw mode.
static Image
getInstance(java.awt.Image image, java.awt.Color color)
Gets an instance of an Image from a java.awt.Image.
static Image
getInstance(java.awt.Image image, java.awt.Color color, boolean forceBW)
Gets an instance of an Image from a java.awt.Image.
PdfOCG
getLayer()
Gets the layer this image belongs to.
String
getMarkupAttribute(String name)
Set
getMarkupAttributeNames()
Properties
getMarkupAttributes()
Long
getMySerialId()
Returns a serial id for the Image (reuse the same image more than once)
byte[]
getOriginalData()
Getter for property originalData.
int
getOriginalType()
Getter for property originalType.
protected static Long
getSerialId()
int[]
getTransparency()
Returns the transparency.
float
getWidthPercentage()
Getter for property widthPercentage.
float
getXYRatio()
Gets the X/Y pixel dimensionless aspect ratio.
boolean
hasAbsolutePosition()
Checks if the Images has to be added at an absolute position.
boolean
hasAbsoluteX()
Checks if the Images has to be added at an absolute X position.
boolean
hasICCProfile()
Checks is the image has an ICC profile.
float
indentationLeft()
Gets the left indentation.
float
indentationRight()
Gets the right indentation.
boolean
isDeflated()
Getter for property deflated.
boolean
isImgRaw()
Returns true if the image is a ImgRaw -object.
boolean
isImgTemplate()
Returns true if the image is an ImgTemplate -object.
boolean
isInterpolation()
Getter for property interpolation.
boolean
isInvertMask()
Returns true if the bits are to be inverted in the mask.
boolean
isInverted()
Getter for the inverted value
boolean
isJpeg()
Returns true if the image is a Jpeg -object.
boolean
isMask()
Returns true if this Image is a mask.
boolean
isMaskCandidate()
Returns true if this Image has the requisites to be a mask.
boolean
isSmask()
Getter for property smask.
static boolean
isTag(String tag)
Checks if a given tag corresponds with this object.
void
makeMask()
Make this Image a mask.
float[]
matrix()
Returns the transformation matrix of the image.
float
plainHeight()
Gets the plain height of the image.
float
plainWidth()
Gets the plain width of the image.
byte[]
rawData()
Gets the raw data for the image.
void
scaleAbsolute(float newWidth, float newHeight)
Scale the image to an absolute width and an absolute height.
void
scaleAbsoluteHeight(float newHeight)
Scale the image to an absolute height.
void
scaleAbsoluteWidth(float newWidth)
Scale the image to an absolute width.
void
scalePercent(float percent)
Scale the image to a certain percentage.
void
scalePercent(float percentX, float percentY)
Scale the width and height of an image to a certain percentage.
void
scaleToFit(float fitWidth, float fitHeight)
Scales the image so that it fits a certain width and height.
float
scaledHeight()
Gets the scaled height of the image.
float
scaledWidth()
Gets the scaled width of the image.
void
setAbsolutePosition(float absoluteX, float absoluteY)
Sets the absolute position of the Image.
void
setAdditional(PdfDictionary additional)
Sets the /Colorspace key.
void
setAlignment(int alignment)
Sets the alignment for the image.
void
setAlt(String alt)
Sets the alternative information for the image.
void
setAnnotation(Annotation annotation)
Sets the annotation of this Image.
void
setDeflated(boolean deflated)
Setter for property deflated.
void
setDpi(int dpiX, int dpiY)
Sets the dots per inch value
void
setImageMask(Image mask)
Sets the explicit masking.
void
setIndentationLeft(float f)
Sets the left indentation.
void
setIndentationRight(float f)
Sets the right indentation.
void
setInterpolation(boolean interpolation)
Sets the image interpolation.
void
setInvertMask(boolean invert)
Inverts the meaning of the bits of a mask.
void
setInverted(boolean invert)
Sets inverted true or false
void
setLayer(PdfOCG layer)
Sets the layer this image belongs to.
void
setMarkupAttribute(String name, String value)
void
setMarkupAttributes(Properties markupAttributes)
void
setOriginalData(byte[] originalData)
Setter for property originalData.
void
setOriginalType(int originalType)
Setter for property originalType.
void
setRotation(float r)
Sets the rotation of the image in radians.
void
setRotationDegrees(float deg)
Sets the rotation of the image in degrees.
void
setSmask(boolean smask)
Setter for property smask.
void
setSpacingAfter(float spacing)
Sets the spacing after this image.
void
setSpacingBefore(float spacing)
Sets the spacing before this image.
void
setTemplateData(PdfTemplate template)
Sets data from a PdfTemplate
void
setTransparency(transparency[] )
Sets the transparency values
void
setUrl(URL url)
Sets the url of the image
void
setWidthPercentage(float widthPercentage)
Setter for property widthPercentage.
void
setXYRatio(float XYRatio)
Sets the X/Y pixel dimensionless aspect ratio.
static void
skip(InputStream is, int size)
This method is an alternative for the InputStream.skip() -method that doesn't seem to work properly for big values of size .
float
spacingAfter()
Gets the spacing before this image.
float
spacingBefore()
Gets the spacing before this image.
void
tagICC(ICC_Profile profile)
Tags this image with an ICC profile.
PdfTemplate
templateData()
Gets the template to be used as an image.
static URL
toURL(String filename)
This method makes a valid URL from a given filename.
int
type()
Returns the type.
URL
url()
Gets the String -representation of the reference to the image.

Methods inherited from class com.lowagie.text.Rectangle

backgroundColor, border, borderColor, borderWidth, bottom, bottom, cloneNonPositionParameters, disableBorderSide, enableBorderSide, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getChunks, getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, getRotation, getVariableBorderWidth, grayFill, hasBorder, hasBorders, height, isUseVariableBorders, left, left, normalize, process, rectangle, right, right, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setMarkupAttribute, setMarkupAttributes, setRight, setTop, setUseVariableBorders, top, top, type, updateBorderBasedOnWidth, width

Field Details

AX

public static final int AX
This represents a coordinate in the transformation matrix.
Field Value:
0

AY

public static final int AY
This represents a coordinate in the transformation matrix.
Field Value:
1

BX

public static final int BX
This represents a coordinate in the transformation matrix.
Field Value:
2

BY

public static final int BY
This represents a coordinate in the transformation matrix.
Field Value:
3

CX

public static final int CX
This represents a coordinate in the transformation matrix.
Field Value:
4

CY

public static final int CY
This represents a coordinate in the transformation matrix.
Field Value:
5

DEFAULT

public static final int DEFAULT
this is a kind of image alignment.
Field Value:
0

DX

public static final int DX
This represents a coordinate in the transformation matrix.
Field Value:
6

DY

public static final int DY
This represents a coordinate in the transformation matrix.
Field Value:
7

LEFT

public static final int LEFT
this is a kind of image alignment.
Field Value:
0

MIDDLE

public static final int MIDDLE
this is a kind of image alignment.
Field Value:
1

ORIGINAL_BMP

public static final int ORIGINAL_BMP
type of image
Field Value:
4

ORIGINAL_GIF

public static final int ORIGINAL_GIF
type of image
Field Value:
3

ORIGINAL_JPEG

public static final int ORIGINAL_JPEG
type of image
Field Value:
1

ORIGINAL_NONE

public static final int ORIGINAL_NONE
type of image
Field Value:
0

ORIGINAL_PNG

public static final int ORIGINAL_PNG
type of image
Field Value:
2

ORIGINAL_PS

public static final int ORIGINAL_PS
type of image
Field Value:
7

ORIGINAL_TIFF

public static final int ORIGINAL_TIFF
type of image
Field Value:
5

ORIGINAL_WMF

public static final int ORIGINAL_WMF
type of image
Field Value:
6

RIGHT

public static final int RIGHT
this is a kind of image alignment.
Field Value:
2

TEXTWRAP

public static final int TEXTWRAP
this is a kind of image alignment.
Field Value:
4

UNDERLYING

public static final int UNDERLYING
this is a kind of image alignment.
Field Value:
8

XYRatio

private float XYRatio
Holds value of property XYRatio.

absoluteX

protected float absoluteX
This is the absolute X-position of the image.

absoluteY

protected float absoluteY
This is the absolute Y-position of the image.

additional

private PdfDictionary additional

alignment

protected int alignment
The alignment of the Image.

alt

protected String alt
Text that can be shown instead of the image.

annotation

protected Annotation annotation
if the annotation is not null the image will be clickable.

bpc

protected int bpc
this is the bits per component of the raw image. It also flags a CCITT image.

colorspace

protected int colorspace
this is the colorspace of a jpeg-image.

deflated

protected boolean deflated
Holds value of property deflated.

dpiX

protected int dpiX
Holds value of property dpiX.

dpiY

protected int dpiY
Holds value of property dpiY.

imageMask

protected Image imageMask

indentationLeft

protected float indentationLeft
the indentation to the left.

indentationRight

protected float indentationRight
the indentation to the right.

interpolation

protected boolean interpolation
Holds value of property interpolation.

invert

protected boolean invert
Image color inversion

layer

protected PdfOCG layer

markupAttributes

protected Properties markupAttributes
Contains extra markupAttributes

mask

protected boolean mask

mySerialId

protected Long mySerialId

originalData

protected byte[] originalData
Holds value of property originalData.

originalType

protected int originalType
Holds value of property originalType.

plainHeight

protected float plainHeight
This is the width of the image without rotation.

plainWidth

protected float plainWidth
This is the width of the image without rotation.

profile

protected ICC_Profile profile
ICC Profile attached

rawData

protected byte[] rawData
The raw data of the image.

rotation

protected float rotation
This is the rotation of the image.

scaledHeight

protected float scaledHeight
This is the original height of the image taking rotation into account.

scaledWidth

protected float scaledWidth
This is the scaled width of the image taking rotation into account.

serialId

(package private) static long serialId

smask

private boolean smask
Holds value of property smask.

spacingAfter

protected float spacingAfter
The spacing after the image.

spacingBefore

protected float spacingBefore
The spacing before the image.

template

protected PdfTemplate[] template
The template to be treated as an image.

transparency

protected int[] transparency
this is the transparency information of the raw image

type

protected int type
The imagetype.

url

protected URL url
The URL of the image.

widthPercentage

private float widthPercentage
Holds value of property widthPercentage.

Constructor Details

Image

public Image(URL url)
Constructs an Image -object, using an url .
Parameters:
url - the URL where the image can be found.

Image

protected Image(Image image)
Constructs an Image -object, using an url .
Parameters:
image - another Image object.

Method Details

absoluteX

public float absoluteX()
Returns the absolute X position.
Returns:
a position

absoluteY

public float absoluteY()
Returns the absolute Y position.
Returns:
a position

alignment

public int alignment()
Gets the alignment for the image.
Returns:
a value

alt

public String alt()
Gets the alternative text for the image.
Returns:
a String

annotation

public Annotation annotation()
Gets the annotation.
Returns:
the annotation that is linked to this image

bpc

public int bpc()
Gets the bpc for the image.

Remark: this only makes sense for Images of the type RawImage .

Returns:
a bpc value

colorspace

public int colorspace()
Gets the colorspace for the image.

Remark: this only makes sense for Images of the type Jpeg.

Returns:
a colorspace value

getAdditional

public PdfDictionary getAdditional()
Getter for property indexed.
Returns:
Value of property indexed.

getDpiX

public int getDpiX()
Gets the dots-per-inch in the X direction. Returns 0 if not available.
Returns:
the dots-per-inch in the X direction

getDpiY

public int getDpiY()
Gets the dots-per-inch in the Y direction. Returns 0 if not available.
Returns:
the dots-per-inch in the Y direction

getICCProfile

public ICC_Profile getICCProfile()
Gets the images ICC profile.
Returns:
the ICC profile

getImageMask

public Image getImageMask()
Gets the explicit masking.
Returns:
the explicit masking

getInstance

public static Image getInstance(Properties attributes)
            throws BadElementException,
                   MalformedURLException,
                   IOException
Returns an Image that has been constructed taking in account the value of some attributes .
Parameters:
attributes - Some attributes
Returns:
an Image

getInstance

public static Image getInstance(String filename)
            throws BadElementException,
                   MalformedURLException,
                   IOException
Gets an instance of an Image.
Parameters:
filename - a filename
Returns:
an object of type Gif,Jpeg or Png

getInstance

public static Image getInstance(URL url)
            throws BadElementException,
                   MalformedURLException,
                   IOException
Gets an instance of an Image.
Parameters:
url - an URL
Returns:
an Image

getInstance

public static Image getInstance(Image image)
gets an instance of an Image
Parameters:
image - an Image object
Returns:
a new Image object

getInstance

public static Image getInstance(PdfTemplate template)
            throws BadElementException
gets an instance of an Image
Parameters:
template - a PdfTemplate that has to be wrapped in an Image object
Returns:
an Image object

getInstance

public static Image getInstance(imgb[] )
            throws BadElementException,
                   MalformedURLException,
                   IOException
gets an instance of an Image
Parameters:
Returns:
an Image object

getInstance

public static Image getInstance(int width,
                                int height,
                                boolean reverseBits,
                                int typeCCITT,
                                int parameters,
                                byte[] data)
            throws BadElementException
Creates an Image with CCITT G3 or G4 compression. It assumes that the data bytes are already compressed.
Parameters:
width - the exact width of the image
height - the exact height of the image
reverseBits - reverses the bits in data. Bit 0 is swapped with bit 7 and so on
typeCCITT - the type of compression in data. It can be CCITTG4, CCITTG31D, CCITTG32D
parameters - parameters associated with this stream. Possible values are CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFLINE and CCITT_ENDOFBLOCK or a combination of them
data - the image data
Returns:
an Image object
Throws:
BadElementException - on error

getInstance

public static Image getInstance(int width,
                                int height,
                                boolean reverseBits,
                                int typeCCITT,
                                int parameters,
                                byte[] data,
                                transparency[] )
            throws BadElementException
Creates an Image with CCITT G3 or G4 compression. It assumes that the data bytes are already compressed.
Parameters:
width - the exact width of the image
height - the exact height of the image
reverseBits - reverses the bits in data. Bit 0 is swapped with bit 7 and so on
typeCCITT - the type of compression in data. It can be CCITTG4, CCITTG31D, CCITTG32D
parameters - parameters associated with this stream. Possible values are CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFLINE and CCITT_ENDOFBLOCK or a combination of them
data - the image data
Returns:
an Image object
Throws:
BadElementException - on error

getInstance

public static Image getInstance(int width,
                                int height,
                                int components,
                                int bpc,
                                data[] )
            throws BadElementException
Gets an instance of an Image in raw mode.
Parameters:
width - the width of the image in pixels
height - the height of the image in pixels
components - 1,3 or 4 for GrayScale, RGB and CMYK
bpc - bits per component
Returns:
an object of type ImgRaw
Throws:
BadElementException - on error

getInstance

public static Image getInstance(int width,
                                int height,
                                int components,
                                int bpc,
                                data[] ,
                                transparency[] )
            throws BadElementException
Gets an instance of an Image in raw mode.
Parameters:
width - the width of the image in pixels
height - the height of the image in pixels
components - 1,3 or 4 for GrayScale, RGB and CMYK
bpc - bits per component
Returns:
an object of type ImgRaw
Throws:
BadElementException - on error

getInstance

public static Image getInstance(java.awt.Image image,
                                java.awt.Color color)
            throws BadElementException,
                   IOException
Gets an instance of an Image from a java.awt.Image.
Parameters:
image - the java.awt.Image to convert
color - if different from null the transparency pixels are replaced by this color
Returns:
an object of type ImgRaw
Throws:
BadElementException - on error

getInstance

public static Image getInstance(java.awt.Image image,
                                java.awt.Color color,
                                boolean forceBW)
            throws BadElementException,
                   IOException
Gets an instance of an Image from a java.awt.Image.
Parameters:
image - the java.awt.Image to convert
color - if different from null the transparency pixels are replaced by this color
forceBW - if true the image is treated as black and white
Returns:
an object of type ImgRaw
Throws:
BadElementException - on error

getLayer

public PdfOCG getLayer()
Gets the layer this image belongs to.
Returns:
the layer this image belongs to or null for no layer defined

getMarkupAttribute

public String getMarkupAttribute(String name)
Specified by:
getMarkupAttribute in interface MarkupAttributes
Overrides:
getMarkupAttribute in interface Rectangle
See Also:
com.lowagie.text.MarkupAttributes.getMarkupAttribute(java.lang.String)

getMarkupAttributeNames

public Set getMarkupAttributeNames()
Specified by:
getMarkupAttributeNames in interface MarkupAttributes
Overrides:
getMarkupAttributeNames in interface Rectangle

getMarkupAttributes

public Properties getMarkupAttributes()
Specified by:
getMarkupAttributes in interface MarkupAttributes
Overrides:
getMarkupAttributes in interface Rectangle

getMySerialId

public Long getMySerialId()
Returns a serial id for the Image (reuse the same image more than once)
Returns:
a serialId

getOriginalData

public byte[] getOriginalData()
Getter for property originalData.
Returns:
Value of property originalData.

getOriginalType

public int getOriginalType()
Getter for property originalType.
Returns:
Value of property originalType.

getSerialId

protected static Long getSerialId()

getTransparency

public int[] getTransparency()
Returns the transparency.
Returns:
the transparency values

getWidthPercentage

public float getWidthPercentage()
Getter for property widthPercentage.
Returns:
Value of property widthPercentage.

getXYRatio

public float getXYRatio()
Gets the X/Y pixel dimensionless aspect ratio.
Returns:
the X/Y pixel dimensionless aspect ratio

hasAbsolutePosition

public boolean hasAbsolutePosition()
Checks if the Images has to be added at an absolute position.
Returns:
a boolean

hasAbsoluteX

public boolean hasAbsoluteX()
Checks if the Images has to be added at an absolute X position.
Returns:
a boolean

hasICCProfile

public boolean hasICCProfile()
Checks is the image has an ICC profile.
Returns:
the ICC profile or null

indentationLeft

public float indentationLeft()
Gets the left indentation.
Returns:
the left indentation

indentationRight

public float indentationRight()
Gets the right indentation.
Returns:
the right indentation

isDeflated

public boolean isDeflated()
Getter for property deflated.
Returns:
Value of property deflated.

isImgRaw

public boolean isImgRaw()
Returns true if the image is a ImgRaw -object.
Returns:
a boolean

isImgTemplate

public boolean isImgTemplate()
Returns true if the image is an ImgTemplate -object.
Returns:
a boolean

isInterpolation

public boolean isInterpolation()
Getter for property interpolation.
Returns:
Value of property interpolation.

isInvertMask

public boolean isInvertMask()
Returns true if the bits are to be inverted in the mask.
Returns:
true if the bits are to be inverted in the mask

isInverted

public boolean isInverted()
Getter for the inverted value
Returns:
true if the image is inverted

isJpeg

public boolean isJpeg()
Returns true if the image is a Jpeg -object.
Returns:
a boolean

isMask

public boolean isMask()
Returns true if this Image is a mask.
Returns:
true if this Image is a mask

isMaskCandidate

public boolean isMaskCandidate()
Returns true if this Image has the requisites to be a mask.
Returns:
true if this Image can be a mask

isSmask

public boolean isSmask()
Getter for property smask.
Returns:
Value of property smask.

isTag

public static boolean isTag(String tag)
Checks if a given tag corresponds with this object.
Parameters:
tag - the given tag
Returns:
true if the tag corresponds

makeMask

public void makeMask()
            throws DocumentException
Make this Image a mask.
Throws:
DocumentException - if this Image can not be a mask

matrix

public float[] matrix()
Returns the transformation matrix of the image.
Returns:
an array [AX, AY, BX, BY, CX, CY, DX, DY]

plainHeight

public float plainHeight()
Gets the plain height of the image.
Returns:
a value

plainWidth

public float plainWidth()
Gets the plain width of the image.
Returns:
a value

rawData

public byte[] rawData()
Gets the raw data for the image.

Remark: this only makes sense for Images of the type RawImage .

Returns:
the raw data

scaleAbsolute

public void scaleAbsolute(float newWidth,
                          float newHeight)
Scale the image to an absolute width and an absolute height.
Parameters:
newWidth - the new width
newHeight - the new height

scaleAbsoluteHeight

public void scaleAbsoluteHeight(float newHeight)
Scale the image to an absolute height.
Parameters:
newHeight - the new height

scaleAbsoluteWidth

public void scaleAbsoluteWidth(float newWidth)
Scale the image to an absolute width.
Parameters:
newWidth - the new width

scalePercent

public void scalePercent(float percent)
Scale the image to a certain percentage.
Parameters:
percent - the scaling percentage

scalePercent

public void scalePercent(float percentX,
                         float percentY)
Scale the width and height of an image to a certain percentage.
Parameters:
percentX - the scaling percentage of the width
percentY - the scaling percentage of the height

scaleToFit

public void scaleToFit(float fitWidth,
                       float fitHeight)
Scales the image so that it fits a certain width and height.
Parameters:
fitWidth - the width to fit
fitHeight - the height to fit

scaledHeight

public float scaledHeight()
Gets the scaled height of the image.
Returns:
a value

scaledWidth

public float scaledWidth()
Gets the scaled width of the image.
Returns:
a value

setAbsolutePosition

public void setAbsolutePosition(float absoluteX,
                                float absoluteY)
Sets the absolute position of the Image.
Parameters:
absoluteX -
absoluteY -

setAdditional

public void setAdditional(PdfDictionary additional)
Sets the /Colorspace key.
Parameters:
additional - New value of property indexed.

setAlignment

public void setAlignment(int alignment)
Sets the alignment for the image.
Parameters:
alignment - the alignment

setAlt

public void setAlt(String alt)
Sets the alternative information for the image.
Parameters:
alt - the alternative information

setAnnotation

public void setAnnotation(Annotation annotation)
Sets the annotation of this Image.
Parameters:
annotation - the annotation

setDeflated

public void setDeflated(boolean deflated)
Setter for property deflated.
Parameters:
deflated - New value of property deflated.

setDpi

public void setDpi(int dpiX,
                   int dpiY)
Sets the dots per inch value
Parameters:
dpiX - dpi for x coordinates
dpiY - dpi for y coordinates

setImageMask

public void setImageMask(Image mask)
            throws DocumentException
Sets the explicit masking.
Parameters:
mask - the mask to be applied
Throws:
DocumentException - on error

setIndentationLeft

public void setIndentationLeft(float f)
Sets the left indentation.
Parameters:
f -

setIndentationRight

public void setIndentationRight(float f)
Sets the right indentation.
Parameters:
f -

setInterpolation

public void setInterpolation(boolean interpolation)
Sets the image interpolation. Image interpolation attempts to produce a smooth transition between adjacent sample values.
Parameters:
interpolation - New value of property interpolation.

setInvertMask

public void setInvertMask(boolean invert)
Inverts the meaning of the bits of a mask.
Parameters:
invert - true to invert the meaning of the bits of a mask

setInverted

public void setInverted(boolean invert)
Sets inverted true or false
Parameters:
invert - true or false

setLayer

public void setLayer(PdfOCG layer)
Sets the layer this image belongs to.
Parameters:
layer - the layer this image belongs to

setMarkupAttribute

public void setMarkupAttribute(String name,
                               String value)
Specified by:
setMarkupAttribute in interface MarkupAttributes
Overrides:
setMarkupAttribute in interface Rectangle
See Also:
com.lowagie.text.MarkupAttributes.setMarkupAttribute(java.lang.String, java.lang.String)

setMarkupAttributes

public void setMarkupAttributes(Properties markupAttributes)
Specified by:
setMarkupAttributes in interface MarkupAttributes
Overrides:
setMarkupAttributes in interface Rectangle
See Also:
com.lowagie.text.MarkupAttributes.setMarkupAttributes(java.util.Properties)

setOriginalData

public void setOriginalData(byte[] originalData)
Setter for property originalData.
Parameters:
originalData - New value of property originalData.

setOriginalType

public void setOriginalType(int originalType)
Setter for property originalType.
Parameters:
originalType - New value of property originalType.

setRotation

public void setRotation(float r)
Sets the rotation of the image in radians.
Parameters:
r - rotation in radians

setRotationDegrees

public void setRotationDegrees(float deg)
Sets the rotation of the image in degrees.
Parameters:
deg - rotation in degrees

setSmask

public void setSmask(boolean smask)
Setter for property smask.
Parameters:
smask - New value of property smask.

setSpacingAfter

public void setSpacingAfter(float spacing)
Sets the spacing after this image.
Parameters:
spacing - the new spacing

setSpacingBefore

public void setSpacingBefore(float spacing)
Sets the spacing before this image.
Parameters:
spacing - the new spacing

setTemplateData

public void setTemplateData(PdfTemplate template)
Sets data from a PdfTemplate
Parameters:
template - the template with the content

setTransparency

public void setTransparency(transparency[] )
Sets the transparency values
Parameters:

setUrl

public void setUrl(URL url)
Sets the url of the image
Parameters:
url - the url of the image

setWidthPercentage

public void setWidthPercentage(float widthPercentage)
Setter for property widthPercentage.
Parameters:
widthPercentage - New value of property widthPercentage.

setXYRatio

public void setXYRatio(float XYRatio)
Sets the X/Y pixel dimensionless aspect ratio.
Parameters:
XYRatio - the X/Y pixel dimensionless aspect ratio

skip

public static void skip(InputStream is,
                        int size)
            throws IOException
This method is an alternative for the InputStream.skip() -method that doesn't seem to work properly for big values of size .
Parameters:
is - the InputStream
size - the number of bytes to skip

spacingAfter

public float spacingAfter()
Gets the spacing before this image.
Returns:
the spacing

spacingBefore

public float spacingBefore()
Gets the spacing before this image.
Returns:
the spacing

tagICC

public void tagICC(ICC_Profile profile)
Tags this image with an ICC profile.
Parameters:
profile - the profile

templateData

public PdfTemplate templateData()
Gets the template to be used as an image.

Remark: this only makes sense for Images of the type ImgTemplate .

Returns:
the template

toURL

public static URL toURL(String filename)
            throws MalformedURLException
This method makes a valid URL from a given filename.

This method makes the conversion of this library from the JAVA 2 platform to a JDK1.1.x-version easier.

Parameters:
filename - a given filename
Returns:
a valid URL

type

public int type()
Returns the type.
Specified by:
type in interface Element
Overrides:
type in interface Rectangle
Returns:
a type

url

public URL url()
Gets the String -representation of the reference to the image.
Returns:
a String