public static PdfAnnotation CreatePolygonPolyline(
PdfWriter writer, Rectangle rect, String contents, bool polygon, PdfArray vertices)
{
PdfAnnotation annot = new PdfAnnotation(writer, rect);
if (polygon)
annot.Put(PdfName.SUBTYPE, PdfName.POLYGON);
else
annot.Put(PdfName.SUBTYPE, PdfName.POLYLINE);
annot.Put(PdfName.CONTENTS, new PdfString(contents, PdfObject.TEXT_UNICODE));
annot.Put(PdfName.VERTICES, new PdfArray(vertices));
return annot;
}