Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
Created August 23, 2024 23:04
Show Gist options
  • Save conholdate-gists/6df525df02c1474d027bf3340e549b73 to your computer and use it in GitHub Desktop.
Save conholdate-gists/6df525df02c1474d027bf3340e549b73 to your computer and use it in GitHub Desktop.
Add Checkbox in PDF using C# | Insert check boxes in PDF
using (GroupDocs.Annotation.Annotator annotator = new GroupDocs.Annotation.Annotator("input.pdf"))
{
GroupDocs.Annotation.Models.FormatSpecificComponents.Pdf.CheckBoxComponent checkbox = new GroupDocs.Annotation.Models.FormatSpecificComponents.Pdf.CheckBoxComponent
{
Checked = true,
Box = new GroupDocs.Annotation.Models.Rectangle(100, 100, 100, 100),
PenColor = 65535,
Style = GroupDocs.Annotation.Models.BoxStyle.Star,
Replies = new List<GroupDocs.Annotation.Models.Reply>
{
new GroupDocs.Annotation.Models.Reply
{
Comment = "First comment",
RepliedOn = DateTime.Now
},
new GroupDocs.Annotation.Models.Reply
{
Comment = "Second comment",
RepliedOn = DateTime.Now
}
}
};
annotator.Add(checkbox);
annotator.Save("checkbox.pdf");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment