Articles in this section
Category / Section

How to manipulate annotations in an existing PDF document ?

1 min read

You can load the existing pdf file using PdfLoadedDocument and you can add the annotation at the specified page of the loaded document.

Refer the following code example to achieve the requirements as specified above:

C#

//Load the existing PDF Document
PdfLoadedDocument document = new PdfLoadedDocument(@”Sample.pdf");
//Load the first page
PdfPageBase page = document.Pages[0];
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create a new Uri Annotation.
PdfUriAnnotation uriAnnotation = new PdfUriAnnotation(rectangle, "www.syncfusion.com");
//Set Text to uriAnnotation.
uriAnnotation.Text = "Uri Annotation";
//Add this annotation to a new page.
page.Annotations.Add(uriAnnotation);
// Save and close the document.
document.Save("Sample.pdf");
document.Close(true);

Sample Link:

https://www.syncfusion.com/downloads/support/directtrac/general/PdfAnnotation1287914378.zip


Conclusion

I hope you enjoyed learning about how to manipulate annotations in an existing PDF document.

You can refer to our WinForms FileFormat Libraries to know about its other groundbreaking feature representations and how to quickly get started for configuration specifications. You can also explore our demo to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied