Class StampAnnotation
Contents
[
Hide
]StampAnnotation class
Represents rubber stamp annotation. This type of annotation displays text or graphics intended to look as if they were stamped on the page with a rubber stamp.
public sealed class StampAnnotation : MarkupAnnotation
Constructors
Name | Description |
---|---|
StampAnnotation(Document) | Constructor |
StampAnnotation(Page, Rectangle) | Creates new Stamp annotation on the specified page. |
Properties
Name | Description |
---|---|
Actions { get; } | Gets list of annotatation actions. |
virtual ActiveState { get; set; } | Gets or sets current annotation appearance state. |
override AnnotationType { get; } | Gets type of annotation. |
Appearance { get; } | Gets appearance dictionary of the annotation. |
Border { get; set; } | Gets or sets annotation border characteristics. Border |
Characteristics { get; } | Gets annotation characteristics. |
Color { get; set; } | Gets or sets annotation color. |
Contents { get; set; } | Gets or sets annotation text. |
CreationDate { get; } | Gets date and time when annotation was created. |
Flags { get; set; } | Flags of the annotation. |
FullName { get; } | Gets full qualified name of the annotation. |
virtual Height { get; set; } | Gets or sets height of the annotation. |
virtual Hyperlink { get; set; } | Gets or sets the fragment hyperlink(for pdf generator). |
Icon { get; set; } | Gets or sets icon for rubber stamp. |
Image { get; set; } | Gets or sets image of the annotation. |
InReplyTo { get; set; } | A reference to the annotation that this annotation is “in reply to”. Both annotations must be on the same page of the document. |
IsFirstParagraphInColumn { get; set; } | Gets or sets a bool value that indicates whether this paragraph will be at next column. Default is false.(for pdf generation) |
IsInLineParagraph { get; set; } | Gets or sets a paragraph is inline. Default is false.(for pdf generation) |
IsInNewPage { get; set; } | Gets or sets a bool value that force this paragraph generates at new page. Default is false.(for pdf generation) |
IsKeptWithNext { get; set; } | Gets or sets a bool value that indicates whether current paragraph remains in the same page along with next paragraph. Default is false.(for pdf generation) |
Margin { get; set; } | Gets or sets a outer margin for paragraph (for pdf generation) |
Modified { get; set; } | Gets or sets date and time when annotation was recently modified. |
Name { get; set; } | Gets or sets annotation name on the page. |
Opacity { get; set; } | Gets or sets the constant opacity value to be used in painting the annotation. |
virtual PageIndex { get; } | Gets index of page which contains annotation. |
Popup { get; set; } | Pop-up annotation for entering or editing the text associated with this annotation. |
virtual Rect { get; set; } | Gets or sets annotation rectangle. |
ReplyType { get; set; } | A string specifying the relationship (the “reply type”) between this annotation and one specified by InReplyTo. |
RichText { get; set; } | Gets or sets a rich text string to be displayed in the pop-up window when the annotation is opened. |
States { get; } | Gets appearance dictionary of annotation. |
Subject { get; set; } | Gets text representing desciption of the object. |
TextHorizontalAlignment { get; set; } | Gets or sets text alignment for annotation. |
Title { get; set; } | Gets or sets a text that shall be displayed in title bar of annotation. |
virtual VerticalAlignment { get; set; } | Gets or sets a vertical alignment of paragraph |
virtual Width { get; set; } | Gets or sets width of the annotation. |
ZIndex { get; set; } | Gets or sets a int value that indicates the Z-order of the graph. A graph with larger ZIndex will be placed over the graph with smaller ZIndex. ZIndex can be negative. Graph with negative ZIndex will be placed behind the text in the page. |
Methods
Name | Description |
---|---|
override Accept(AnnotationSelector) | Acepts AnnotationSelector visitor when browsing annotation collection. |
virtual ChangeAfterResize(Matrix) | Update parameters and appearance, according to the matrix transform. |
ClearState() | Clears state and state model for the annotation. For example, clears the review status for an annotation. Note, the state stored in other text annotation which has state and statemodel keys. |
virtual Clone() | Clones this instance. Virtual method. Always return null. |
Flatten() | Places annotation contents directly on the page, annotation object will be removed. |
GetRectangle(bool) | Returns rectangle of annotation taking into consideration page rotation. |
GetState() | Gets the state of the annotation. Note, the state stored in other text annotation which has state and statemodel keys. |
GetStateModel() | Gets the state model of the annotation. Note, the state stored in other text annotation which has state and statemodel keys. |
SetMarkedState(bool) | Sets Marked and Unmarked state for the annotation. Note, the state stored in other text annotation which has state and statemodel keys. |
SetReviewState(AnnotationState) | Sets the review state for an annotation. Marked and Unmarked states are ignored as they do not belong to the Review StateModel. The state is set by the user who created the target annotation. The value is taken from the Title property of the target annotation. Note, the state stored in other text annotation which has state and statemodel keys. |
SetReviewState(AnnotationState, string) | Sets the review state for an annotation. Marked and Unmarked states are ignored as they do not belong to the Review StateModel. Note, the state stored in other text annotation which has state and statemodel keys. |
Examples
Next code snippet demonstrates how to add 2 stamps into the first pdf document page. Input document comes from inFile and changes are saved into the outFile. The first stamp has icon NotForPublicRelease and the second comes with image from rubber.jpg.
Document document = new Document(inFile);
StampAnnotation stamp1 = new StampAnnotation(StampIcon.NotForPublicRelease);
stamp1.Rect = new Rectangle(100, 100, 120, 120)
document.Pages[1].Annotations.Add(stamp1);
StampAnnotation stamp2 = new StampAnnotation(new FileStream("rubber.jpg", FileMode.Open));
stamp2.Rect = new Rectangle(200, 200, 220, 220)
document.Pages[1].Annotations.Add(stamp2);
document.Save(outFile);
See Also
- class MarkupAnnotation
- namespace Aspose.Pdf.Annotations
- assembly Aspose.PDF