Adding Annotations to existing PDF file

Add Free Text Annotation in an Existing PDF File (facades)

PdfContentEditor allows you to add annotations of different types in an existing PDF file. You can use the respective method to add a particular annotation. For example, in the following code snippet, we have used CreateFreeText method add FreeText type annotation.

Any type of annotations can be added to the PDF file in the same way. First of all, you need to create an object of type PdfContentEditor and bind input PDF file using BindPdf method. Secondly, you have to create a Rectangle object to specify the area of the annotatation.

After that, you can call CreateFreeText method to add FreeText annotation, and then use Save method to save the updated PDF file.

The following code snippet shows you how to add free text annotation in a PDF file.

Add Text Annotation in an Existing PDF File (facades)

In this example also, you need to create an object of type PdfContentEditor and bind input PDF file using BindPdf method. Secondly, you have to create a Rectangle object to specify the area of the annotation. After that, you can call CreateFreeText method to add FreeText annotation, create title of your annotations, and the page number on which the annotation is located.

Add Line Annotation in an Existing PDF File (facades)

We also specify the Rectangle, coordinates of the beginning and end of the line, page number, thickness, style and color of the annotation frame, type of line dash, type of start and end of the line.