public final class StampAnnotation extends MarkupAnnotation
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.
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.setRect ( new Rectangle(100, 100, 120, 120)) document.getPages().get(1).getAnnotations().add(stamp1); StampAnnotation stamp2 = new StampAnnotation(new FileStream("rubber.jpg", FileMode.Open)); stamp2.setRect ( new Rectangle(200, 200, 220, 220)) document.getPages().get(1).getAnnotations().add(stamp2); document.save(outFile);
_disableUpdateAppearance
Constructor and Description |
---|
StampAnnotation(IDocument document)
Constructor
|
StampAnnotation(Page page,
Rectangle rect)
Creates new Stamp annotation on the specified page.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(AnnotationSelector visitor)
Acepts
AnnotationSelector visitor when browsing annotation collection. |
int |
getAnnotationType()
Gets type of annotation.
|
int |
getIcon()
Gets icon for rubber stamp.
|
InputStream |
getImage()
Gets image of the annotation.
|
void |
setIcon(int value)
Sets icon for rubber stamp.
|
void |
setImage(InputStream value)
Sets image of the annotation.
|
getCreationDate, getInReplyTo, getOpacity, getPopup, getReplyType, getRichText, getSubject, getTitle, setInReplyTo, setOpacity, setPopup, setReplyType, setRichText, setSubject, setTitle
createAnnotation, flatten, getActiveState, getAlignment, getAppearance, getBorder, getCharacteristics, getColor, getContents, getEngineDict, getEngineObj, getFlags, getFullName, getHeight, getHorizontalAlignment_Annotation_New, getModified, getModifiedInternal, getName, getNormalAppearance, getPage, getPageIndex, getPageIndex, getPdfActions, getRect, getRectangle, getStates, getTextHorizontalAlignment, getWidth, initialize, isUpdateAppearanceOnConvert, isUseFontSubset, setActiveState, setAlignment, setBorder, setColor, setContents, setFlags, setHeight, setHorizontalAlignment_Annotation_New, setModified, setModifiedInternal, setName, setRect, setStructParent, setTextHorizontalAlignment, setUpdateAppearanceOnConvert, setUseFontSubset, setWidth
deepClone, getHorizontalAlignment, getHyperlink, getMargin, getVerticalAlignment, getZIndex, isFirstParagraphInColumn, isInLineParagraph, isInNewPage, isKeptWithNext, setFirstParagraphInColumn, setHorizontalAlignment, setHyperlink, setInLineParagraph, setInNewPage, setKeptWithNext, setMargin, setVerticalAlignment, setZIndex
public StampAnnotation(IDocument document)
Constructor
document
- Document where annotation will be created.public int getIcon()
Gets icon for rubber stamp.
public void setIcon(int value)
Sets icon for rubber stamp.
value
- StampIcon valuepublic int getAnnotationType()
Gets type of annotation.
getAnnotationType
in class Annotation
AnnotationType
public void accept(AnnotationSelector visitor)
Acepts AnnotationSelector
visitor when browsing annotation collection.
accept
in class Annotation
visitor
- Visitor object.public InputStream getImage()
Gets image of the annotation.
public void setImage(InputStream value)
Sets image of the annotation.
value
- InputStream object