|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.itextpdf.text.Rectangle com.itextpdf.text.Image
public abstract class 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 HashMap<PdfName,PdfObject> |
accessibleAttributes
|
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
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. |
protected int |
compressionLevel
The compression level of the content streams. |
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
The image that serves as a mask for this image. |
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
Optional Content layer to which we want this Image to belong. |
static int |
LEFT
this is a kind of image alignment. |
protected boolean |
mask
Is this image a mask? |
static int |
MIDDLE
this is a kind of image alignment. |
protected Long |
mySerialId
an iText attributed unique id for this image. |
static int |
ORIGINAL_BMP
type of image |
static int |
ORIGINAL_GIF
type of image |
static int |
ORIGINAL_JBIG2
type of image |
static int |
ORIGINAL_JPEG
type of image |
static int |
ORIGINAL_JPEG2000
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 |
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 PdfName |
role
|
protected float |
rotationRadians
This is the rotation of the image in radians. |
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. |
protected boolean |
scaleToFitHeight
Indicates if the image should be scaled to fit when the image exceeds the available height. |
protected boolean |
scaleToFitLineWhenOverflow
Indicates if the image should be scaled to fit the line when the image exceeds the available width. |
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. |
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 image type. |
static int |
UNDERLYING
this is a kind of image alignment. |
protected URL |
url
The URL of the image. |
Fields inherited from class com.itextpdf.text.Rectangle |
---|
backgroundColor, border, borderColor, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, BOTTOM, BOX, llx, lly, NO_BORDER, rotation, TOP, UNDEFINED, urx, ury, useVariableBorders |
Fields inherited from interface com.itextpdf.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, CHAPTER, CHUNK, CREATIONDATE, CREATOR, DIV, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LANGUAGE, LIST, LISTITEM, MARKED, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, SECTION, SUBJECT, TITLE, WRITABLE_DIRECT, YMARK |
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 |
getAbsoluteX()
Returns the absolute X position. |
float |
getAbsoluteY()
Returns the absolute Y position. |
PdfObject |
getAccessibleAttribute(PdfName key)
Get the attribute of accessible element (everything in A dictionary + Lang , Alt , ActualText , E ). |
HashMap<PdfName,PdfObject> |
getAccessibleAttributes()
Gets all the properties of accessible element. |
PdfDictionary |
getAdditional()
Getter for the dictionary with additional information. |
int |
getAlignment()
Gets the alignment for the image. |
String |
getAlt()
Gets the alternative text for the image. |
Annotation |
getAnnotation()
Gets the annotation. |
int |
getBpc()
Gets the bpc for the image. |
int |
getColorspace()
Gets the colorspace for the image. |
int |
getCompressionLevel()
Returns the compression level used for images written as a compressed stream. |
PdfIndirectReference |
getDirectReference()
Getter for property directReference. |
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. |
UUID |
getId()
|
Image |
getImageMask()
Gets the explicit masking. |
float |
getImageRotation()
Gets the current image rotation in radians. |
float |
getIndentationLeft()
Gets the left indentation. |
float |
getIndentationRight()
Gets the right indentation. |
float |
getInitialRotation()
Getter for property initialRotation. |
static Image |
getInstance(byte[] imgb)
|
static Image |
getInstance(byte[] imgb,
boolean handleIncorrectImage)
gets an instance of an Image |
static Image |
getInstance(Image image)
gets an instance of an 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)
Creates an Image with CCITT G3 or G4 compression. |
static Image |
getInstance(int width,
int height,
boolean reverseBits,
int typeCCITT,
int parameters,
byte[] data,
int[] transparency)
Creates an Image with CCITT G3 or G4 compression. |
static Image |
getInstance(int width,
int height,
byte[] data,
byte[] globals)
Creates a JBIG2 Image. |
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(PdfContentByte cb,
Image awtImage,
float quality)
Gets an instance of a Image from a java.awt.Image. |
static Image |
getInstance(PdfTemplate template)
gets an instance of an Image |
static Image |
getInstance(PdfWriter writer,
Image awtImage,
float quality)
Gets an instance of a Image from a java.awt.Image. |
static Image |
getInstance(PRIndirectReference ref)
Reuses an existing image. |
static Image |
getInstance(String filename)
Gets an instance of an Image. |
static Image |
getInstance(String filename,
boolean handleIncorrectImage)
|
static Image |
getInstance(URL url)
|
static Image |
getInstance(URL url,
boolean handleIncorrectImage)
Gets an instance of an Image. |
PdfOCG |
getLayer()
Gets the layer this image belongs to. |
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. |
float |
getPlainHeight()
Gets the plain height of the image. |
float |
getPlainWidth()
Gets the plain width of the image. |
byte[] |
getRawData()
Gets the raw data for the image. |
PdfName |
getRole()
Gets the role of the accessible element. |
float |
getScaledHeight()
Gets the scaled height of the image. |
float |
getScaledWidth()
Gets the scaled width of the image. |
protected static Long |
getSerialId()
Creates a new serial id. |
float |
getSpacingAfter()
Gets the spacing before this image. |
float |
getSpacingBefore()
Gets the spacing before this image. |
PdfTemplate |
getTemplateData()
Gets the template to be used as an image. |
int[] |
getTransparency()
Returns the transparency. |
URL |
getUrl()
Gets the String -representation of the reference to the
image. |
float |
getWidthPercentage()
Getter for property widthPercentage. |
float |
getXYRatio()
Gets the X/Y pixel dimensionless aspect ratio. |
boolean |
hasAbsoluteX()
Checks if the Images has to be added at an absolute X
position. |
boolean |
hasAbsoluteY()
Checks if the Images has to be added at an absolute
position. |
boolean |
hasICCProfile()
Checks is the image has an ICC profile. |
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()
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 |
isNestable()
Checks if this element is nestable. |
boolean |
isScaleToFitHeight()
Gets the value of scaleToFitHeight. |
boolean |
isScaleToFitLineWhenOverflow()
Gets the value of scaleToFitLineWhenOverflow. |
boolean |
isSmask()
Getter for property smask. |
void |
makeMask()
Make this Image a mask. |
float[] |
matrix()
Returns the transformation matrix of the image. |
float[] |
matrix(float scalePercentage)
Returns the transformation matrix of the image. |
void |
scaleAbsolute(float newWidth,
float newHeight)
Scale the image to an absolute width and an absolute height. |
void |
scaleAbsolute(Rectangle rectangle)
Scale the image to the dimensions of the rectangle |
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. |
void |
scaleToFit(Rectangle rectangle)
Scales the images to the dimensions of the rectangle. |
void |
setAbsolutePosition(float absoluteX,
float absoluteY)
Sets the absolute position of the Image . |
void |
setAccessibleAttribute(PdfName key,
PdfObject value)
Set the attribute of accessible element (everything in A dictionary + Lang , Alt , ActualText , E ). |
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 |
setCompressionLevel(int compressionLevel)
Sets the compression level to be used if the image is written as a compressed stream. |
void |
setDeflated(boolean deflated)
Setter for property deflated. |
void |
setDirectReference(PdfIndirectReference directReference)
Setter for property directReference. |
void |
setDpi(int dpiX,
int dpiY)
Sets the dots per inch value |
void |
setId(UUID id)
|
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 |
setInitialRotation(float initialRotation)
Some image formats, like TIFF may present the images rotated that have to be compensated. |
void |
setInterpolation(boolean interpolation)
Sets the image interpolation. |
void |
setInverted(boolean invert)
Sets inverted true or false |
void |
setLayer(PdfOCG layer)
Sets the layer this image belongs to. |
void |
setOriginalData(byte[] originalData)
Setter for property originalData. |
void |
setOriginalType(int originalType)
Setter for property originalType. |
void |
setRole(PdfName role)
Sets the role of the accessiblee element. |
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 |
setScaleToFitHeight(boolean scaleToFitHeight)
Sets the value of scaleToFitHeight |
void |
setScaleToFitLineWhenOverflow(boolean scaleToFitLineWhenOverflow)
Sets the value of scaleToFitLineWhenOverflow |
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(int[] 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. |
void |
simplifyColorspace()
Replaces CalRGB and CalGray colorspaces with DeviceRGB and DeviceGray. |
void |
tagICC(ICC_Profile profile)
Tags this image with an ICC profile. |
int |
type()
Returns the type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
public static final int ORIGINAL_PS
public static final int ORIGINAL_JPEG2000
public static final int ORIGINAL_JBIG2
protected int type
protected URL url
protected byte[] rawData
protected int bpc
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 int compressionLevel
protected Long mySerialId
protected PdfName role
protected HashMap<PdfName,PdfObject> accessibleAttributes
protected float rotationRadians
protected float indentationLeft
protected float indentationRight
protected float spacingBefore
protected float spacingAfter
protected boolean scaleToFitLineWhenOverflow
protected boolean scaleToFitHeight
protected Annotation annotation
protected PdfOCG layer
protected boolean interpolation
protected int originalType
protected byte[] originalData
protected boolean deflated
protected int dpiX
protected int dpiY
protected int colorspace
protected boolean invert
protected ICC_Profile profile
protected boolean mask
protected Image imageMask
protected int[] transparency
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(URL url) throws BadElementException, MalformedURLException, IOException
BadElementException
MalformedURLException
IOException
public static Image getInstance(URL url, boolean handleIncorrectImage) throws BadElementException, MalformedURLException, IOException
url
- an URL
BadElementException
MalformedURLException
IOException
public static Image getInstance(String filename) throws BadElementException, MalformedURLException, IOException
filename
- a filename
Gif
,Jpeg
or
Png
BadElementException
MalformedURLException
IOException
public static Image getInstance(String filename, boolean handleIncorrectImage) throws IOException, BadElementException
IOException
BadElementException
public static Image getInstance(byte[] imgb) throws BadElementException, MalformedURLException, IOException
BadElementException
MalformedURLException
IOException
public static Image getInstance(byte[] imgb, boolean handleIncorrectImage) throws BadElementException, MalformedURLException, IOException
imgb
- raw image date
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 errorpublic static Image getInstance(int width, int height, byte[] data, byte[] globals)
width
- the width of the imageheight
- the height of the imagedata
- the raw image dataglobals
- JBIG2 globals
public static Image getInstance(int width, int height, boolean reverseBits, int typeCCITT, int parameters, byte[] data) throws BadElementException
width
- the exact width of the imageheight
- the exact height of the imagereverseBits
- reverses the bits in data
. Bit 0 is swapped
with bit 7 and so ontypeCCITT
- the type of compression in data
. It can be
CCITTG4, CCITTG31D, CCITTG32Dparameters
- parameters associated with this stream. Possible values are
CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFLINE and
CCITT_ENDOFBLOCK or a combination of themdata
- the image data
BadElementException
- on errorpublic static Image getInstance(int width, int height, boolean reverseBits, int typeCCITT, int parameters, byte[] data, int[] transparency) throws BadElementException
width
- the exact width of the imageheight
- the exact height of the imagereverseBits
- reverses the bits in data
. Bit 0 is swapped
with bit 7 and so ontypeCCITT
- the type of compression in data
. It can be
CCITTG4, CCITTG31D, CCITTG32Dparameters
- parameters associated with this stream. Possible values are
CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFLINE and
CCITT_ENDOFBLOCK or a combination of themdata
- the image datatransparency
- transparency information in the Mask format of the image
dictionary
BadElementException
- on errorpublic 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 errorpublic static Image getInstance(PdfTemplate template) throws BadElementException
template
- a PdfTemplate that has to be wrapped in an Image object
BadElementException
public PdfIndirectReference getDirectReference()
public void setDirectReference(PdfIndirectReference directReference)
directReference
- New value of property directReference.public static Image getInstance(PRIndirectReference ref) throws BadElementException
ref
- the reference to the image dictionary
BadElementException
- on errorpublic static Image getInstance(Image image)
image
- an Image object
public int type()
type
in interface Element
type
in class Rectangle
public boolean isNestable()
Element
isNestable
in interface Element
isNestable
in class Rectangle
Element.isNestable()
public boolean isJpeg()
true
if the image is a Jpeg
-object.
boolean
public boolean isImgRaw()
true
if the image is a ImgRaw
-object.
boolean
public boolean isImgTemplate()
true
if the image is an ImgTemplate
-object.
boolean
public URL getUrl()
String
-representation of the reference to the
image.
String
public void setUrl(URL url)
url
- the url of the imagepublic byte[] getRawData()
Remark: this only makes sense for Images of the type RawImage
.
public int getBpc()
Remark: this only makes sense for Images of the type RawImage
.
public PdfTemplate getTemplateData()
Remark: this only makes sense for Images of the type ImgTemplate
.
public void setTemplateData(PdfTemplate template)
template
- the template with the contentpublic int getAlignment()
public void setAlignment(int alignment)
alignment
- the alignmentpublic String getAlt()
String
public void setAlt(String alt)
alt
- the alternative informationpublic void setAbsolutePosition(float absoluteX, float absoluteY)
Image
.
absoluteX
- absoluteY
- public boolean hasAbsoluteX()
Images
has to be added at an absolute X
position.
public float getAbsoluteX()
public boolean hasAbsoluteY()
Images
has to be added at an absolute
position.
public float getAbsoluteY()
public float getScaledWidth()
public float getScaledHeight()
public float getPlainWidth()
public float getPlainHeight()
public void scaleAbsolute(Rectangle rectangle)
rectangle
- dimensions to scale the Imagepublic 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 percentagepublic void scalePercent(float percentX, float percentY)
percentX
- the scaling percentage of the widthpercentY
- the scaling percentage of the heightpublic void scaleToFit(Rectangle rectangle)
rectangle
- the dimensions to fitpublic void scaleToFit(float fitWidth, float fitHeight)
fitWidth
- the width to fitfitHeight
- the height to fitpublic float[] matrix()
public float[] matrix(float scalePercentage)
protected static Long getSerialId()
public Long getMySerialId()
public float getImageRotation()
public void setRotation(float r)
r
- rotation in radianspublic void setRotationDegrees(float deg)
deg
- rotation in degreespublic float getInitialRotation()
public void setInitialRotation(float initialRotation)
initialRotation
- New value of property initialRotation.public float getIndentationLeft()
getIndentationLeft
in interface Indentable
public void setIndentationLeft(float f)
setIndentationLeft
in interface Indentable
f
- public float getIndentationRight()
getIndentationRight
in interface Indentable
public void setIndentationRight(float f)
setIndentationRight
in interface Indentable
f
- public float getSpacingBefore()
getSpacingBefore
in interface Spaceable
public void setSpacingBefore(float spacing)
setSpacingBefore
in interface Spaceable
spacing
- the new spacingpublic float getSpacingAfter()
getSpacingAfter
in interface Spaceable
public void setSpacingAfter(float spacing)
setSpacingAfter
in interface Spaceable
spacing
- the new spacingpublic float getWidthPercentage()
public void setWidthPercentage(float widthPercentage)
widthPercentage
- New value of property widthPercentage.public boolean isScaleToFitLineWhenOverflow()
public void setScaleToFitLineWhenOverflow(boolean scaleToFitLineWhenOverflow)
scaleToFitLineWhenOverflow
- true if you want the image to scale to the available widthpublic boolean isScaleToFitHeight()
public void setScaleToFitHeight(boolean scaleToFitHeight)
scaleToFitHeight
- true if you want the image to scale to the available heightpublic void setAnnotation(Annotation annotation)
annotation
- the annotationpublic Annotation getAnnotation()
public PdfOCG getLayer()
null
for no
layer definedpublic void setLayer(PdfOCG layer)
layer
- the layer this image belongs topublic boolean isInterpolation()
public void setInterpolation(boolean interpolation)
interpolation
- New value of property interpolation.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 boolean isDeflated()
public void setDeflated(boolean deflated)
deflated
- New value of property deflated.public int getDpiX()
public int getDpiY()
public void setDpi(int dpiX, int dpiY)
dpiX
- dpi for x coordinatesdpiY
- dpi for y coordinatespublic float getXYRatio()
public void setXYRatio(float XYRatio)
XYRatio
- the X/Y pixel dimensionless aspect ratiopublic int getColorspace()
Remark: this only makes sense for Images of the type Jpeg
.
public boolean isInverted()
public void setInverted(boolean invert)
invert
- true or falsepublic void tagICC(ICC_Profile profile)
profile
- the profilepublic boolean hasICCProfile()
null
public ICC_Profile getICCProfile()
public PdfDictionary getAdditional()
public void setAdditional(PdfDictionary additional)
additional
- a PdfDictionary with additional information.public void simplifyColorspace()
public boolean isMask()
true
if this Image
is a mask.
true
if this Image
is a maskpublic void makeMask() throws DocumentException
Image
a mask.
DocumentException
- if this Image
can not be a maskpublic boolean isMaskCandidate()
true
if this Image
has the
requisites to be a mask.
true
if this Image
can be a maskpublic Image getImageMask()
public void setImageMask(Image mask) throws DocumentException
mask
- the mask to be applied
DocumentException
- on errorpublic boolean isSmask()
public void setSmask(boolean smask)
smask
- New value of property smask.public int[] getTransparency()
public void setTransparency(int[] transparency)
transparency
- the transparency valuespublic int getCompressionLevel()
public void setCompressionLevel(int compressionLevel)
compressionLevel
- a value between 0 (best speed) and 9 (best compression)public PdfObject getAccessibleAttribute(PdfName key)
IAccessibleElement
A
dictionary + Lang
, Alt
, ActualText
, E
).
getAccessibleAttribute
in interface IAccessibleElement
public void setAccessibleAttribute(PdfName key, PdfObject value)
IAccessibleElement
A
dictionary + Lang
, Alt
, ActualText
, E
).
setAccessibleAttribute
in interface IAccessibleElement
public HashMap<PdfName,PdfObject> getAccessibleAttributes()
IAccessibleElement
getAccessibleAttributes
in interface IAccessibleElement
public PdfName getRole()
IAccessibleElement
getRole
in interface IAccessibleElement
public void setRole(PdfName role)
IAccessibleElement
null
if you don't want to tag this element.
Note that all child elements won't also be tagged.
setRole
in interface IAccessibleElement
public UUID getId()
getId
in interface IAccessibleElement
public void setId(UUID id)
setId
in interface IAccessibleElement
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 errorpublic 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 errorpublic static Image getInstance(PdfWriter writer, Image awtImage, float quality) throws BadElementException, IOException
writer
- the PdfWriter
object to which the image will be addedawtImage
- the java.awt.Image
to convertquality
- a float value between 0 and 1
PdfTemplate
BadElementException
- on error
IOException
public static Image getInstance(PdfContentByte cb, Image awtImage, float quality) throws BadElementException, IOException
cb
- the PdfContentByte
object to which the image will be addedawtImage
- the java.awt.Image
to convertquality
- a float value between 0 and 1
PdfTemplate
BadElementException
- on error
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |