Back to Devexpress

PdfPageFacade.AddRubberStampAnnotation(PdfRectangle, String, Boolean) Method

officefileapi-devexpress-dot-pdf-dot-pdfpagefacade-dot-addrubberstampannotation-x28-devexpress-dot-pdf-dot-pdfrectangle-system-dot-string-system-dot-boolean-x29.md

latest3.6 KB
Original Source

PdfPageFacade.AddRubberStampAnnotation(PdfRectangle, String, Boolean) Method

Creates a rubber stamp annotation in the specified page rectangle.

Namespace : DevExpress.Pdf

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

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public PdfRubberStampAnnotationFacade AddRubberStampAnnotation(
    PdfRectangle rect,
    string iconName,
    bool keepAspectRatio
)
vb
Public Function AddRubberStampAnnotation(
    rect As PdfRectangle,
    iconName As String,
    keepAspectRatio As Boolean
) As PdfRubberStampAnnotationFacade

Parameters

NameTypeDescription
rectPdfRectangle

A page area to add the rubber stamp annotation.

| | iconName | String |

The name of the annotation icon. Use the PdfRubberStampAnnotationIconName fields to specify a built-in annotation icon.

|

Optional Parameters

NameTypeDefaultDescription
keepAspectRatioBooleanTrue

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

|

Returns

TypeDescription
PdfRubberStampAnnotationFacade

An object that contains rubber stamp annotation properties.

|

Example

The following code snippet creates a Top Secret rubber stamp:

csharp
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);

    // Create a rubber stamp in this rectangle
    PdfRubberStampAnnotationFacade rubberStamp =
       page.AddRubberStampAnnotation(rubberStampRectangle, PdfRubberStampAnnotationIconName.TopSecret);
    rubberStamp.Author = "Jesse Faden";
    rubberStamp.Contents = "Made in PDF Document API";
}
vb
Using processor As New PdfDocumentProcessor()
  'Load a document.
  processor.LoadDocument("..\..\Document.pdf")

  ' Access the first page properties.
  Dim page As PdfPageFacade = processor.DocumentFacade.Pages(0)

  ' Define a rubber stamp rectangle
  Dim rubberStampRectangle As New PdfRectangle(663, 526, 763, 576)

  ' Create a rubber stamp in this rectangle
  Dim rubberStamp As PdfRubberStampAnnotationFacade =
     page.AddRubberStampAnnotation(rubberStampRectangle, PdfRubberStampAnnotationIconName.TopSecret)
  rubberStamp.Author = "Jesse Faden"
  rubberStamp.Contents = "Made in PDF Document API"

End Using

See Also

PdfPageFacade Class

PdfPageFacade Members

DevExpress.Pdf Namespace