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(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 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(com.itextpdf.io.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() |
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() |
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) |
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, setBorderLeft, setBorderRight, setBorderTop, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFont, setFontColor, setFontColor, setFontKerning, setFontScript, setFontSize, setHeight, 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 valuepublic 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 imagey
- a float value representing the vertical offset of the lower left corner of the imagewidth
- a float valuepublic 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 imagey
- a float value representing the vertical offset of the lower left corner of the imagepublic 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 formy
- 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 resource
public Image(com.itextpdf.io.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 imagey
- a float value representing the vertical offset of the lower left corner of the imagepublic Image(com.itextpdf.io.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 imagey
- a float value representing the vertical offset of the lower left corner of the imagewidth
- a float valuepublic PdfXObject getXObject()
PdfXObject
public Image setRotationAngle(double radAngle)
radAngle
- a value in radianspublic Float getMarginLeft()
float
public Image setMarginLeft(float value)
value
- the new left margin widthpublic Float getMarginRight()
float
public Image setMarginRight(float value)
value
- the new right margin widthpublic Float getMarginTop()
float
public Image setMarginTop(float value)
value
- the new top margin widthpublic Float getMarginBottom()
float
public 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 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 x, float y)
Property.POSITION
is changed to
fixed
.x
- horizontal position on the pagey
- vertical position on the pagepublic Image setFixedPosition(int pageNumber, float x, float y)
Property.POSITION
is changed to fixed
.pageNumber
- the page where the element must be positionedx
- horizontal position on the pagey
- vertical position on the pagepublic 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()
getRole
in interface IAccessibleElement
public void setRole(PdfName role)
setRole
in interface IAccessibleElement
public AccessibilityProperties getAccessibilityProperties()
getAccessibilityProperties
in interface IAccessibleElement
protected IRenderer makeNewRenderer()
makeNewRenderer
in class AbstractElement<Image>
Copyright © 1998–2017 iText Group NV. All rights reserved.