We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to manipulate annotations in an existing PDF document?

Platform: WinForms |
Control: PDF
Tags: pdf, annotation

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

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile