All docs
V21.2
21.2
21.1
The page you are viewing does not exist in version 21.1. This link will take you to the root page.
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfCircleAnnotationFacade Class

Exposes members used to organize circle annotations without access to their inner structure.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v21.2.Core.dll

Declaration

public class PdfCircleAnnotationFacade :
    PdfShapeAnnotationFacade

Remarks

Create Circle Annotations

The code sample below creates a circle annotation:

circle annotation

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    // Load a document
    processor.LoadDocument("..\\..\\Document.pdf");

    // Access the first page properties
    PdfPageFacade pageFacade = processor.DocumentFacade.Pages[0];

    // Define an annotation area
    PdfRectangle rectangle = new PdfRectangle(663, 526, 763, 576);

    // Create a circle annotation
    PdfCircleAnnotationFacade circleAnnotation = pageFacade.AddCircleAnnotation(rectangle);

    // Specify annotation parameters
    circleAnnotation.Author = "Nancy Davolio";
    circleAnnotation.Contents = "Made in PDF Document API";

    // Save the result
    processor.SaveDocument("..\\..\\Result.pdf");
}

Edit Circle Annotations

The PdfPageFacade.Annotations property returns all page annotation properties. You can filter circle annotation properties, cast them to the PdfCircleAnnotationFacade class, and use class properties to modify annotation parameters.

The code sample below retrieves all circle annotations on the first page and changes their border and fill color.

changed circle annotation

using DevExpress.Pdf;
using System.Linq;

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    // Load a document
    processor.LoadDocument("..\\..\\Document.pdf");

    // Access the first page properties
    PdfPageFacade pageFacade = processor.DocumentFacade.Pages[0];

    // Retrieve all circle annotations
    var circleAnnotations = pageFacade.Annotations.Where
      (annotation => annotation.Type == PdfAnnotationType.Circle);
    foreach (PdfCircleAnnotationFacade circleAnnotation in circleAnnotations)
    {
        // Change annotation parameters
        circleAnnotation.Color = new PdfRGBColor(1,1,1); 
        circleAnnotation.InteriorColor = new PdfRGBColor(0.87, 0.60, 1.00); 
    }
    // Save the result
    processor.SaveDocument("..\\..\\Result.pdf");
}

Flatten Circle Annotations

Call one of the following methods to flatten an annotation:

Method Description
PdfDocumentFacade.FlattenAnnotations Flattens document annotations.
PdfPageFacade.FlattenAnnotations Flattens annotations of a specific page.
PdfAnnotationFacade.Flatten() Flattens a specific annotation.

The code sample below flattens all circle annotations on the first page:

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    // Load a document
    processor.LoadDocument("..\\..\\Document.pdf");

    // Access the first page properties
    PdfPageFacade pageFacade = processor.DocumentFacade.Pages[0];

    // Flatten all circle annotations
    pageFacade.FlattenAnnotations(PdfAnnotationType.Circle);

    // Save the result
    processor.SaveDocument("..\\..\\Result.pdf");
}

Remove Circle Annotations

Call the PdfAnnotationFacade.Remove() method to remove a specific annotation.

The code sample below removes all circle annotations from the first page:

using DevExpress.Pdf;
using System.Linq;

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    // Load a document
    processor.LoadDocument("..\\..\\Document.pdf");

    // Access the first page properties
    PdfPageFacade pageFacade = processor.DocumentFacade.Pages[0];

    // Retrieve all circle annotations
    var circleAnnotations = pageFacade.Annotations.Where
      (annotation => annotation.Type == PdfAnnotationType.Circle).ToList();
    foreach (PdfCircleAnnotationFacade circle in circleAnnotations)
    {
        // Remove each annotation
        circle.Remove();
    }
    // Save the result
    processor.SaveDocument("..\\..\\Result.pdf");
}
See Also