How to manipulate annotations in an existing PDF document ?
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
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 forums, Direct-Trac, or feedback portal. We are always happy to assist you!