How to Add Special Annotations for PDF using .NET
Leave feedback
On this page
Special annotations for PDF documents only
We think it’s no secret that the PDF format is the most popular format among text documents. Many people prefer to use it because they know that the style and formatting of the document is maintained regardless of the computer or application with which the PDF is viewed. Given its popularity, our .NET API has been improved. We have created annotations unique to the PDF format, the so-called Components. As you know, our .NET API supports a large number of annotations that can be applied to different documents - Word documents, Excel sheets, Visio diagrams, PDF etc. But Component support PDF only!
This article will talk about the components that are already implemented in the Annotation .NET API and how you can use them.
Button component
Button component allows to create button component like shown at the picture below:
There is an ability to specify the next properties for ButtonComponent type:
Box - defines annotation position at document page;
Call Save method with resultant document path or stream.
The following code demonstrates how to add DropdownComponent to the document:
using(Annotatorannotator=newAnnotator("input.pdf")){DropdownComponentdropdown=newDropdownComponent{Options=newList<string>{"Item1","Item2","Item3"},SelectedOption=null,Placeholder="Choose option",Box=newRectangle(100,100,100,100),CreatedOn=DateTime.Now,Message="This is dropdown component",PageNumber=0,PenColor=65535,PenStyle=PenStyle.Dot,PenWidth=3,Replies=newList<Reply>{newReply{Comment="First comment",RepliedOn=DateTime.Now},newReply{Comment="Second comment",RepliedOn=DateTime.Now}}};annotator.Add(dropdown);annotator.Save("result.pdf");}
Conclusion
In this article we have told you about components that are unique to pdf. We showed you how to add a button, a checkbox and a drop-down list. Now, you should be confident to build your own document annotator using our .NET application API.
More resources
Advanced Usage Topics
To learn more about document annotating features, please refer to the advanced usage section.
Free Online App
Along with full-featured .NET library we provide simple but powerful free Apps.
You are welcome to annotate your PDF, DOC or DOCX, XLS or XLSX, PPT or PPTX, PNG and other documents with free to use online GroupDocs Annotation App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.