PdfLineAnnotation constructor

PdfLineAnnotation(
  1. List<int> linePoints,
  2. String text, {
  3. PdfColor? color,
  4. PdfColor? innerColor,
  5. PdfAnnotationBorder? border,
  6. String? author,
  7. String? subject,
  8. DateTime? modifiedDate,
  9. double? opacity,
  10. bool? setAppearance,
  11. PdfLineEndingStyle beginLineStyle = PdfLineEndingStyle.none,
  12. PdfLineEndingStyle endLineStyle = PdfLineEndingStyle.none,
  13. PdfLineCaptionType captionType = PdfLineCaptionType.inline,
  14. PdfLineIntent lineIntent = PdfLineIntent.lineArrow,
  15. int? leaderLine,
  16. int? leaderLineExt,
  17. bool lineCaption = false,
  18. List<PdfAnnotationFlags>? flags,
})

Initializes new instance of PdfLineAnnotation class.

PdfDocument document = PdfDocument();
PdfPage page = document.pages.add();
List<int> points = <int>[80, 420, 250, 420];
PdfLineAnnotation lineAnnotation = PdfLineAnnotation(
    points, 'Line Annotation',
    opacity: 0.95,
    border: PdfAnnotationBorder(1),
    lineIntent: PdfLineIntent.lineDimension,
    beginLineStyle: PdfLineEndingStyle.butt,
    endLineStyle: PdfLineEndingStyle.none,
    innerColor: PdfColor(0, 255, 0),
    color: PdfColor(0, 255, 255),
    leaderLineExt: 10,
    leaderLine: 2,
    lineCaption: true,
    captionType: PdfLineCaptionType.top);
page.annotations.add(lineAnnotation);
List<int> bytes = await document.save();
document.dispose();

Implementation

PdfLineAnnotation(List<int> linePoints, String text,
    {PdfColor? color,
    PdfColor? innerColor,
    PdfAnnotationBorder? border,
    String? author,
    String? subject,
    DateTime? modifiedDate,
    double? opacity,
    bool? setAppearance,
    PdfLineEndingStyle beginLineStyle = PdfLineEndingStyle.none,
    PdfLineEndingStyle endLineStyle = PdfLineEndingStyle.none,
    PdfLineCaptionType captionType = PdfLineCaptionType.inline,
    PdfLineIntent lineIntent = PdfLineIntent.lineArrow,
    int? leaderLine,
    int? leaderLineExt,
    bool lineCaption = false,
    List<PdfAnnotationFlags>? flags}) {
  _helper = PdfLineAnnotationHelper(this, linePoints, text,
      color: color,
      innerColor: innerColor,
      border: border,
      author: author,
      subject: subject,
      modifiedDate: modifiedDate,
      opacity: opacity,
      flags: flags,
      setAppearance: setAppearance);
  this.beginLineStyle = beginLineStyle;
  this.endLineStyle = endLineStyle;
  this.captionType = captionType;
  this.lineIntent = lineIntent;
  this.lineCaption = lineCaption;
  if (leaderLine != null) {
    this.leaderLine = leaderLine;
  }
  if (leaderLineExt != null) {
    this.leaderLineExt = leaderLineExt;
  }
}