PdfRubberStampAnnotation Class
Represents the rubber stamp annotation for a PDF document.
Implements
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfRubberStampAnnotation : PdfAnnotation, IPdfWrapper, INotifyPropertyChanged
Remarks
This PdfRubberStampAnnotation class is used to displays text or graphics stamped on the page. Please refer the UG docuemntation link https://help.syncfusion.com/file-formats/pdf/working-with-annotations#rubber-stamp-annotation for more details.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new pdf rubber stamp annotation.
RectangleF rectangle = new RectangleF(40, 60, 80, 20);
PdfRubberStampAnnotation rubberstampAnnotation = new PdfRubberStampAnnotation(rectangle, " Text Rubber Stamp Annotation");
rubberstampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft;
rubberstampAnnotation.Text = "Text Properties Rubber Stamp Annotation";
page.Annotations.Add(rubberstampAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new pdf rubber stamp annotation.
Dim rectangle As New RectangleF(40, 60, 80, 20)
Dim rubberstampAnnotation As New PdfRubberStampAnnotation(rectangle, " Text Rubber Stamp Annotation")
rubberstampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft
rubberstampAnnotation.Text = "Text Properties Rubber Stamp Annotation"
page.Annotations.Add(rubberstampAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
Constructors
PdfRubberStampAnnotation()
Initializes a new instance of the PdfRubberStampAnnotation class.
Declaration
public PdfRubberStampAnnotation()
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new pdf rubber stamp annotation.
PdfRubberStampAnnotation rubberstampAnnotation = new PdfRubberStampAnnotation();
rubberstampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft;
rubberstampAnnotation.Text = "Text Properties Rubber Stamp Annotation";
page.Annotations.Add(rubberstampAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page.
Dim page As PdfPage = document.Pages.Add()
'Create a new pdf rubber stamp annotation.
Dim rubberstampAnnotation As New PdfRubberStampAnnotation()
rubberstampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft
rubberstampAnnotation.Text = "Text Properties Rubber Stamp Annotation"
page.Annotations.Add(rubberstampAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
PdfRubberStampAnnotation(RectangleF)
Initializes a new instance of the PdfRubberStampAnnotation class with specified bounds.
RectangleF structure that specifies the bounds of the annotation.Declaration
public PdfRubberStampAnnotation(RectangleF rectangle)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rectangle |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new pdf rubber stamp annotation.
RectangleF rubberStampAnnotationBounds = new RectangleF(40, 60, 80, 20);
PdfRubberStampAnnotation rubberstampAnnotation = new PdfRubberStampAnnotation(rubberStampAnnotationBounds);
rubberstampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft;
rubberstampAnnotation.Text = "Text Properties Rubber Stamp Annotation";
page.Annotations.Add(rubberstampAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new pdf rubber stamp annotation.
Dim rubberStampAnnotationBounds As New RectangleF(40, 60, 80, 20)
Dim rubberStampAnnotation As New PdfRubberStampAnnotation(rubberStampAnnotationBounds)
rubberStampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft
rubberStampAnnotation.Text = "Text Properties Rubber Stamp Annotation"
page.Annotations.Add(rubberStampAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
PdfRubberStampAnnotation(RectangleF, String)
Initializes a new instance of the PdfRubberStampAnnotation class with specified bounds and text.
Declaration
public PdfRubberStampAnnotation(RectangleF rectangle, string text)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rectangle | The rectangleF structure that specifies the bounds of the annotation. |
System.String | text | The text of the rubber stamp annotation. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new pdf rubber stamp annotation.
RectangleF rubberStampAnnotationBounds = new RectangleF(40, 60, 80, 20);
PdfRubberStampAnnotation rubberStampAnnotation = new PdfRubberStampAnnotation(rubberStampAnnotationBounds, " Text Rubber Stamp Annotation");
//Sets the PDF appearance.
rubberStampAnnotation.Appearance = new PdfAppearance(rubberstampAnnotation);
rubberStampAnnotation.Appearance.Normal.Draw(page, new PointF(rubberStampAnnotation.Location.X, rubberStampAnnotation.Location.Y));
page.Annotations.Add(rubberStampAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new pdf rubber stamp annotation.
Dim rubberStampAnnotationBounds As New RectangleF(40, 60, 80, 20)
Dim rubberStampAnnotation As New PdfRubberStampAnnotation(rubberStampAnnotationBounds, " Text Rubber Stamp Annotation")
'Sets the PDF appearance.
rubberStampAnnotation.Appearance = New PdfAppearance(rubberstampAnnotation)
rubberStampAnnotation.Appearance.Normal.Draw(page, New PointF(rubberStampAnnotation.Location.X, rubberStampAnnotation.Location.Y))
page.Annotations.Add(rubberStampAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Properties
Appearance
Gets or sets appearance of the annotation.
Declaration
public PdfAppearance Appearance { get; set; }
Property Value
Type | Description |
---|---|
PdfAppearance | The PdfAppearance object specifies the appearance of the annotaion. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new pdf rubber stamp annotation.
RectangleF rubberstampannotationBounds = new RectangleF(40, 60, 80, 20);
PdfRubberStampAnnotation rubberstampAnnotation = new PdfRubberStampAnnotation(rubberstampannotationBounds, " Text Rubber Stamp Annotation");
//Sets the PDF appearance.
rubberstampAnnotation.Appearance = new PdfAppearance(rubberstampAnnotation);
rubberstampAnnotation.Appearance.Normal.Draw(page, new PointF(rubberstampAnnotation.Location.X, rubberstampAnnotation.Location.Y));
page.Annotations.Add(rubberstampAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new pdf rubber stamp annotation.
Dim rubberstampannotationBounds As New RectangleF(40, 60, 80, 20)
Dim rubberstampAnnotation As New PdfRubberStampAnnotation(rubberstampannotationBounds, " Text Rubber Stamp Annotation")
'Sets the PDF appearance.
rubberstampAnnotation.Appearance = New PdfAppearance(rubberstampAnnotation)
rubberstampAnnotation.Appearance.Normal.Draw(page, New PointF(rubberstampAnnotation.Location.X, rubberstampAnnotation.Location.Y))
page.Annotations.Add(rubberstampAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Comments
Gets the annotation comments
Declaration
public PdfPopupAnnotationCollection Comments { get; }
Property Value
Type |
---|
PdfPopupAnnotationCollection |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new pdf rubber stamp annotation.
RectangleF rectangle = new RectangleF(40, 60, 80, 20);
PdfRubberStampAnnotation rubberstampAnnotation = new PdfRubberStampAnnotation(rectangle, " Text Rubber Stamp Annotation");
rubberstampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft;
rubberstampAnnotation.Text = "Text Properties Rubber Stamp Annotation";
PdfPopupAnnotation popupComments = new PdfPopupAnnotation();
popupComments.Author = "TestAuthor";
popupComments.Text = "Test Text";
rubberstampAnnotation.Comments.Add(popupComments);
//Get annotation comments
PdfPopupAnnotationCollection commentsCollection = rubberstampAnnotation.Comments;
//Saves the document to disk.
document.Save("Output.pdf");
document.Close(true);
Dim document As PdfDocument = New PdfDocument
Dim page As PdfPage = document.Pages.Add
Dim rectangle As RectangleF = New RectangleF(40, 60, 80, 20)
Dim rubberstampAnnotation As PdfRubberStampAnnotation = New PdfRubberStampAnnotation(rectangle, " Text Rubber Stamp Annotation")
rubberstampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft
rubberstampAnnotation.Text = "Text Properties Rubber Stamp Annotation"
Dim popupComments As PdfPopupAnnotation = New PdfPopupAnnotation
popupComments.Author = "TestAuthor"
popupComments.Text = "Test Text"
rubberstampAnnotation.Comments.Add(popupComments)
Dim commentsCollection As PdfPopupAnnotationCollection = rubberstampAnnotation.Comments
'Saves the document to disk.
document.Save("Output.pdf")
document.Close(true)
Icon
Gets or sets the annotation's icon.
Declaration
public PdfRubberStampAnnotationIcon Icon { get; set; }
Property Value
Type | Description |
---|---|
PdfRubberStampAnnotationIcon | A PdfRubberStampAnnotationIcon enumeration member specifying the icon for the annotation when it is displayed in closed state. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new pdf rubber stamp annotation.
RectangleF rectangle = new RectangleF(40, 60, 80, 20);
PdfRubberStampAnnotation rubberStampAnnotation = new PdfRubberStampAnnotation(rectangle, " Text Rubber Stamp Annotation");
rubberStampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft;
rubberStampAnnotation.Text = "Text Properties Rubber Stamp Annotation";
page.Annotations.Add(rubberStampAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new pdf rubber stamp annotation.
Dim rectangle As New RectangleF(40, 60, 80, 20)
Dim rubberStampAnnotation As New PdfRubberStampAnnotation(rectangle, " Text Rubber Stamp Annotation")
rubberStampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft
rubberStampAnnotation.Text = "Text Properties Rubber Stamp Annotation"
page.Annotations.Add(rubberStampAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
ReviewHistory
Gets the annotation reviews
Declaration
public PdfPopupAnnotationCollection ReviewHistory { get; }
Property Value
Type |
---|
PdfPopupAnnotationCollection |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new pdf rubber stamp annotation.
RectangleF rectangle = new RectangleF(40, 60, 80, 20);
PdfRubberStampAnnotation rubberstampAnnotation = new PdfRubberStampAnnotation(rectangle, " Text Rubber Stamp Annotation");
rubberstampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft;
rubberstampAnnotation.Text = "Text Properties Rubber Stamp Annotation";
PdfPopupAnnotation popup = new PdfPopupAnnotation();
popup.State = PdfAnnotationState.Accepted;
popup.StateModel = PdfAnnotationStateModel.Review;
popup.Text = "Hello PDF Comments";
rubberstampAnnotation.ReviewHistory.Add(popup);
//Get Review history
PdfPopupAnnotationCollection reviewCollection = rubberstampAnnotation.ReviewHistory;
//Saves the document to disk.
document.Save("Output.pdf");
document.Close(true);
Dim document As PdfDocument = New PdfDocument
Dim page As PdfPage = document.Pages.Add
Dim rectangle As RectangleF = New RectangleF(40, 60, 80, 20)
Dim rubberstampAnnotation As PdfRubberStampAnnotation = New PdfRubberStampAnnotation(rectangle, " Text Rubber Stamp Annotation")
rubberstampAnnotation.Icon = PdfRubberStampAnnotationIcon.Draft
rubberstampAnnotation.Text = "Text Properties Rubber Stamp Annotation"
Dim popup As PdfPopupAnnotation = New PdfPopupAnnotation
popup.State = PdfAnnotationState.Accepted
popup.StateModel = PdfAnnotationStateModel.Review
popup.Text = "Hello PDF Comments"
rubberstampAnnotation.ReviewHistory.Add(popup)
Dim reviewCollection As PdfPopupAnnotationCollection = rubberstampAnnotation.ReviewHistory
'Saves the document to disk.
document.Save("Output.pdf")
document.Close(true)
Methods
Initialize()
Initializes annotation object.
Declaration
protected override void Initialize()
Overrides
Save()
Saves an annotation.
Declaration
protected override void Save()