public abstract class Image extends Rectangle implements Indentable, Spaceable, IAccessibleElement, IAlternateDescription
Image
is the representation of a graphic element (JPEG, PNG or GIF) that has to be inserted into the document
Modifier and Type | Field and Description |
---|---|
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 |
colortransform |
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 |
paddingTop
Padding top
|
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.
|
backgroundColor, border, borderColor, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, BOTTOM, BOX, llx, lly, NO_BORDER, rotation, TOP, UNDEFINED, urx, ury, useVariableBorders
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, BODY, 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
Modifier | Constructor and Description |
---|---|
protected |
Image(Image image)
Constructs an Image -object, using an url .
|
|
Image(URL url)
Constructs an Image -object, using an url .
|
Modifier and Type | Method and Description |
---|---|
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 |
getColorTransform() |
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.
|
AccessibleElementId |
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 recoverFromImageError)
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 recoverFromImageError) |
static Image |
getInstance(URL url) |
static Image |
getInstance(URL url, boolean recoverFromImageError)
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 |
getPaddingTop() |
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 |
isInline() |
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 |
setColorTransform(int c) |
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(AccessibleElementId 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 |
setPaddingTop(float paddingTop) |
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.
|
cloneNonPositionParameters, disableBorderSide, enableBorderSide, equals, getBackgroundColor, getBorder, getBorderColor, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidth, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getBottom, getBottom, getChunks, getGrayFill, getHeight, getLeft, getLeft, getRight, getRight, getRotation, getTop, getTop, getWidth, hasBorder, hasBorders, isContent, isUseVariableBorders, normalize, process, rectangle, rotate, setBackgroundColor, setBorder, setBorderColor, setBorderColorBottom, setBorderColorLeft, setBorderColorRight, setBorderColorTop, setBorderWidth, setBorderWidthBottom, setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, setBottom, setGrayFill, setLeft, setRight, setRotation, setTop, setUseVariableBorders, softCloneNonPositionParameters, toString
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 float rotationRadians
protected float indentationLeft
protected float indentationRight
protected float spacingBefore
protected float spacingAfter
protected float paddingTop
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 int colortransform
protected boolean invert
protected ICC_Profile profile
protected boolean mask
protected Image imageMask
protected int[] transparency
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.
public static Image getInstance(URL url) throws BadElementException, MalformedURLException, IOException
public static Image getInstance(URL url, boolean recoverFromImageError) 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 recoverFromImageError) throws IOException, BadElementException
IOException
BadElementException
public static Image getInstance(byte[] imgb) throws BadElementException, MalformedURLException, IOException
public static Image getInstance(byte[] imgb, boolean recoverFromImageError) 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 pixels
height
- the height of the image in pixels
components
- 1,3 or 4 for GrayScale, RGB and CMYK
data
- the image data
bpc
- bits per component
ImgRaw
BadElementException
- on error
public static Image getInstance(int width, int height, byte[] data, byte[] globals)
width
- the width of the image
height
- the height of the image
data
- the raw image data
globals
- 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 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
BadElementException
- on error
public 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 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
transparency
- transparency information in the Mask format of the image dictionary
BadElementException
- on error
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 pixels
height
- the height of the image in pixels
components
- 1,3 or 4 for GrayScale, RGB and CMYK
data
- the image data
bpc
- bits per component
transparency
- transparency information in the Mask format of the image dictionary
ImgRaw
BadElementException
- on error
public 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 error
public static Image getInstance(Image image)
image
- an Image object
public int type()
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 image
public 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 content
public int getAlignment()
public void setAlignment(int alignment)
alignment
- the alignment
public String getAlt()
getAlt
in interface IAlternateDescription
String
public void setAlt(String alt)
setAlt
in interface IAlternateDescription
alt
- the alternative information
public 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 Image
public void scaleAbsolute(float newWidth, float newHeight)
newWidth
- the new width
newHeight
- the new height
public void scaleAbsoluteWidth(float newWidth)
newWidth
- the new width
public void scaleAbsoluteHeight(float newHeight)
newHeight
- the new height
public void scalePercent(float percent)
percent
- the scaling percentage
public void scalePercent(float percentX, float percentY)
percentX
- the scaling percentage of the width
percentY
- the scaling percentage of the height
public void scaleToFit(Rectangle rectangle)
rectangle
- the dimensions to fit
public void scaleToFit(float fitWidth, float fitHeight)
fitWidth
- the width to fit
fitHeight
- the height to fit
public 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 radians
public void setRotationDegrees(float deg)
deg
- rotation in degrees
public 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 spacing
public float getSpacingAfter()
getSpacingAfter
in interface Spaceable
public void setSpacingAfter(float spacing)
setSpacingAfter
in interface Spaceable
spacing
- the new spacing
public float getPaddingTop()
getPaddingTop
in interface Spaceable
public void setPaddingTop(float paddingTop)
setPaddingTop
in interface Spaceable
public 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 width
public boolean isScaleToFitHeight()
public void setScaleToFitHeight(boolean scaleToFitHeight)
scaleToFitHeight
- true if you want the image to scale to the available height
public void setAnnotation(Annotation annotation)
annotation
- the annotation
public Annotation getAnnotation()
public PdfOCG getLayer()
null
for no layer defined
public void setLayer(PdfOCG layer)
layer
- the layer this image belongs to
public 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 coordinates
dpiY
- dpi for y coordinates
public float getXYRatio()
public void setXYRatio(float XYRatio)
XYRatio
- the X/Y pixel dimensionless aspect ratio
public int getColorspace()
Remark: this only makes sense for Images of the type Jpeg
.
public void setColorTransform(int c)
public int getColorTransform()
public boolean isInverted()
public void setInverted(boolean invert)
invert
- true or false
public void tagICC(ICC_Profile profile)
profile
- the profile
public 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 mask
public void makeMask() throws DocumentException
Image
a mask.
DocumentException
- if this Image
can not be a mask
public boolean isMaskCandidate()
true
if this Image
has the requisites to be a mask.
true
if this Image
can be a mask
public Image getImageMask()
public void setImageMask(Image mask) throws DocumentException
mask
- the mask to be applied
DocumentException
- on error
public boolean isSmask()
public void setSmask(boolean smask)
smask
- New value of property smask.
public int[] getTransparency()
public void setTransparency(int[] transparency)
transparency
- the transparency values
public 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 AccessibleElementId getId()
getId
in interface IAccessibleElement
public void setId(AccessibleElementId id)
setId
in interface IAccessibleElement
public boolean isInline()
isInline
in interface IAccessibleElement
public static Image getInstance(Image image, Color color, boolean forceBW) throws BadElementException, IOException
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
ImgRaw
BadElementException
- on error
IOException
- on error
public static Image getInstance(Image image, Color color) throws BadElementException, IOException
image
- the java.awt.Image
to convert
color
- if different from null
the transparency pixels are replaced by this color
ImgRaw
BadElementException
- on error
IOException
- on error
public static Image getInstance(PdfWriter writer, Image awtImage, float quality) throws BadElementException, IOException
writer
- the PdfWriter
object to which the image will be added
awtImage
- the java.awt.Image
to convert
quality
- 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 added
awtImage
- the java.awt.Image
to convert
quality
- a float value between 0 and 1
PdfTemplate
BadElementException
- on error
IOException
Copyright © 2016. All rights reserved.