StampAnnotation
public
final
class
StampAnnotation
extends PdfAnnotation
java.lang.Object | ||
↳ | android.graphics.pdf.component.PdfAnnotation | |
↳ | android.graphics.pdf.component.StampAnnotation |
Represents a stamp annotation in a PDF document.
Only path, image, or text objects created using the PdfPagePathObject
,
PdfPageImageObject
, or PdfPageTextObject
constructors respectively
can be added to a stamp annotation.
Summary
Public constructors | |
---|---|
StampAnnotation(RectF bounds)
Creates a new stamp annotation with the specified bounds. |
Public methods | |
---|---|
void
|
addObject(PdfPageObject pageObject)
Adds a PDF page object to the stamp annotation. |
RectF
|
getBounds()
Returns the bounding rectangle of the stamp annotation. |
List<PdfPageObject>
|
getObjects()
Returns all the known PDF page objects in the stamp annotation. |
void
|
removeObject(int index)
Remove the page object at the given index inside the stamp annotation. |
void
|
setBounds(RectF bounds)
Sets the bounding rectangle of the stamp annotation. |
Inherited methods | |
---|---|
Public constructors
StampAnnotation
public StampAnnotation (RectF bounds)
Creates a new stamp annotation with the specified bounds.
The list of page objects inside the stamp annotation will be empty by default
Parameters | |
---|---|
bounds |
RectF : The bounding rectangle of the annotation.
This value cannot be null . |
Public methods
addObject
public void addObject (PdfPageObject pageObject)
Adds a PDF page object to the stamp annotation.
The page object should be a path, text or an image.
Parameters | |
---|---|
pageObject |
PdfPageObject : The PDF page object to add.
This value cannot be null . |
Throws | |
---|---|
IllegalArgumentException |
if the page object is already added to a page or an annotation. |
getBounds
public RectF getBounds ()
Returns the bounding rectangle of the stamp annotation.
Returns | |
---|---|
RectF |
The bounding rectangle.
This value cannot be null . |
getObjects
public List<PdfPageObject> getObjects ()
Returns all the known PDF page objects in the stamp annotation.
Returns | |
---|---|
List<PdfPageObject> |
The list of page objects in the annotation.
This value cannot be null . |
removeObject
public void removeObject (int index)
Remove the page object at the given index inside the stamp annotation. Here index is the
index of the page object in the list of page objects returned by getObjects()
Parameters | |
---|---|
index |
int : - index of the object to be removed
Value is 0 or greater |
Throws | |
---|---|
IllegalArgumentException |
if there is no object in the annotation with the given id |
setBounds
public void setBounds (RectF bounds)
Sets the bounding rectangle of the stamp annotation.
Parameters | |
---|---|
bounds |
RectF : The new bounding rectangle.
This value cannot be null . |