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
#Parameters
Name | Type | Description |
---|---|---|
pdf |
String | The name of a document (including a full path) used to generate a stamp. |
#Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
page |
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); }
}
}