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:
//Load the existing PDF Document PdfLoadedDocument document = new PdfLoadedDocument(@”Sample.pdf"); //Load the first page PdfPageBase page = document.Pages; //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);
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.
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!