Thanks, it helps me. I had rectified the issue and here's the appearance stream that I need to include to my existing code:
// Create Appearance Stream
PdfFormXObject appearance = new PdfFormXObject(rect);
PdfCanvas canvas = new PdfCanvas(appearance, page.GetDocument());
canvas.SetLineWidth(strokewidth);
canvas.SetStrokeColor(colour);
canvas.MoveTo(points[0], points[1]);
for (int i = 2; i < points.Length; i += 2)
{
canvas.LineTo(points[i], points[i + 1]);
}
canvas.Stroke();
canvas.Release();
// Set the annotation appearance
polyline.SetAppearance(PdfName.N, appearance.GetPdfObject());