public class Image extends AbstractElement<Image> implements ILeafElement, IAccessibleElement
| Modifier and Type | Field and Description |
|---|---|
protected DefaultAccessibilityProperties |
tagProperties |
protected PdfXObject |
xObject |
childElements, nextRenderer, stylesproperties| Constructor and Description |
|---|
Image(com.itextpdf.io.image.ImageData img)
Creates an
Image from an image resource, read in from a file
with the iText I/O module. |
Image(com.itextpdf.io.image.ImageData img,
float left,
float bottom)
Creates an
Image from an image resource, read in from a file
with the iText I/O module, on a fixed position. |
Image(com.itextpdf.io.image.ImageData img,
float left,
float bottom,
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 left,
float bottom)
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 left,
float bottom)
Creates an
Image from an image XObject, the representation of an
image in PDF syntax, on a fixed position. |
Image(PdfImageXObject xObject,
float left,
float bottom,
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.
|
UnitValue |
getMarginBottom()
Gets the current bottom margin width of the image.
|
UnitValue |
getMarginLeft()
Gets the current left margin width of the element.
|
UnitValue |
getMarginRight()
Gets the current right margin width of the image.
|
UnitValue |
getMarginTop()
Gets the current top margin width of the image.
|
ObjectFit |
getObjectFit()
Retrieves the
ObjectFit mode for the image. |
UnitValue |
getPaddingBottom()
Gets the current bottom padding width of the image.
|
UnitValue |
getPaddingLeft()
Gets the current left padding width of the image.
|
UnitValue |
getPaddingRight()
Gets the current right padding width of the image.
|
UnitValue |
getPaddingTop()
Gets the current top padding width of the image.
|
UnitValue |
getWidth()
Gets the width property of the image.
|
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 left,
float bottom)
Sets values for a absolute repositioning of the Element.
|
Image |
setFixedPosition(int pageNumber,
float left,
float bottom)
Sets values for a absolute repositioning of the Element, on a specific
page.
|
Image |
setHeight(float height)
Sets the height property of the image, measured in points.
|
Image |
setHeight(UnitValue height)
Sets the height property of the image with a
UnitValue. |
Image |
setMarginBottom(float value)
Sets the bottom margin width of the image.
|
Image |
setMarginLeft(float value)
Sets the left margin width of the element.
|
Image |
setMarginRight(float value)
Sets the right margin width of the image.
|
Image |
setMargins(float marginTop,
float marginRight,
float marginBottom,
float marginLeft)
Sets the margins around the image to a series of new widths.
|
Image |
setMarginTop(float value)
Sets the top margin width of the image.
|
Image |
setMaxHeight(float maxHeight)
Sets the max-height property of the image, measured in points.
|
Image |
setMaxHeight(UnitValue maxHeight)
Sets the max-height property of the image with a
UnitValue. |
Image |
setMaxWidth(float maxWidth)
Sets the max-width property of the image, measured in points.
|
Image |
setMaxWidth(UnitValue maxWidth)
Sets the max-width property of the image with a
UnitValue. |
Image |
setMinHeight(float minHeight)
Sets the min-height property of the image, measured in points.
|
Image |
setMinHeight(UnitValue minHeight)
Sets the min-height property of the image with a
UnitValue. |
Image |
setMinWidth(float minWidth)
Sets the min-width property of the image, measured in points.
|
Image |
setMinWidth(UnitValue minWidth)
Sets the min-width property of the image with a
UnitValue. |
Image |
setObjectFit(ObjectFit objectFit)
Sets an object-fit mode for the image.
|
Image |
setPadding(float commonPadding)
Sets all paddings around the image to the same width.
|
Image |
setPaddingBottom(float value)
Sets the bottom padding width of the image.
|
Image |
setPaddingLeft(float value)
Sets the left padding width of the image.
|
Image |
setPaddingRight(float value)
Sets the right padding width of the image.
|
Image |
setPaddings(float paddingTop,
float paddingRight,
float paddingBottom,
float paddingLeft)
Sets the paddings around the image to a series of new widths.
|
Image |
setPaddingTop(float value)
Sets the top padding width of the image.
|
Image |
setRotationAngle(double radAngle)
Sets the rotation radAngle.
|
Image |
setWidth(float width)
Sets the width property of the image, measured in points.
|
Image |
setWidth(UnitValue width)
Sets the width property of the image with a
UnitValue. |
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, setAction, setNextRenderer, setPageNumberdeleteOwnProperty, getDefaultProperty, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBaseDirection, setBold, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFont, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateRendererSubTree, getRenderer, setNextRendererdeleteOwnProperty, getDefaultProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setPropertyprotected PdfXObject xObject
protected DefaultAccessibilityProperties tagProperties
public Image(PdfImageXObject xObject)
Image from an image XObject, the representation of an
image in PDF syntax.xObject - an internal PdfImageXObjectpublic Image(PdfFormXObject xObject)
Image from a form XObject, the representation of a
form in PDF syntax.xObject - an internal PdfFormXObjectpublic 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 PdfImageXObjectwidth - a float valuepublic Image(PdfImageXObject xObject, float left, float bottom, 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 PdfImageXObjectleft - a float value representing the horizontal offset of the lower left corner of the imagebottom - a float value representing the vertical offset of the lower left corner of the imagewidth - a float valuepublic Image(PdfImageXObject xObject, float left, float bottom)
Image from an image XObject, the representation of an
image in PDF syntax, on a fixed position.xObject - an internal PdfImageXObjectleft - a float value representing the horizontal offset of the lower left corner of the imagebottom - a float value representing the vertical offset of the lower left corner of the imagepublic Image(PdfFormXObject xObject, float left, float bottom)
Image from a form XObject, the representation of a
form in PDF syntax.xObject - an internal PdfFormXObjectleft - a float value representing the horizontal offset of the lower left corner of the formbottom - a float value representing the vertical offset of the lower left corner of the formpublic Image(com.itextpdf.io.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 resourcepublic Image(com.itextpdf.io.image.ImageData img,
float left,
float bottom)
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 resourceleft - a float value representing the horizontal offset of the lower left corner of the imagebottom - a float value representing the vertical offset of the lower left corner of the imagepublic Image(com.itextpdf.io.image.ImageData img,
float left,
float bottom,
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 resourceleft - a float value representing the horizontal offset of the lower left corner of the imagebottom - a float value representing the vertical offset of the lower left corner of the imagewidth - a float valuepublic PdfXObject getXObject()
PdfXObjectpublic Image setRotationAngle(double radAngle)
radAngle - a value in radianspublic UnitValue getMarginLeft()
UnitValue objectpublic Image setMarginLeft(float value)
value - the new left margin widthpublic UnitValue getMarginRight()
UnitValue objectpublic Image setMarginRight(float value)
value - the new right margin widthpublic UnitValue getMarginTop()
UnitValue objectpublic Image setMarginTop(float value)
value - the new top margin widthpublic UnitValue getMarginBottom()
UnitValue objectpublic Image setMarginBottom(float value)
value - the new bottom margin widthpublic Image setMargins(float marginTop, float marginRight, float marginBottom, float marginLeft)
marginTop - the new margin top widthmarginRight - the new margin right widthmarginBottom - the new margin bottom widthmarginLeft - the new margin left widthpublic UnitValue getPaddingLeft()
UnitValue objectpublic Image setPaddingLeft(float value)
value - the new left padding widthpublic UnitValue getPaddingRight()
UnitValue objectpublic Image setPaddingRight(float value)
value - the new right padding widthpublic UnitValue getPaddingTop()
UnitValue objectpublic Image setPaddingTop(float value)
value - the new top padding widthpublic UnitValue getPaddingBottom()
UnitValue objectpublic Image setPaddingBottom(float value)
value - the new bottom padding widthpublic Image setPadding(float commonPadding)
commonPadding - the new padding widthpublic Image setPaddings(float paddingTop, float paddingRight, float paddingBottom, float paddingLeft)
paddingTop - the new padding top widthpaddingRight - the new padding right widthpaddingBottom - the new padding bottom widthpaddingLeft - the new padding left widthpublic 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 imagefitHeight - the new maximum height of the imagepublic Image scaleAbsolute(float fitWidth, float fitHeight)
fitWidth - the new absolute width of the imagefitHeight - the new absolute height of the imagepublic Image setAutoScale(boolean autoScale)
autoScale - whether or not to let the image resize automaticallypublic Image setAutoScaleHeight(boolean autoScale)
autoScale - whether or not to let the image height resize automaticallypublic Image setAutoScaleWidth(boolean autoScale)
autoScale - whether or not to let the image width resize automaticallypublic Image setFixedPosition(float left, float bottom)
Property.POSITION is changed to
fixed.left - horizontal position on the pagebottom - vertical position on the pagepublic Image setFixedPosition(int pageNumber, float left, float bottom)
Property.POSITION is changed to fixed.pageNumber - the page where the element must be positionedleft - horizontal position on the pagebottom - vertical position on the pagepublic float getImageWidth()
public float getImageHeight()
public Image setHeight(float height)
height - a value measured in points.public Image setHeight(UnitValue height)
UnitValue.height - a value measured in points.public Image setMaxHeight(float maxHeight)
maxHeight - a value measured in points.public Image setMaxHeight(UnitValue maxHeight)
UnitValue.maxHeight - a value measured in points.public Image setMinHeight(float minHeight)
minHeight - a value measured in points.public Image setMinHeight(UnitValue minHeight)
UnitValue.minHeight - a value measured in points.public Image setMaxWidth(float maxWidth)
maxWidth - a value measured in points.public Image setMaxWidth(UnitValue maxWidth)
UnitValue.maxWidth - a value measured in points.public Image setMinWidth(float minWidth)
minWidth - a value measured in points.public Image setMinWidth(UnitValue minWidth)
UnitValue.minWidth - a value measured in points.public Image setWidth(float width)
width - a value measured in points.public Image setWidth(UnitValue width)
UnitValue.width - a UnitValue objectpublic UnitValue getWidth()
UnitValuepublic float getImageScaledWidth()
public float getImageScaledHeight()
public Image setObjectFit(ObjectFit objectFit)
objectFit - is the ObjectFit modepublic ObjectFit getObjectFit()
ObjectFit mode for the image.ObjectFit.FILL otherwisepublic AccessibilityProperties getAccessibilityProperties()
IAccessibleElementaccessibility properties. See also IAccessibleElement.getAccessibilityProperties in interface IAccessibleElementprotected IRenderer makeNewRenderer()
makeNewRenderer in class AbstractElement<Image>Copyright © 1998–2020 iText Group NV. All rights reserved.