java.lang.Object | ||
↳ | com.pspdfkit.annotations.Annotation | |
↳ | com.pspdfkit.annotations.StampAnnotation |
Represents a stamp or annotationBitmap annotation on the page.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
StampAnnotation(int pageIndex, RectF rect, byte[] compressedBitmap)
Creates a new stamp annotation with the passed bitmap as contents.
| |||||||||||
StampAnnotation(int pageIndex, RectF rect, Bitmap bitmap)
Creates a new stamp annotation with the passed bitmap as contents.
| |||||||||||
StampAnnotation(int pageIndex, RectF rect, StampType stampType)
Creates a new standard stamp annotation.
| |||||||||||
StampAnnotation(int pageIndex, RectF rect, String title)
Creates a new stamp with custom title.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
adjustBoundsForRotation()
This adjusts the annotations bounding box to the smallest possible size that will encompass
the rotated annotations at it's default size.
| ||||||||||
synchronized Bitmap |
getBitmap()
Returns a bitmap from this stamp annotation if there is any.
| ||||||||||
Size |
getMinimumSize()
Returns the minimum size of the annotation.
| ||||||||||
int |
getRotation()
Returns the clockwise rotation of this stamp in degrees.
| ||||||||||
StampType |
getStampType()
Returns type of this stamp if it's one of the standard types listed in
StampType . | ||||||||||
String |
getSubtitle()
Returns text in second line of the stamp if any is available.
| ||||||||||
String |
getTitle()
Returns text in first line of the stamp if any is available.
| ||||||||||
AnnotationType |
getType()
Gets the annotation type of the annotation.
| ||||||||||
synchronized boolean |
hasBitmap()
Checks whether annotation is an annotationBitmap annotation.
| ||||||||||
synchronized void |
setBitmap(Bitmap bitmap)
Sets a custom bitmap for this stamp annotation.
| ||||||||||
synchronized void |
setBitmap(byte[] compressedBitmap)
Sets a custom bitmap for this stamp annotation.
| ||||||||||
void |
setIsSignature(boolean isSignature)
Sets whether this annotation is an electronic signature annotation.
| ||||||||||
void |
setRotation(int rotation, boolean adjustBounds)
Sets the rotation of this stamp.
| ||||||||||
void |
setRotation(int rotation, Size contentSize)
Sets the rotation of this stamp.
| ||||||||||
void |
setRotation(int rotation, Size contentSize, boolean adjustBounds)
Sets the rotation of this stamp.
| ||||||||||
void |
setRotation(int rotation)
Sets the rotation of this stamp.
| ||||||||||
synchronized void |
setStampType(StampType stampType)
Sets the type of stamp this is.
| ||||||||||
void |
setSubtitle(String subtitle)
Sets text displayed in a second smaller line of the stamp.
| ||||||||||
void |
setTitle(String title)
Sets text displayed in the first line of the stamp.
| ||||||||||
String |
toInstantJson()
Produces Instant JSON representation of this annotation.
| ||||||||||
void |
updateTransformationProperties(RectF newBoundingBox, RectF oldBoundingBox)
Annotations may override this method to transform their properties (i.e.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Creates a new stamp annotation with the passed bitmap as contents.
pageIndex | Page to which this annotation will be attached to. |
---|---|
rect | Bounding rectangle for this annotations image. |
compressedBitmap | JPEG compressed bitmap data to be stored into the annotation. |
Creates a new stamp annotation with the passed bitmap as contents.
pageIndex | Page to which this annotation will be attached to. |
---|---|
rect | Bounding rectangle for this annotations image. |
bitmap | Bitmap to be stored into the annotation. |
Creates a new standard stamp annotation.
pageIndex | Page to which this annotation will be attached to. |
---|---|
rect | Bounding rectangle for this annotations image. |
stampType | Stamp type to display. |
Creates a new stamp with custom title.
Note: Starting with PSPDFKit 5.0 the subject will no longer influence the appearance of
the stamp annotation. The title is used instead. To create a standard stamp use StampAnnotation(int, RectF, StampType)
.
pageIndex | Page to which this annotation will be attached to. |
---|---|
rect | Bounding rectangle for this annotations image. |
title | Title to display on the stamp. |
This adjusts the annotations bounding box to the smallest possible size that will encompass the rotated annotations at it's default size.
Returns a bitmap from this stamp annotation if there is any.
Returns the minimum size of the annotation.
Returns the clockwise rotation of this stamp in degrees.
Returns type of this stamp if it's one of the standard types listed in StampType
.
Returns null
if the stamp uses a non-standard title.
null
if the type isn't standard.
Returns text in second line of the stamp if any is available.
null
if none is set.
Returns text in first line of the stamp if any is available.
null
if none is set.
Gets the annotation type of the annotation.
Checks whether annotation is an annotationBitmap annotation.
Sets a custom bitmap for this stamp annotation.
Note: This clears existing stamp type, title and subtitle.
bitmap | Bitmap to be stored into the annotation. |
---|
Sets a custom bitmap for this stamp annotation.
Note: This clears existing stamp type, title and subtitle.
compressedBitmap | JPEG compressed bitmap data to be stored into the annotation. |
---|
Sets whether this annotation is an electronic signature annotation.
isSignature | Whether or not this annotation is classed as an electronic signature. By default this is false. |
---|
Sets the rotation of this stamp.
See also adjustBoundsForRotation()
rotation | The clockwise rotation in degrees. |
---|---|
adjustBounds | If true will also adjust the bounding box to match the new
rotation.
|
Sets the rotation of this stamp. This will adjust the bounding box so rotating the annotation will cause the bounds to change.
Hint: If you are using a custom AP stream make sure that the bounding box aspect ratio matches the source aspect ratio exactly, otherwise the stamp will appear distorted when rotated.
See also setRotation(int)
. See also setRotation(int, Size, boolean)
.
rotation | The clockwise rotation in degrees. |
---|---|
contentSize | The size of the annotation content, it will be rotated and scaled to fit inside the actual bounding box. |
Sets the rotation of this stamp.
Hint: If you are using a custom AP stream make sure that the bounding box aspect ratio matches the source aspect ratio exactly, otherwise the stamp will appear distorted when rotated.
See also adjustBoundsForRotation()
.
rotation | The clockwise rotation in degrees. |
---|---|
contentSize | The size of the annotation content, it will be rotated and scaled to fit inside the actual bounding box. |
adjustBounds | If true will also adjust the bounding box to match the new
rotation.
|
Sets the rotation of this stamp. This will adjust the bounding box so rotating the annotation will cause the bounds to change.
Hint: If you are using a custom AP stream make sure that the bounding box aspect ratio matches the source aspect ratio exactly, otherwise the stamp will appear distorted when rotated.
See also setRotation(int, Size)
. See also setRotation(int, boolean)
.
rotation | The clockwise rotation in degrees. |
---|
Sets the type of stamp this is.
stampType | Stamp type to set. |
---|
Sets text displayed in a second smaller line of the stamp.
subtitle | text to be displayed or null if none should be shown.
|
---|
Sets text displayed in the first line of the stamp.
title | text to be displayed or null if the default should be shown.
|
---|
Produces Instant JSON representation of this annotation.
Note: Make sure the annotation is attached to the document before exporting it to Instant JSON.
Annotations may override this method to transform their properties (i.e. points, rects, sizes) whenever the bounding box of the annotation changed.
newBoundingBox | New bounding box of the annotation (in PDF points). |
---|---|
oldBoundingBox | Old bounding box of the annotation (in PDF points). |