I need to draw only a single point in the content of a PDF page. I tried to draw a line from and to the same x,y point, but no point appears in the PDF. For example:
PageContent content = new PageContent();
content.GSSave();
content.SetStrokeColor(color);
content.SetStrokeJoin(1); // round
content.SetStrokeCap(1); // round
content.SetStrokeWidth(width);
Path path = new Path();
path.MoveTo(x1, y1);
path.LineTo(x1, y1);
content.StrokePath(path);
path.Destroy();
content.GSRestore();
pdfPage.AddContent(content, false);
content.Destroy();
However, when I tried just adding a small amount to the point passed into LineTo(), it did work:
PageContent content = new PageContent();
content.GSSave();
content.SetStrokeColor(color);
content.SetStrokeJoin(1); // round
content.SetStrokeCap(1); // round
content.SetStrokeWidth(width);
Path path = new Path();
path.MoveTo(x1, y1);
path.LineTo(x1+0.001f, y1+0.001f); // <- Added 0.001f to the point
content.StrokePath(path);
path.Destroy();
content.GSRestore();
pdfPage.AddContent(content, false);
content.Destroy();
Is this what I need to do? Or is there a more correct way to draw a single point to the content of a PDF page? Or is this a bug in the SDK?
Thanks,
Andrew