Class BackgroundImage

java.lang.Object
com.itextpdf.layout.properties.BackgroundImage

public class BackgroundImage extends Object
Class to hold background-image property.
  • Field Details

  • Constructor Details

  • Method Details

    • getImage

      public PdfImageXObject getImage()
      Gets initial image if it is instanceof PdfImageXObject, otherwise returns null.
      Returns:
      PdfImageXObject
    • getForm

      public PdfFormXObject getForm()
      Gets initial image if it is instanceof PdfFormXObject, otherwise returns null.
      Returns:
      PdfFormXObject
    • calculateBackgroundImageSize

      public float[] calculateBackgroundImageSize (float areaWidth, float areaHeight)
      Calculates width and height values for background image with a given area params.
      Parameters:
      areaWidth - width of the area of this images
      areaHeight - height of the area of this images
      Returns:
      array of two float values. NOTE that first value defines width, second defines height
    • 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 image BackgroundRepeat 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
    • resolveWidthAndHeight

      protected float[] resolveWidthAndHeight (Float width, Float height, float areaWidth, float areaHeight)
      Resolves the final size of the background image in specified area.
      Parameters:
      width - the intrinsic background image width
      height - the intrinsic background image height
      areaWidth - the area width in which background will be placed
      areaHeight - the area height in which background will be placed
      Returns:
      the final size of the background image