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.AddRubberStampAnnotation(PdfRectangle, String, Int32, Boolean) Method

Creates a rubber stamp annotation in the specified page rectangle. Allows you use another document to generate a stamp.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Core

#Declaration

public PdfRubberStampAnnotationFacade AddRubberStampAnnotation(
    PdfRectangle rect,
    string pdfFileName,
    int pageNumber,
    bool keepAspectRatio
)

#Parameters

Name Type Description
rect PdfRectangle

The page area where to add the rubber stamp annotation.

pdfFileName String

The name of the document file used to generate a stamp (including the full path).

pageNumber Int32

The number of the document page used to generate a stamp.

keepAspectRatio Boolean

true to make the stamp aspect ratio fit the specified rectangle; otherwise, false.

#Returns

Type Description
PdfRubberStampAnnotationFacade

An object that contains rubber stamp annotation properties.

#Remarks

The code sample below uses another PDF document to generate a custom stamp:

custom stamp

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

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

    // Define a rubber stamp rectangle
    PdfRectangle rubberStampRectangle = new PdfRectangle(663, 526, 763, 576);

    // Specify a document to use as a custom stamp
    string customStampFile = "..\\..\\Demo.pdf";

    // Create a rubber stamp annotation
    PdfRubberStampAnnotationFacade rubberStamp =
       page.AddRubberStampAnnotation(rubberStampRectangle, customStampFile, 2, True);
    rubberStamp.Author = "Jesse Faden";

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

}
See Also