|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.lowagie.text.Rectangle
|
+--com.lowagie.text.Image
An Image is the representation of a graphic element (JPEG, PNG or GIF)
that has to be inserted into the document
Element,
Rectangle| Field Summary | |
protected float |
absoluteX
This is the absolute X-position of the image. |
protected float |
absoluteY
This is the absolute Y-position of the image. |
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. |
static int |
AX
This represents a coordinate in the transformation matrix. |
static int |
AY
This represents a coordinate in the transformation matrix. |
protected int |
bpc
this is the bits per component of the raw image. |
static int |
BX
This represents a coordinate in the transformation matrix. |
static int |
BY
This represents a coordinate in the transformation matrix. |
protected int |
colorspace
this is the colorspace of a jpeg-image. |
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. |
protected int |
dpiX
Holds value of property dpiX. |
protected int |
dpiY
Holds value of property dpiY. |
static int |
DX
This represents a coordinate in the transformation matrix. |
static int |
DY
This represents a coordinate in the transformation matrix. |
protected Image |
imageMask
|
protected boolean |
interpolation
Holds value of property interpolation. |
protected boolean |
invert
Adobe invert CMYK JPEG |
protected boolean |
invertMask
|
static int |
LEFT
this is a kind of image alignment. |
protected Properties |
markupAttributes
Contains extra markupAttributes |
protected boolean |
mask
|
static int |
MIDDLE
this is a kind of image alignment. |
protected Long |
mySerialId
|
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. |
static int |
RIGHT
this is a kind of image alignment. |
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
|
protected PdfTemplate[] |
template
The template to be treated as an image. |
static int |
TEXTWRAP
this is a kind of image alignment. |
protected int[] |
transparency
this is the transparency information of the raw image |
protected int |
type
The imagetype. |
static int |
UNDERLYING
this is a kind of image alignment. |
protected URL |
url
The URL of the image. |
| Fields inherited from class com.lowagie.text.Rectangle |
background, border, borderWidth, BOTTOM, BOX, color, grayFill, llx, lly, NO_BORDER, TOP, UNDEFINED, urx, ury |
| Fields inherited from interface com.lowagie.text.Element |
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GIF, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, PARAGRAPH, PHRASE, PNG, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE |
| Constructor Summary | |
protected |
Image(Image image)
Constructs an Image-object, using an url. |
|
Image(URL url)
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. |
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(byte[] img)
Gets an instance of an Image. |
static Image |
getInstance(Image image)
|
static Image |
getInstance(Image image,
Color color)
Gets an instance of an Image from a java.awt.Image. |
static Image |
getInstance(Image image,
Color color,
boolean forceBW)
Gets an instance of an Image from a java.awt.Image. |
static Image |
getInstance(int width,
int height,
boolean reverseBits,
int typeCCITT,
int parameters,
byte[] data)
|
static Image |
getInstance(int width,
int height,
boolean reverseBits,
int typeCCITT,
int parameters,
byte[] data,
int[] transparency)
|
static Image |
getInstance(int width,
int height,
int components,
int bpc,
byte[] data)
Gets an instance of an Image in raw mode. |
static Image |
getInstance(int width,
int height,
int components,
int bpc,
byte[] data,
int[] transparency)
Gets an instance of an Image in raw mode. |
static Image |
getInstance(PdfTemplate template)
|
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. |
String |
getMarkupAttribute(String name)
Returns the value of the specified attribute. |
Set |
getMarkupAttributeNames()
Returns a Set of String attribute names for the
MarkupAttributes implementor. |
Properties |
getMarkupAttributes()
Return a Properties-object containing all the markupAttributes. |
Long |
getMySerialId()
|
protected static Long |
getSerialId()
|
int[] |
getTransparency()
Returns the transparency. |
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. |
boolean |
isGif()
Returns true if the image is a Gif-object. |
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 |
isInvertedJPEG()
|
boolean |
isInvertMask()
Returns true if the bits are to be inverted
in the mask. |
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 |
isPng()
Returns true if the image is a Png-object. |
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. |
float |
scaledHeight()
Gets the scaled height of the image. |
float |
scaledWidth()
Gets the scaled width of the image. |
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. |
void |
setAbsolutePosition(float absoluteX,
float absoluteY)
Sets the absolute position of the Image. |
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 |
setImageMask(Image mask)
Sets the explicit masking. |
void |
setInterpolation(boolean interpolation)
Sets the image interpolation. |
void |
setInvertMask(boolean invertMask)
Inverts the meaning of the bits of a mask. |
void |
setMarkupAttribute(String name,
String value)
Sets the specified attribute. |
void |
setMarkupAttributes(Properties markupAttributes)
Sets the markupAttributes. |
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 |
setTemplateData(PdfTemplate template)
|
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. |
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, getChunks, getRotation, grayFill, hasBorder, hasBorders, height, left, left, process, rectangle, right, right, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderWidth, setBottom, setGrayFill, setLeft, setRight, setTop, top, top, width |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.lowagie.text.Element |
getChunks, process, toString |
| Field Detail |
public static final int DEFAULT
public static final int RIGHT
public static final int LEFT
public static final int MIDDLE
public static final int TEXTWRAP
public static final int UNDERLYING
public static final int AX
public static final int AY
public static final int BX
public static final int BY
public static final int CX
public static final int CY
public static final int DX
public static final int DY
protected boolean invert
protected int type
protected URL url
protected byte[] rawData
protected PdfTemplate[] template
protected int alignment
protected String alt
protected float absoluteX
protected float absoluteY
protected float plainWidth
protected float plainHeight
protected float scaledWidth
protected float scaledHeight
protected float rotation
protected int colorspace
protected int bpc
protected int[] transparency
protected Long mySerialId
static long serialId
protected int dpiX
protected int dpiY
protected boolean mask
protected Image imageMask
protected boolean invertMask
protected boolean interpolation
protected Annotation annotation
protected Properties markupAttributes
protected ICC_Profile profile
| Constructor Detail |
public Image(URL url)
Image-object, using an url.
url - the URL where the image can be found.protected Image(Image image)
Image-object, using an url.
image - another Image object.| Method Detail |
public static Image getInstance(Image image)
public static Image getInstance(URL url)
throws BadElementException,
MalformedURLException,
IOException
url - an URL
Gif, Jpeg or Png
BadElementException
MalformedURLException
IOException
public static Image getInstance(Image image,
Color color,
boolean forceBW)
throws BadElementException,
IOException
image - the java.awt.Image to convertcolor - if different from null the transparency
pixels are replaced by this colorforceBW - if true the image is treated as black and white
ImgRaw
BadElementException - on error
IOException - on error
public static Image getInstance(Image image,
Color color)
throws BadElementException,
IOException
image - the java.awt.Image to convertcolor - if different from null the transparency
pixels are replaced by this color
ImgRaw
BadElementException - on error
IOException - on error
public static Image getInstance(String filename)
throws BadElementException,
MalformedURLException,
IOException
filename - a filename
Gif, Jpeg or Png
BadElementException
MalformedURLException
IOException
public static Image getInstance(byte[] img)
throws BadElementException,
MalformedURLException,
IOException
img - a byte array
Gif, Jpeg or Png
BadElementException
MalformedURLException
IOException
public static Image getInstance(int width,
int height,
int components,
int bpc,
byte[] data)
throws BadElementException
width - the width of the image in pixelsheight - the height of the image in pixelscomponents - 1,3 or 4 for GrayScale, RGB and CMYKdata - the image databpc - bits per component
ImgRaw
BadElementException - on error
public static Image getInstance(PdfTemplate template)
throws BadElementException
BadElementException
public static Image getInstance(int width,
int height,
boolean reverseBits,
int typeCCITT,
int parameters,
byte[] data)
throws BadElementException
BadElementException
public static Image getInstance(int width,
int height,
boolean reverseBits,
int typeCCITT,
int parameters,
byte[] data,
int[] transparency)
throws BadElementException
BadElementException
public static Image getInstance(int width,
int height,
int components,
int bpc,
byte[] data,
int[] transparency)
throws BadElementException
width - the width of the image in pixelsheight - the height of the image in pixelscomponents - 1,3 or 4 for GrayScale, RGB and CMYKdata - the image databpc - bits per componenttransparency - transparency information in the Mask format of the
image dictionary
ImgRaw
BadElementException - on error
public static Image getInstance(Properties attributes)
throws BadElementException,
MalformedURLException,
IOException
Image that has been constructed taking in account
the value of some attributes.
attributes - Some attributes
Image
BadElementException
MalformedURLException
IOExceptionpublic void setAlignment(int alignment)
alignment - the alignmentpublic void setAlt(String alt)
alt - the alternative information
public void setAbsolutePosition(float absoluteX,
float absoluteY)
Image.
absoluteX - absoluteY -
public void scaleAbsolute(float newWidth,
float newHeight)
newWidth - the new widthnewHeight - the new heightpublic void scaleAbsoluteWidth(float newWidth)
newWidth - the new widthpublic void scaleAbsoluteHeight(float newHeight)
newHeight - the new heightpublic void scalePercent(float percent)
percent - the scaling percentage
public void scalePercent(float percentX,
float percentY)
percentX - the scaling percentage of the widthpercentY - the scaling percentage of the height
public void scaleToFit(float fitWidth,
float fitHeight)
fitWidth - the width to fitfitHeight - the height to fitpublic void setRotation(float r)
r - rotation in radianspublic void setRotationDegrees(float deg)
deg - rotation in degreespublic void setAnnotation(Annotation annotation)
annotation - the annotationpublic Annotation annotation()
public int bpc()
Remark: this only makes sense for Images of the type RawImage.
public byte[] rawData()
Remark: this only makes sense for Images of the type RawImage.
public PdfTemplate templateData()
Remark: this only makes sense for Images of the type ImgTemplate.
public void setTemplateData(PdfTemplate template)
public boolean hasAbsolutePosition()
Images has to be added at an absolute position.
public boolean hasAbsoluteX()
Images has to be added at an absolute X position.
public float absoluteX()
public float absoluteY()
public int type()
type in interface Elementtype in class Rectanglepublic boolean isGif()
true if the image is a Gif-object.
booleanpublic boolean isJpeg()
true if the image is a Jpeg-object.
booleanpublic boolean isPng()
true if the image is a Png-object.
booleanpublic boolean isImgRaw()
true if the image is a ImgRaw-object.
booleanpublic boolean isImgTemplate()
true if the image is an ImgTemplate-object.
booleanpublic URL url()
String-representation of the reference to the image.
Stringpublic int alignment()
public String alt()
Stringpublic float scaledWidth()
public float scaledHeight()
public int colorspace()
Remark: this only makes sense for Images of the type Jpeg.
public float[] matrix()
public static void skip(InputStream is,
int size)
throws IOException
InputStream.skip()-method
that doesn't seem to work properly for big values of size.
is - the InputStreamsize - the number of bytes to skip
IOException
public static URL toURL(String filename)
throws MalformedURLException
This method makes the conversion of this library from the JAVA 2 platform to a JDK1.1.x-version easier.
filename - a given filename
MalformedURLExceptionpublic int[] getTransparency()
public static boolean isTag(String tag)
tag - the given tag
public float plainWidth()
public float plainHeight()
protected static Long getSerialId()
public Long getMySerialId()
public int getDpiX()
public int getDpiY()
public boolean isMaskCandidate()
true if this Image has the
requisites to be a mask.
true if this Image can be a mask
public void makeMask()
throws DocumentException
Image a mask.
DocumentException - if this Image can not be a mask
public void setImageMask(Image mask)
throws DocumentException
mask - the mask to be applied
DocumentException - on errorpublic Image getImageMask()
public boolean isMask()
true if this Image is a mask.
true if this Image is a maskpublic void setInvertMask(boolean invertMask)
invertMask - true to invert the meaning of the bits of a maskpublic boolean isInvertMask()
true if the bits are to be inverted
in the mask.
true if the bits are to be inverted in the maskpublic boolean isInvertedJPEG()
public boolean isInterpolation()
public void setInterpolation(boolean interpolation)
interpolation - New value of property interpolation.
public void setMarkupAttribute(String name,
String value)
MarkupAttributes
setMarkupAttribute in interface MarkupAttributessetMarkupAttribute in class Rectanglename - String attribute name.value - String attribute value.MarkupAttributes.setMarkupAttribute(java.lang.String, java.lang.String)public void setMarkupAttributes(Properties markupAttributes)
MarkupAttributes
setMarkupAttributes in interface MarkupAttributessetMarkupAttributes in class RectanglemarkupAttributes - a Properties-object containing markupattributesMarkupAttributes.setMarkupAttributes(java.util.Properties)public String getMarkupAttribute(String name)
MarkupAttributes
getMarkupAttribute in interface MarkupAttributesgetMarkupAttribute in class Rectanglename - String attribute name.
String.MarkupAttributes.getMarkupAttribute(java.lang.String)public Set getMarkupAttributeNames()
MarkupAttributesSet of String attribute names for the
MarkupAttributes implementor.
getMarkupAttributeNames in interface MarkupAttributesgetMarkupAttributeNames in class RectangleSet.MarkupAttributes.getMarkupAttributeNames()public Properties getMarkupAttributes()
MarkupAttributesProperties-object containing all the markupAttributes.
getMarkupAttributes in interface MarkupAttributesgetMarkupAttributes in class RectanglePropertiesMarkupAttributes.getMarkupAttributes()public void tagICC(ICC_Profile profile)
profile - the profilepublic boolean hasICCProfile()
nullpublic ICC_Profile getICCProfile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||