PdfContentByte canvas = writer.DirectContent; canvas.Ellipse(100f, 100f, 200f, 150f);
PdfContentByte canvas = writer.DirectContent; canvas.SetLineWidth(2f); canvas.SetRGBColorStroke(255, 0, 0); // Red color stroke canvas.Ellipse(300f, 300f, 350f, 250f);
PdfContentByte canvas = writer.DirectContent; var gradient = new PdfShading.Axial(writer, 350f, 350f, 400f, 400f, new BaseColor(255, 0, 0), new BaseColor(0, 255, 0), true, true); canvas.ShadingFill(gradient); canvas.Ellipse(350f, 350f, 400f, 300f);This code creates an ellipse with a gradient fill from red to green, with the center at (375, 350). It's worth noting that PdfContentByte is part of the iTextSharp.text.pdf namespace, which is part of the iTextSharp package library.