PdfPolygonAnnotation constructor

PdfPolygonAnnotation(
  1. List<int> points,
  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. List<PdfAnnotationFlags>? flags,
  11. bool? setAppearance,
})

Initializes new instance of the PdfPolygonAnnotation class.

PdfDocument document = PdfDocument();
PdfPage page = document.pages.add();
List<int> polypoints = <int>[
  50,
  298,
  100,
  325,
  200,
  355,
  300,
  230,
  180,
  230
];
PdfPolygonAnnotation polygonAnnotation =
    PdfPolygonAnnotation(polypoints, 'PolygonAnnotation');
polygonAnnotation.color = PdfColor(255, 0, 0);
polygonAnnotation.innerColor = PdfColor(255, 0, 255);
page.annotations.add(polygonAnnotation);
List<int> bytes = await document.save();
document.dispose();

Implementation

PdfPolygonAnnotation(
  List<int> points,
  String text, {
  PdfColor? color,
  PdfColor? innerColor,
  PdfAnnotationBorder? border,
  String? author,
  String? subject,
  DateTime? modifiedDate,
  double? opacity,
  List<PdfAnnotationFlags>? flags,
  bool? setAppearance,
}) {
  _helper = PdfPolygonAnnotationHelper(
    this,
    points,
    text,
    color: color,
    innerColor: innerColor,
    border: border,
    author: author,
    subject: subject,
    modifiedDate: modifiedDate,
    opacity: opacity,
    flags: flags,
    setAppearance: setAppearance,
  );
}