Package com.evopdf

Class PageGraphicElement

java.lang.Object
com.evopdf.PageElement
com.evopdf.PageGraphicElement
Direct Known Subclasses:
BezierCurveElement, EllipseArcElement, EllipseElement, EllipseSliceElement, HtmlToImageElement, HtmlToPdfElement, ImageElement, LineElement, PathElement, PolygonElement, RectangleElement, TextElement

public class PageGraphicElement extends PageElement
This abstract class is the base class for all graphic elements that can be added to a PDF document
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets element background color
    Gets blending mode for transparent rendering mode of the element
    Gets the clip rectangle applied when the element is rendered in PDF
    Gets element foreground color
    Gets the gradient used to fill a shape
    Gets the line style for elements rendering lines
    int
    Gets the element opacity.
    void
    rotate(float rotateAngle)
    Rotates the coordinate system axes clockwise by the specified angle before rendering the element.
    void
    scale(float sx, float sy)
    Scales the coordinates so that 1 unit in the horizontal and vertical dimensions of the new coordinate system is the same size as sx and sy units, respectively, in the previous coordinate system
    void
    Sets element background color
    void
    Sets blending mode for transparent rendering mode of the element
    void
    Sets the clip rectangle applied when the element is rendered in PDF
    void
    Sets element foreground color
    void
    setGradient(GradientColor gradientColor)
    Sets the gradient used to fill a shape
    void
    Sets the line style for elements rendering lines
    void
    setOpacity(int opacity)
    Sets the element opacity.
    void
    skew(float skewXAngle, float skewYAngle)
    Skews the x axis by an skewXAngle and the y axis by an skewYAngle before rendering the element
    void
    translate(float tx, float ty)
    Translates the coordinate system before rendering the element.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • backColor

      public RgbColor backColor()
      Gets element background color
      Returns:
      element background color
    • setBackColor

      public void setBackColor(RgbColor backColor)
      Sets element background color
      Parameters:
      backColor - element background color to set
    • foreColor

      public RgbColor foreColor()
      Gets element foreground color
      Returns:
      element foreground color
    • setForeColor

      public void setForeColor(RgbColor foreColor)
      Sets element foreground color
      Parameters:
      foreColor - element foreground color to set
    • opacity

      public int opacity()
      Gets the element opacity. The opacity is expressed as a value between 0 and 100. 0 means completely transparent and 100 completely opaque. The default value of this property is 100.
      Returns:
      the element opacity
    • setOpacity

      public void setOpacity(int opacity)
      Sets the element opacity. The opacity is expressed as a value between 0 and 100. 0 means completely transparent and 100 completely opaque.
      Parameters:
      opacity - the element opacity to set
    • blending

      public Blending blending()
      Gets blending mode for transparent rendering mode of the element
      Returns:
      the blending mode
    • setBlending

      public void setBlending(Blending blending)
      Sets blending mode for transparent rendering mode of the element
      Parameters:
      blending - the blending mode to set
    • lineStyle

      public LineStyle lineStyle()
      Gets the line style for elements rendering lines
      Returns:
      the line style
    • setLineStyle

      public void setLineStyle(LineStyle lineStyle)
      Sets the line style for elements rendering lines
      Parameters:
      lineStyle - the line style to set
    • gradient

      public GradientColor gradient()
      Gets the gradient used to fill a shape
      Returns:
      the gradient used to fill a shape
    • setGradient

      public void setGradient(GradientColor gradientColor)
      Sets the gradient used to fill a shape
      Parameters:
      gradientColor - the gradient used to fill a shape
    • translate

      public void translate(float tx, float ty)
      Translates the coordinate system before rendering the element. The coordinates of the element are relative to the translated coordinate system
      Parameters:
      tx - the distance to translate the origin of the coordinate system in the horizontal direction
      ty - distance to translate the origin of the coordinate system in the vertical direction
    • scale

      public void scale(float sx, float sy)
      Scales the coordinates so that 1 unit in the horizontal and vertical dimensions of the new coordinate system is the same size as sx and sy units, respectively, in the previous coordinate system
      Parameters:
      sx - the value by which to scale coordinate system in the x-axis direction
      sy - the value by which to scale coordinate system in the y-axis direction
    • rotate

      public void rotate(float rotateAngle)
      Rotates the coordinate system axes clockwise by the specified angle before rendering the element. The coordinates of the element are relative to the rotated coordinates system. For text rotation use the TextElement.textAngle() property of the TextElement
      Parameters:
      rotateAngle - the rotation angle in degrees
    • skew

      public void skew(float skewXAngle, float skewYAngle)
      Skews the x axis by an skewXAngle and the y axis by an skewYAngle before rendering the element
      Parameters:
      skewXAngle - skew x angle
      skewYAngle - skew y angle
    • clipRectangle

      public RectangleFloat clipRectangle()
      Gets the clip rectangle applied when the element is rendered in PDF
      Returns:
      the clip rectangle applied when the element is rendered in PDF
    • setClipRectangle

      public void setClipRectangle(RectangleFloat clipRectangle)
      Sets the clip rectangle applied when the element is rendered in PDF
      Parameters:
      clipRectangle - the clip rectangle to set