PDF .NET Library Logo

Creating PDF Annotations

The following code snippet creates a PDF, adds a small text and places a comment annotation in a given location.

C# sample:

PDFDocument MyPDF = new PDFDocument("Annotations.pdf");

MyPDF.CurrentPage.Body.AddText("Sample comment");

MyPDF.CurrentPage.Body.AddTextAnnotation("Comment", "Comment Annotation", TextAnnotationIcon.Comment, new RectangleF(120,0, 100, 100));

MyPDF.Save();

Back to PDF Code Library