PdfAnnotationBorder constructor

PdfAnnotationBorder([
  1. double? borderWidth,
  2. double? horizontalRadius,
  3. double? verticalRadius,
  4. PdfBorderStyle? borderStyle,
  5. int? dashArray,
])

Initializes a new instance of the PdfAnnotationBorder class with specified border width, horizontal and vertical radius.

The borderStyle and dashArray only used for shape annotations.

Implementation

PdfAnnotationBorder([
  double? borderWidth,
  double? horizontalRadius,
  double? verticalRadius,
  PdfBorderStyle? borderStyle,
  int? dashArray,
]) {
  _helper.array.add(PdfNumber(0));
  _helper.array.add(PdfNumber(0));
  _helper.array.add(PdfNumber(1));
  this.horizontalRadius = horizontalRadius ??= 0;
  width = borderWidth ??= 1;
  this.verticalRadius = verticalRadius ??= 0;
  _borderStyle = borderStyle ??= PdfBorderStyle.solid;
  _helper.dictionary.setName(
    PdfName(PdfDictionaryProperties.s),
    _styleToString(_borderStyle),
  );
  if (dashArray != null) {
    this.dashArray = dashArray;
  }
}