Class PdfRubberStampAnnotation
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents the rubber stamp annotation for a PDF document.
public class PdfRubberStampAnnotation : PdfAnnotation, INotifyPropertyChanged
- Inheritance
-
PdfRubberStampAnnotation
- Implements
- Inherited Members
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)
Remarks
This PdfRubberStampAnnotation class is used to displays text or graphics stamped on the page. Please refer the UG docuemntation link
Constructors
PdfRubberStampAnnotation()
Initializes a new instance of the PdfRubberStampAnnotation class.
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.public PdfRubberStampAnnotation(RectangleF rectangle)
Parameters
rectangle
RectangleF
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.
public PdfRubberStampAnnotation(RectangleF rectangle, string text)
Parameters
rectangle
RectangleFThe rectangleF structure that specifies the bounds of the annotation.
text
stringThe 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.
public PdfAppearance Appearance { get; set; }
Property Value
- 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
public PdfPopupAnnotationCollection Comments { get; }
Property Value
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)
- See Also
Icon
Gets or sets the annotation's icon.
public PdfRubberStampAnnotationIcon Icon { get; set; }
Property Value
- 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
public PdfPopupAnnotationCollection ReviewHistory { get; }
Property Value
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)
- See Also
Methods
Initialize()
Initializes annotation object.
protected override void Initialize()
- See Also
Save()
Saves an annotation.
protected override void Save()
- See Also