Package com.itextpdf.layout.properties
Class BackgroundImage
- java.lang.Object
-
- com.itextpdf.layout.properties.BackgroundImage
-
public class BackgroundImage extends java.lang.Object
Class to hold background-image property.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BackgroundImage.Builder
BackgroundImage
builder class.
-
Field Summary
Fields Modifier and Type Field Description private BackgroundBox
backgroundClip
private BackgroundBox
backgroundOrigin
private BackgroundSize
backgroundSize
private BlendMode
blendMode
private static BlendMode
DEFAULT_BLEND_MODE
protected PdfXObject
image
protected AbstractLinearGradientBuilder
linearGradientBuilder
private BackgroundPosition
position
private BackgroundRepeat
repeat
-
Constructor Summary
Constructors Modifier Constructor Description private
BackgroundImage(PdfXObject image, BackgroundRepeat repeat, BackgroundPosition position, BackgroundSize backgroundSize, AbstractLinearGradientBuilder linearGradientBuilder, BlendMode blendMode, BackgroundBox clip, BackgroundBox origin)
Creates a newBackgroundImage
instance.BackgroundImage(BackgroundImage backgroundImage)
Creates a copy of passedBackgroundImage
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BackgroundBox
getBackgroundClip()
Gets background-clip.BackgroundBox
getBackgroundOrigin()
Gets background-origin.BackgroundPosition
getBackgroundPosition()
Gets background-position.BackgroundSize
getBackgroundSize()
Gets the background size property.BlendMode
getBlendMode()
Get the image's blend mode.PdfFormXObject
getForm()
Gets initial image if it is instanceofPdfFormXObject
, otherwise returns null.PdfImageXObject
getImage()
Gets initial image if it is instanceofPdfImageXObject
, otherwise returns null.float
getImageHeight()
Gets initial image height.float
getImageWidth()
Gets initial image width.AbstractLinearGradientBuilder
getLinearGradientBuilder()
Gets linearGradientBuilder.BackgroundRepeat
getRepeat()
Gets imageBackgroundRepeat
instance.boolean
isBackgroundSpecified()
Returns is background specified.
-
-
-
Field Detail
-
DEFAULT_BLEND_MODE
private static final BlendMode DEFAULT_BLEND_MODE
-
image
protected PdfXObject image
-
linearGradientBuilder
protected AbstractLinearGradientBuilder linearGradientBuilder
-
blendMode
private BlendMode blendMode
-
repeat
private final BackgroundRepeat repeat
-
position
private final BackgroundPosition position
-
backgroundSize
private final BackgroundSize backgroundSize
-
backgroundClip
private final BackgroundBox backgroundClip
-
backgroundOrigin
private final BackgroundBox backgroundOrigin
-
-
Constructor Detail
-
BackgroundImage
public BackgroundImage(BackgroundImage backgroundImage)
Creates a copy of passedBackgroundImage
instance.- Parameters:
backgroundImage
-BackgroundImage
for cloning
-
BackgroundImage
private BackgroundImage(PdfXObject image, BackgroundRepeat repeat, BackgroundPosition position, BackgroundSize backgroundSize, AbstractLinearGradientBuilder linearGradientBuilder, BlendMode blendMode, BackgroundBox clip, BackgroundBox origin)
Creates a newBackgroundImage
instance.- Parameters:
image
- background-image property.PdfXObject
instance.repeat
- background-repeat property.BackgroundRepeat
instance.position
- background-position property.BackgroundPosition
instance.backgroundSize
- background-size property.BackgroundSize
instance.linearGradientBuilder
- background-image property.AbstractLinearGradientBuilder
instance.blendMode
- the image's blend mode.BlendMode
instance.clip
- background-clip property.BackgroundBox
instance.origin
- background-origin property.BackgroundBox
instance.
-
-
Method Detail
-
getImage
public PdfImageXObject getImage()
Gets initial image if it is instanceofPdfImageXObject
, otherwise returns null.- Returns:
PdfImageXObject
-
getForm
public PdfFormXObject getForm()
Gets initial image if it is instanceofPdfFormXObject
, otherwise returns null.- Returns:
PdfFormXObject
-
getBackgroundPosition
public BackgroundPosition getBackgroundPosition()
Gets background-position.- Returns:
BackgroundPosition
-
getLinearGradientBuilder
public AbstractLinearGradientBuilder getLinearGradientBuilder()
Gets linearGradientBuilder.- Returns:
AbstractLinearGradientBuilder
-
isBackgroundSpecified
public boolean isBackgroundSpecified()
Returns is background specified.- Returns:
true
if background is specified, otherwise false
-
getBackgroundSize
public BackgroundSize getBackgroundSize()
Gets the background size property.- Returns:
BackgroundSize
instance
-
getImageWidth
public float getImageWidth()
Gets initial image width.- Returns:
- the initial image width
-
getImageHeight
public float getImageHeight()
Gets initial image height.- Returns:
- the initial image height
-
getRepeat
public BackgroundRepeat getRepeat()
Gets imageBackgroundRepeat
instance.- Returns:
- the image background repeat
-
getBlendMode
public BlendMode getBlendMode()
Get the image's blend mode.- Returns:
- the
BlendMode
representation of the image's blend mode
-
getBackgroundClip
public BackgroundBox getBackgroundClip()
Gets background-clip.- Returns:
BackgroundBox
-
getBackgroundOrigin
public BackgroundBox getBackgroundOrigin()
Gets background-origin.- Returns:
BackgroundBox
-
-