|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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. |
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. |
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 boolean |
deflated
Holds value of property deflated. |
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 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 |
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
|
static int |
ORIGINAL_BMP
|
static int |
ORIGINAL_GIF
|
static int |
ORIGINAL_JPEG
|
static int |
ORIGINAL_NONE
|
static int |
ORIGINAL_PNG
|
static int |
ORIGINAL_TIFF
|
static int |
ORIGINAL_WMF
|
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. |
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
|
private boolean |
smask
Holds value of property smask. |
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. |
private float |
XYRatio
Holds value of property XYRatio. |
| 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_JUSTIFIED_ALL, 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, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, PARAGRAPH, PHRASE, 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. |
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(byte[] imgb)
|
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()
|
byte[] |
getOriginalData()
Getter for property originalData. |
int |
getOriginalType()
Getter for property originalType. |
protected static Long |
getSerialId()
|
int[] |
getTransparency()
Returns the transparency. |
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 |
isInverted()
|
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 |
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. |
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 |
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)
|
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 |
setInverted(boolean invert)
|
void |
setInvertMask(boolean invert)
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 |
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 |
setTemplateData(PdfTemplate template)
|
void |
setTransparency(int[] transparency)
|
void |
setUrl(URL url)
|
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. |
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
public static final int ORIGINAL_NONE
public static final int ORIGINAL_JPEG
public static final int ORIGINAL_PNG
public static final int ORIGINAL_GIF
public static final int ORIGINAL_BMP
public static final int ORIGINAL_TIFF
public static final int ORIGINAL_WMF
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 float indentationLeft
protected float indentationRight
protected Long mySerialId
static long serialId
protected int dpiX
protected int dpiY
protected boolean mask
protected Image imageMask
protected boolean interpolation
protected Annotation annotation
protected Properties markupAttributes
protected ICC_Profile profile
protected boolean deflated
private PdfDictionary additional
private boolean smask
private float XYRatio
protected int originalType
protected byte[] originalData
| 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
BadElementException
MalformedURLException
IOException
public static Image getInstance(byte[] imgb)
throws BadElementException,
MalformedURLException,
IOException
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(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 isJpeg()
true if the image is a Jpeg-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 void setTransparency(int[] transparency)
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 void setDpi(int dpiX,
int dpiY)
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 invert)
invert - 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 isInverted()
public void setInverted(boolean invert)
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 RectangleMarkupAttributes.setMarkupAttribute(java.lang.String, java.lang.String)public void setMarkupAttributes(Properties markupAttributes)
MarkupAttributes
setMarkupAttributes in interface MarkupAttributessetMarkupAttributes in class RectangleMarkupAttributes.setMarkupAttributes(java.util.Properties)public String getMarkupAttribute(String name)
MarkupAttributes
getMarkupAttribute in interface MarkupAttributesgetMarkupAttribute in class RectangleMarkupAttributes.getMarkupAttribute(java.lang.String)public Set getMarkupAttributeNames()
MarkupAttributesSet of String attribute names for the
MarkupAttributes implementor.
getMarkupAttributeNames in interface MarkupAttributesgetMarkupAttributeNames in class RectangleMarkupAttributes.getMarkupAttributeNames()public Properties getMarkupAttributes()
MarkupAttributesProperties-object containing all the markupAttributes.
getMarkupAttributes in interface MarkupAttributesgetMarkupAttributes in class RectangleMarkupAttributes.getMarkupAttributes()public void tagICC(ICC_Profile profile)
profile - the profilepublic boolean hasICCProfile()
nullpublic ICC_Profile getICCProfile()
public boolean isDeflated()
public void setDeflated(boolean deflated)
deflated - New value of property deflated.public PdfDictionary getAdditional()
public void setAdditional(PdfDictionary additional)
public boolean isSmask()
public void setSmask(boolean smask)
smask - New value of property smask.public float getXYRatio()
public void setXYRatio(float XYRatio)
XYRatio - the X/Y pixel dimensionless aspect ratiopublic float indentationLeft()
public float indentationRight()
public void setIndentationLeft(float f)
f - public void setIndentationRight(float f)
f - public int getOriginalType()
public void setOriginalType(int originalType)
originalType - New value of property originalType.public byte[] getOriginalData()
public void setOriginalData(byte[] originalData)
originalData - New value of property originalData.public void setUrl(URL url)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||