Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfPageFacade.AddSquareAnnotation(PdfRectangle) Method

Creates a square annotation in the specified page rectangle.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Core

#Declaration

public PdfSquareAnnotationFacade AddSquareAnnotation(
    PdfRectangle rect
)

#Parameters

Name Type Description
rect PdfRectangle

The page area to create the square annotation.

#Returns

Type Description
PdfSquareAnnotationFacade

An object that contains square annotation properties.

#Example

The code sample below creates a square annotation.

square 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 the area to add an annotation
    PdfRectangle rectangle = new PdfRectangle(663, 526, 763, 576);

    // Create a square annotation
    PdfSquareAnnotationFacade squareAnnotation = pageFacade.AddSquareAnnotation(rectangle);

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

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