public class Image extends AbstractElement<Image> implements ILeafElement, IAccessibleElement
Modifier and Type | Field and Description |
---|---|
protected PdfName |
role |
protected AccessibilityProperties |
tagProperties |
protected PdfXObject |
xObject |
childElements, nextRenderer, styles
properties
Constructor and Description |
---|
Image(ImageData img)
Creates an Image from an image resource, read in from a file with the iText I/O module.
|
Image(ImageData img, float x, float y)
Creates an Image from an image resource, read in from a file with the iText I/O module, on a fixed position.
|
Image(ImageData img, float x, float y, float width)
Creates an Image from an image resource, read in from a file with the iText I/O module, with a custom width and on a fixed position.
|
Image(PdfFormXObject xObject)
Creates an Image from a form XObject, the representation of a form in PDF syntax.
|
Image(PdfFormXObject xObject, float x, float y)
Creates an Image from a form XObject, the representation of a form in PDF syntax.
|
Image(PdfImageXObject xObject)
Creates an Image from an image XObject, the representation of an image in PDF syntax.
|
Image(PdfImageXObject xObject, float width)
Creates an Image from an image XObject, the representation of an image in PDF syntax, with a custom width.
|
Image(PdfImageXObject xObject, float x, float y)
Creates an Image from an image XObject, the representation of an image in PDF syntax, on a fixed position.
|
Image(PdfImageXObject xObject, float x, float y, float width)
Creates an Image from an image XObject, the representation of an image in PDF syntax, with a custom width and on a fixed position.
|
Modifier and Type | Method and Description |
---|---|
AccessibilityProperties |
getAccessibilityProperties()
Gets the accessibility properties .
|
float |
getImageHeight()
Gets height of the image.
|
float |
getImageScaledHeight()
Gets scaled height of the image.
|
float |
getImageScaledWidth()
Gets scaled width of the image.
|
float |
getImageWidth()
Gets width of the image.
|
Float |
getMarginBottom()
Gets the current bottom margin width of the element.
|
Float |
getMarginLeft()
Gets the current left margin width of the element.
|
Float |
getMarginRight()
Gets the current right margin width of the element.
|
Float |
getMarginTop()
Gets the current top margin width of the element.
|
PdfName |
getRole()
Gets the element's role.
|
PdfXObject |
getXObject()
Gets the XObject contained in this image object
|
protected IRenderer |
makeNewRenderer() |
Image |
scale(float horizontalScaling, float verticalScaling)
Scale the image relative to its default size.
|
Image |
scaleAbsolute(float fitWidth, float fitHeight)
Scale the image to an absolute size.
|
Image |
scaleToFit(float fitWidth, float fitHeight)
Scale the image to an absolute size.
|
Image |
setAutoScale(boolean autoScale)
Sets the autoscale property for both width and height.
|
Image |
setAutoScaleHeight(boolean autoScale)
Sets the autoscale property for the height of the image.
|
Image |
setAutoScaleWidth(boolean autoScale)
Sets the autoscale property for the width of the image.
|
Image |
setFixedPosition(float x, float y)
Sets values for a absolute repositioning of the Element.
|
Image |
setFixedPosition(int pageNumber, float x, float y)
Sets values for a absolute repositioning of the Element, on a specific page.
|
Image |
setMarginBottom(float value)
Sets the bottom margin width of the element.
|
Image |
setMarginLeft(float value)
Sets the left margin width of the element.
|
Image |
setMarginRight(float value)
Sets the right margin width of the element.
|
Image |
setMargins(float marginTop, float marginRight, float marginBottom, float marginLeft)
Sets the margins around the element to a series of new widths.
|
Image |
setMarginTop(float value)
Sets the top margin width of the element.
|
Image |
setMaxHeight(float maxHeight) |
Image |
setMaxWidth(float maxWidth) |
Image |
setMinHeight(float minHeight) |
Image |
setMinWidth(float minWidth) |
void |
setRole(PdfName role)
Sets the element's role.
|
Image |
setRotationAngle(double radAngle)
Sets the rotation radAngle.
|
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, propagateArtifactRoleToChildElements, setAction, setNextRenderer, setPageNumber
deleteOwnProperty, getDefaultProperty, getHeight, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, getWidth, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBaseDirection, setBold, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFont, setFontColor, setFontColor, setFontKerning, setFontScript, setFontSize, setHeight, setHeight, setHeightPercent, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWidth, setWidth, setWidthPercent, setWordSpacing
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createRendererSubTree, getRenderer, setNextRenderer
deleteOwnProperty, getDefaultProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setProperty
protected PdfXObject xObject
protected PdfName role
protected AccessibilityProperties tagProperties
public Image(PdfImageXObject xObject)
Image
from an image XObject, the representation of an image in PDF syntax.
xObject
- an internal PdfImageXObject
public Image(PdfFormXObject xObject)
Image
from a form XObject, the representation of a form in PDF syntax.
xObject
- an internal PdfFormXObject
public Image(PdfImageXObject xObject, float width)
Image
from an image XObject, the representation of an image in PDF syntax, with a custom width.
xObject
- an internal PdfImageXObject
width
- a float value
public Image(PdfImageXObject xObject, float x, float y, float width)
Image
from an image XObject, the representation of an image in PDF syntax, with a custom width and on a fixed position.
xObject
- an internal PdfImageXObject
x
- a float value representing the horizontal offset of the lower left corner of the image
y
- a float value representing the vertical offset of the lower left corner of the image
width
- a float value
public Image(PdfImageXObject xObject, float x, float y)
Image
from an image XObject, the representation of an image in PDF syntax, on a fixed position.
xObject
- an internal PdfImageXObject
x
- a float value representing the horizontal offset of the lower left corner of the image
y
- a float value representing the vertical offset of the lower left corner of the image
public Image(PdfFormXObject xObject, float x, float y)
Image
from a form XObject, the representation of a form in PDF syntax.
xObject
- an internal PdfFormXObject
x
- a float value representing the horizontal offset of the lower left corner of the form
y
- a float value representing the vertical offset of the lower left corner of the form
public Image(ImageData img)
Image
from an image resource, read in from a file with the iText I/O module.
img
- an internal representation of the image resource
public Image(ImageData img, float x, float y)
Image
from an image resource, read in from a file with the iText I/O module, on a fixed position.
img
- an internal representation of the image resource
x
- a float value representing the horizontal offset of the lower left corner of the image
y
- a float value representing the vertical offset of the lower left corner of the image
public Image(ImageData img, float x, float y, float width)
Image
from an image resource, read in from a file with the iText I/O module, with a custom width and on a fixed position.
img
- an internal representation of the image resource
x
- a float value representing the horizontal offset of the lower left corner of the image
y
- a float value representing the vertical offset of the lower left corner of the image
width
- a float value
public PdfXObject getXObject()
PdfXObject
public Image setRotationAngle(double radAngle)
radAngle
- a value in radians
public Float getMarginLeft()
float
public Image setMarginLeft(float value)
value
- the new left margin width
public Float getMarginRight()
float
public Image setMarginRight(float value)
value
- the new right margin width
public Float getMarginTop()
float
public Image setMarginTop(float value)
value
- the new top margin width
public Float getMarginBottom()
float
public Image setMarginBottom(float value)
value
- the new bottom margin width
public Image setMargins(float marginTop, float marginRight, float marginBottom, float marginLeft)
marginTop
- the new margin top width
marginRight
- the new margin right width
marginBottom
- the new margin bottom width
marginLeft
- the new margin left width
public Image scale(float horizontalScaling, float verticalScaling)
horizontalScaling
- the horizontal scaling coefficient. default value 1 = 100%
verticalScaling
- the vertical scaling coefficient. default value 1 = 100%
public Image scaleToFit(float fitWidth, float fitHeight)
fitWidth
- the new maximum width of the image
fitHeight
- the new maximum height of the image
public Image scaleAbsolute(float fitWidth, float fitHeight)
fitWidth
- the new absolute width of the image
fitHeight
- the new absolute height of the image
public Image setAutoScale(boolean autoScale)
autoScale
- whether or not to let the image resize automatically
public Image setAutoScaleHeight(boolean autoScale)
autoScale
- whether or not to let the image height resize automatically
public Image setAutoScaleWidth(boolean autoScale)
autoScale
- whether or not to let the image width resize automatically
public Image setFixedPosition(float x, float y)
Property.POSITION
is changed to fixed
.
x
- horizontal position on the page
y
- vertical position on the page
public Image setFixedPosition(int pageNumber, float x, float y)
Property.POSITION
is changed to fixed
.
pageNumber
- the page where the element must be positioned
x
- horizontal position on the page
y
- vertical position on the page
public float getImageWidth()
public float getImageHeight()
public Image setMaxHeight(float maxHeight)
public Image setMinHeight(float minHeight)
public Image setMaxWidth(float maxWidth)
public Image setMinWidth(float minWidth)
public float getImageScaledWidth()
public float getImageScaledHeight()
public PdfName getRole()
IAccessibleElement
getRole
in interface IAccessibleElement
PdfName
containing the name of the role
public void setRole(PdfName role)
IAccessibleElement
setRole
in interface IAccessibleElement
role
- the new role which the IAccessibleElement
should take
public AccessibilityProperties getAccessibilityProperties()
IAccessibleElement
accessibility properties
.
getAccessibilityProperties
in interface IAccessibleElement
protected IRenderer makeNewRenderer()
makeNewRenderer
in class AbstractElement<Image>
Copyright © 1998–2018 iText Group NV. All rights reserved.