using GroupDocs.Annotation; using GroupDocs.Annotation.Models; using GroupDocs.Annotation.Models.FormatSpecificComponents.Pdf; using System; using System.Collections.Generic; namespace AddingCheckBoxToPDFUsingCSharp { internal class Program { static void Main(string[] args) { // Set License to avoid the limitations of the Annotation library License license = new License(); license.SetLicense(@"Conholdate.Annotator.lic"); // Create the Annotator object with the input PDF path using (Annotator annotator = new Annotator("input.pdf")) { CheckBoxComponent checkBox = new CheckBoxComponent { Checked = true, Box = new Rectangle(100, 100, 100, 100), PenColor = 65535, Style = BoxStyle.Star, Replies = new List<Reply> { new Reply { Comment = "First comment", RepliedOn = DateTime.Now }, new Reply { Comment = "Second comment", RepliedOn = DateTime.Now } } }; // Add the checkbox to the Annotator annotator.Add(checkBox); // Save the resultant PDF annotator.Save("result.pdf"); } } } }