public static PdfAnnotation ToPDFPolygon(this Autodesk.DesignScript.Geometry.Polygon polygon, string content, PdfWriter writer)
        {
            List <float> points = new List <float>();

            foreach (var pt in polygon.Points)
            {
                PDFCoords coords = pt.ToPDFCoords();
                points.Add(coords.X);
                points.Add(coords.Y);
            }

            iTextSharp.text.Rectangle rect = new iTextSharp.text.Rectangle(0, 0);

            var app  = new PdfContentByte(writer);
            var anno = PdfAnnotation.CreatePolygonPolyline(writer, rect, content, true, new PdfArray(points.ToArray()));

            return(anno);
        }
예제 #2
0
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
        public static PdfAnnotation ToPDFPolygon(this Autodesk.DesignScript.Geometry.PolyCurve polycurve, string content, PdfWriter writer)
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
        {
            List <float> points = new List <float>();

            foreach (var curve in polycurve.Curves())
            {
                PDFCoords coords = curve.StartPoint.ToPDFCoords();
                points.Add(coords.X);
                points.Add(coords.Y);
            }

            iTextSharp.text.Rectangle rect = new iTextSharp.text.Rectangle(0, 0);

            var app  = new PdfContentByte(writer);
            var anno = PdfAnnotation.CreatePolygonPolyline(writer, rect, content, false, new PdfArray(points.ToArray()));

            return(anno);
        }