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

PdfRubberStampAnnotationFacade.SetCustomIcon(String, Int32) Method

Creates a custom rubber stamp icon from a page in another document.

Namespace: DevExpress.Pdf

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

NuGet Package: DevExpress.Pdf.Core

#Declaration

public void SetCustomIcon(
    string pdfFileName,
    int pageNumber = 1
)

#Parameters

Name Type Description
pdfFileName String

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

#Optional Parameters

Name Type Default Description
pageNumber Int32 1

The target page number.

#Remarks

The code sample below shows how to change the rubber stamp icon to a custom icon generated from another document’s 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 page = processor.DocumentFacade.Pages[0];

    string customStampFile = "..\\..\\Demo.pdf";

    // Retrieve all rubber stamps
    var rubberStamps = page.Annotations.Where
      (annotation => annotation.Type == PdfAnnotationType.RubberStamp);

    // Set a custom icon for a rubber stamp of a specific author:
    foreach (PdfRubberStampAnnotationFacade rubberStamp in rubberStamps)
    {
        if (rubberStamp.Author == "Cardle Anita L")
           { rubberStamp.SetCustomIcon(customStampFile, 2); }
    }
}
See Also