Created
September 22, 2022 07:11
-
-
Save conholdate-docs-gists/0b96fd14df88332224777c1960cab12d to your computer and use it in GitHub Desktop.
Add Text Field Annotation in a document | https://docs.conholdate.com/net/add-text-field-annotation/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add text field annotation to the document from local disk | |
using (Annotator annotator = new Annotator("input.pdf")) | |
{ | |
TextFieldAnnotation textField = new TextFieldAnnotation | |
{ | |
BackgroundColor = 65535, | |
Box = new Rectangle(100, 100, 100, 100), | |
CreatedOn = DateTime.Now, | |
Text = "Some text", | |
FontColor = 65535, | |
FontSize = 12, | |
Message = "This is text field annotation", | |
Opacity = 0.7, | |
PageNumber = 0, | |
PenStyle = PenStyle.Dot, | |
PenWidth = 3, | |
FontFamily = "Arial", | |
TextHorizontalAlignment = HorizontalAlignment.Center, | |
Replies = new List<Reply> | |
{ | |
new Reply | |
{ | |
Comment = "First comment", | |
RepliedOn = DateTime.Now | |
}, | |
new Reply | |
{ | |
Comment = "Second comment", | |
RepliedOn = DateTime.Now | |
} | |
} | |
}; | |
annotator.Add(textField); | |
annotator.Save("result.pdf"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read the complete article: https://docs.conholdate.com/net/add-text-field-annotation/