iText 8.0.5 API
iText.Layout.Borders.Border Class Referenceabstract

Represents a border. More...

Inheritance diagram for iText.Layout.Borders.Border:
iText.Layout.Borders.Border3D iText.Layout.Borders.DashedBorder iText.Layout.Borders.DottedBorder iText.Layout.Borders.DoubleBorder iText.Layout.Borders.FixedDashedBorder iText.Layout.Borders.RoundDotsBorder iText.Layout.Borders.SolidBorder iText.Layout.Borders.GrooveBorder iText.Layout.Borders.InsetBorder iText.Layout.Borders.OutsetBorder iText.Layout.Borders.RidgeBorder

Public Types

enum   Side {
  NONE, TOP, RIGHT, BOTTOM,
  LEFT
}
  Enumerates the different sides of the rectangle. More...
 

Public Member Functions

abstract void  Draw (PdfCanvas canvas, float x1, float y1, float x2, float y2, Border.Side defaultSide, float borderWidthBefore, float borderWidthAfter)
  All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction. More...
 
virtual void  Draw (PdfCanvas canvas, Rectangle rectangle)
  Draw borders around the target rectangle. More...
 
virtual void  Draw (PdfCanvas canvas, float x1, float y1, float x2, float y2, float borderRadius, Border.Side defaultSide, float borderWidthBefore, float borderWidthAfter)
  All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction. More...
 
virtual void  Draw (PdfCanvas canvas, float x1, float y1, float x2, float y2, float horizontalRadius1, float verticalRadius1, float horizontalRadius2, float verticalRadius2, Border.Side defaultSide, float borderWidthBefore, float borderWidthAfter)
  All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction. More...
 
abstract void  DrawCellBorder (PdfCanvas canvas, float x1, float y1, float x2, float y2, Border.Side defaultSide)
  Draws the border of a cell. More...
 
abstract int  GetBorderType ()
  Returns the type of the border More...
 
virtual Color  GetColor ()
  Gets the color of the border More...
 
virtual float  GetOpacity ()
  Gets the opacity of the border More...
 
virtual float  GetWidth ()
  Gets the width of the border More...
 
virtual void  SetColor (Color color)
  Sets the color of the border More...
 
virtual void  SetWidth (float width)
  Sets the width of the border More...
 
override bool  Equals (Object anObject)
  Indicates whether the border is equal to the given border. More...
 
override int  GetHashCode ()
 

Static Public Attributes

static readonly iText.Layout.Borders.Border  NO_BORDER = null
  The null Border, i.e. the presence of such border is equivalent to the absence of the border More...
 
const int  SOLID = 0
  The solid border. More...
 
const int  DASHED = 1
  The dashed border. More...
 
const int  DOTTED = 2
  The dotted border. More...
 
const int  DOUBLE = 3
  The double border. More...
 
const int  ROUND_DOTS = 4
  The round-dots border. More...
 
const int  _3D_GROOVE = 5
  The 3D groove border. More...
 
const int  _3D_INSET = 6
  The 3D inset border. More...
 
const int  _3D_OUTSET = 7
  The 3D outset border. More...
 
const int  _3D_RIDGE = 8
  The 3D ridge border. More...
 
const int  DASHED_FIXED = 9
  The fixed dashed border. More...
 

Package Functions

  Border (float width)
  Creates a border with the given width. More...
 
  Border (Color color, float width)
  Creates a border with given width and color. More...
 
  Border (Color color, float width, float opacity)
  Creates a border with given width, color and opacity. More...
 
virtual Border.Side  GetBorderSide (float x1, float y1, float x2, float y2, Border.Side defaultSide)
  Returns the side corresponded to the line between two points. More...
 
virtual Point  GetIntersectionPoint (Point lineBeg, Point lineEnd, Point clipLineBeg, Point clipLineEnd)
  Gets a iText.Kernel.Geom.Point in which two lines intersect. More...
 
virtual float  GetDotsGap (double distance, float initialGap)
  Adjusts the size of the gap between dots More...
 
virtual void  DrawDiscontinuousBorders (PdfCanvas canvas, Rectangle boundingRectangle, float[] horizontalRadii, float[] verticalRadii, Border.Side defaultSide, float borderWidthBefore, float borderWidthAfter)
  Perform drawing operations to draw discontinuous borders. More...
 
virtual float[]  GetStartingPointsForBorderSide (float x1, float y1, float x2, float y2, Border.Side defaultSide)
  Calculate adjusted starting points for discontinuous borders, given two opposing points (A and B) that define the bounding rectangle More...
 

Package Attributes

TransparentColor  transparentColor
  The color of the border. More...
 
float  width
  The width of the border. More...
 
int  type
  The type of the border. More...
 

Detailed Description

Represents a border.

Member Enumeration Documentation

◆ Side

Enumerates the different sides of the rectangle.

Enumerates the different sides of the rectangle. The rectangle sides are expected to be parallel to corresponding page sides Otherwise the result is Side.NONE

Constructor & Destructor Documentation

◆ Border() [1/3]

iText.Layout.Borders.Border.Border ( float  width )
inlinepackage

Creates a border with the given width.

Creates a border with the given width. The color to be set by default is black

Parameters
width the width which the border should have

◆ Border() [2/3]

iText.Layout.Borders.Border.Border ( Color  color,
float  width 
)
inlinepackage

Creates a border with given width and color.

Parameters
color the color which the border should have
width the width which the border should have

◆ Border() [3/3]

iText.Layout.Borders.Border.Border ( Color  color,
float  width,
float  opacity 
)
inlinepackage

Creates a border with given width, color and opacity.

Parameters
color the color which the border should have
width the width which the border should have
opacity the opacity which border should have; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent

Member Function Documentation

◆ Draw() [1/4]

abstract void iText.Layout.Borders.Border.Draw ( PdfCanvas  canvas,
float  x1,
float  y1,
float  x2,
float  y2,
Border.Side  defaultSide,
float  borderWidthBefore,
float  borderWidthAfter 
)
pure virtual

All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction.

All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction. Borders are drawn in this order: top, right, bottom, left.

Given points specify the line which lies on the border of the content area, therefore the border itself should be drawn to the left from the drawing direction.

borderWidthBefore and borderWidthAfter parameters are used to define the widths of the borders that are before and after the current border, e.g. for the bottom border, borderWidthBefore specifies width of the right border and borderWidthAfter - width of the left border. Those width are used to handle areas of border joins.

Parameters
canvas PdfCanvas to be written to
x1 x coordinate of the beginning point of the element side, that should be bordered
y1 y coordinate of the beginning point of the element side, that should be bordered
x2 x coordinate of the ending point of the element side, that should be bordered
y2 y coordinate of the ending point of the element side, that should be bordered
defaultSide the Side , that we will fallback to, if it cannot be determined by border coordinates
borderWidthBefore defines width of the border that is before the current one
borderWidthAfter defines width of the border that is after the current one

Implemented in iText.Layout.Borders.Border3D, iText.Layout.Borders.FixedDashedBorder, iText.Layout.Borders.DoubleBorder, iText.Layout.Borders.DottedBorder, iText.Layout.Borders.RoundDotsBorder, iText.Layout.Borders.DashedBorder, and iText.Layout.Borders.SolidBorder.

◆ Draw() [2/4]

virtual void iText.Layout.Borders.Border.Draw ( PdfCanvas  canvas,
float  x1,
float  y1,
float  x2,
float  y2,
float  borderRadius,
Border.Side  defaultSide,
float  borderWidthBefore,
float  borderWidthAfter 
)
inlinevirtual

All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction.

All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction. Borders are drawn in this order: top, right, bottom, left.

Given points specify the line which lies on the border of the content area, therefore the border itself should be drawn to the left from the drawing direction.

borderWidthBefore and borderWidthAfter parameters are used to define the widths of the borders that are before and after the current border, e.g. for the bottom border, borderWidthBefore specifies width of the right border and borderWidthAfter - width of the left border. Those width are used to handle areas of border joins.

borderRadius is used to draw rounded borders.

Parameters
canvas PdfCanvas to be written to
x1 x coordinate of the beginning point of the element side, that should be bordered
y1 y coordinate of the beginning point of the element side, that should be bordered
x2 x coordinate of the ending point of the element side, that should be bordered
y2 y coordinate of the ending point of the element side, that should be bordered
borderRadius defines the radius of the element's corners
defaultSide the Side , that we will fallback to, if it cannot be determined by border coordinates
borderWidthBefore defines width of the border that is before the current one
borderWidthAfter defines width of the border that is after the current one

◆ Draw() [3/4]

virtual void iText.Layout.Borders.Border.Draw ( PdfCanvas  canvas,
float  x1,
float  y1,
float  x2,
float  y2,
float  horizontalRadius1,
float  verticalRadius1,
float  horizontalRadius2,
float  verticalRadius2,
Border.Side  defaultSide,
float  borderWidthBefore,
float  borderWidthAfter 
)
inlinevirtual

All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction.

All borders are supposed to be drawn in such way, that inner content of the element is on the right from the drawing direction. Borders are drawn in this order: top, right, bottom, left.

Given points specify the line which lies on the border of the content area, therefore the border itself should be drawn to the left from the drawing direction.

borderWidthBefore and borderWidthAfter parameters are used to define the widths of the borders that are before and after the current border, e.g. for the bottom border, borderWidthBefore specifies width of the right border and borderWidthAfter - width of the left border. Those width are used to handle areas of border joins.

horizontalRadius1, verticalRadius1, horizontalRadius2 and verticalRadius2 are used to draw rounded borders.

Parameters
canvas PdfCanvas to be written to
x1 x coordinate of the beginning point of the element side, that should be bordered
y1 y coordinate of the beginning point of the element side, that should be bordered
x2 x coordinate of the ending point of the element side, that should be bordered
y2 y coordinate of the ending point of the element side, that should be bordered
horizontalRadius1 defines the horizontal radius of the border's first corner
verticalRadius1 defines the vertical radius of the border's first corner
horizontalRadius2 defines the horizontal radius of the border's second corner
verticalRadius2 defines the vertical radius of the border's second corner
defaultSide the Side , that we will fallback to, if it cannot be determined by border coordinates
borderWidthBefore defines width of the border that is before the current one
borderWidthAfter defines width of the border that is after the current one

Reimplemented in iText.Layout.Borders.RoundDotsBorder, iText.Layout.Borders.SolidBorder, iText.Layout.Borders.FixedDashedBorder, iText.Layout.Borders.DottedBorder, and iText.Layout.Borders.DashedBorder.

◆ Draw() [4/4]

virtual void iText.Layout.Borders.Border.Draw ( PdfCanvas  canvas,
Rectangle  rectangle 
)
inlinevirtual

Draw borders around the target rectangle.

Parameters
canvas PdfCanvas to be written to
rectangle border positions rectangle

◆ DrawCellBorder()

abstract void iText.Layout.Borders.Border.DrawCellBorder ( PdfCanvas  canvas,
float  x1,
float  y1,
float  x2,
float  y2,
Border.Side  defaultSide 
)
pure virtual

Draws the border of a cell.

Parameters
canvas PdfCanvas to be written to
x1 x coordinate of the beginning point of the element side, that should be bordered
y1 y coordinate of the beginning point of the element side, that should be bordered
x2 x coordinate of the ending point of the element side, that should be bordered
y2 y coordinate of the ending point of the element side, that should be bordered
defaultSide the Side , that we will fallback to, if it cannot be determined by border coordinates

Implemented in iText.Layout.Borders.SolidBorder, iText.Layout.Borders.DoubleBorder, iText.Layout.Borders.Border3D, iText.Layout.Borders.FixedDashedBorder, iText.Layout.Borders.DottedBorder, iText.Layout.Borders.DashedBorder, and iText.Layout.Borders.RoundDotsBorder.

◆ DrawDiscontinuousBorders()

virtual void iText.Layout.Borders.Border.DrawDiscontinuousBorders ( PdfCanvas  canvas,
Rectangle  boundingRectangle,
float[]  horizontalRadii,
float[]  verticalRadii,
Border.Side  defaultSide,
float  borderWidthBefore,
float  borderWidthAfter 
)
inlinepackagevirtual

Perform drawing operations to draw discontinuous borders.

Perform drawing operations to draw discontinuous borders. Used by DashedBorder , DottedBorder and RoundDotsBorder.

Parameters
canvas canvas to draw on
boundingRectangle rectangle representing the bounding box of the drawing operations
horizontalRadii the horizontal radius of the border's two corners
verticalRadii the vertical radius of the border's two corners
defaultSide the Side , that we will fallback to, if it cannot be determined by border coordinates
borderWidthBefore defines width of the border that is before the current one
borderWidthAfter defines width of the border that is after the current one

◆ Equals()

override bool iText.Layout.Borders.Border.Equals ( Object  anObject )
inline

Indicates whether the border is equal to the given border.

Indicates whether the border is equal to the given border. The border type, width and color are considered during the comparison.

◆ GetBorderSide()

virtual Border.Side iText.Layout.Borders.Border.GetBorderSide ( float  x1,
float  y1,
float  x2,
float  y2,
Border.Side  defaultSide 
)
inlinepackagevirtual

Returns the side corresponded to the line between two points.

Returns the side corresponded to the line between two points. Notice that we consider the rectangle traversal to be clockwise. In case side couldn't be detected we will fallback to default side

Parameters
x1 the abscissa of the left-bottom point
y1 the ordinate of the left-bottom point
x2 the abscissa of the right-top point
y2 the ordinate of the right-top point
defaultSide the default side of border
Returns
the corresponded side

◆ GetBorderType()

◆ GetColor()

virtual Color iText.Layout.Borders.Border.GetColor ( )
inlinevirtual

Gets the color of the border

Returns
the color

◆ GetDotsGap()

virtual float iText.Layout.Borders.Border.GetDotsGap ( double  distance,
float  initialGap 
)
inlinepackagevirtual

Adjusts the size of the gap between dots

Parameters
distance the border length
initialGap the initial size of the gap
Returns
the adjusted size of the gap

◆ GetHashCode()

override int iText.Layout.Borders.Border.GetHashCode ( )
inline

◆ GetIntersectionPoint()

virtual Point iText.Layout.Borders.Border.GetIntersectionPoint ( Point  lineBeg,
Point  lineEnd,
Point  clipLineBeg,
Point  clipLineEnd 
)
inlinepackagevirtual

Gets a iText.Kernel.Geom.Point in which two lines intersect.

Parameters
lineBeg a iText.Kernel.Geom.Point which defines some point on the first line
lineEnd a iText.Kernel.Geom.Point which defines another point on the first line
clipLineBeg a iText.Kernel.Geom.Point which defines some point on the second line
clipLineEnd a iText.Kernel.Geom.Point which defines another point on the second line
Returns
the intersection iText.Kernel.Geom.Point

◆ GetOpacity()

virtual float iText.Layout.Borders.Border.GetOpacity ( )
inlinevirtual

Gets the opacity of the border

Returns
the border opacity; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent

◆ GetStartingPointsForBorderSide()

virtual float [] iText.Layout.Borders.Border.GetStartingPointsForBorderSide ( float  x1,
float  y1,
float  x2,
float  y2,
Border.Side  defaultSide 
)
inlinepackagevirtual

Calculate adjusted starting points for discontinuous borders, given two opposing points (A and B) that define the bounding rectangle

Parameters
x1 x-coordinate of point A
y1 y-ordinate of point A
x2 x-coordinate of point B
y2 y-ordinate of point B
defaultSide default side of the border used to determine the side given by points A and B
Returns
float[] containing the adjusted starting points in the form {x1,y1,x2,y2}

◆ GetWidth()

virtual float iText.Layout.Borders.Border.GetWidth ( )
inlinevirtual

Gets the width of the border

Returns
the width

◆ SetColor()

virtual void iText.Layout.Borders.Border.SetColor ( Color  color )
inlinevirtual

Sets the color of the border

Parameters
color The color

◆ SetWidth()

virtual void iText.Layout.Borders.Border.SetWidth ( float  width )
inlinevirtual

Sets the width of the border

Parameters
width The width

Member Data Documentation

◆ _3D_GROOVE

const int iText.Layout.Borders.Border._3D_GROOVE = 5
static

The 3D groove border.

See also
GrooveBorder

◆ _3D_INSET

const int iText.Layout.Borders.Border._3D_INSET = 6
static

The 3D inset border.

See also
InsetBorder

◆ _3D_OUTSET

const int iText.Layout.Borders.Border._3D_OUTSET = 7
static

The 3D outset border.

See also
OutsetBorder

◆ _3D_RIDGE

const int iText.Layout.Borders.Border._3D_RIDGE = 8
static

The 3D ridge border.

See also
RidgeBorder

◆ DASHED

const int iText.Layout.Borders.Border.DASHED = 1
static

The dashed border.

See also
DashedBorder

◆ DASHED_FIXED

const int iText.Layout.Borders.Border.DASHED_FIXED = 9
static

The fixed dashed border.

See also
FixedDashedBorder

◆ DOTTED

const int iText.Layout.Borders.Border.DOTTED = 2
static

The dotted border.

See also
DottedBorder

◆ DOUBLE

const int iText.Layout.Borders.Border.DOUBLE = 3
static

The double border.

See also
DoubleBorder

◆ NO_BORDER

readonly iText.Layout.Borders.Border iText.Layout.Borders.Border.NO_BORDER = null
static

The null Border, i.e. the presence of such border is equivalent to the absence of the border

◆ ROUND_DOTS

const int iText.Layout.Borders.Border.ROUND_DOTS = 4
static

The round-dots border.

See also
RoundDotsBorder

◆ SOLID

const int iText.Layout.Borders.Border.SOLID = 0
static

The solid border.

See also
SolidBorder

◆ transparentColor

TransparentColor iText.Layout.Borders.Border.transparentColor
package

The color of the border.

See also
iText.Layout.Properties.TransparentColor

◆ type

int iText.Layout.Borders.Border.type
package

The type of the border.

◆ width

float iText.Layout.Borders.Border.width
package

The width of the border.