public class

StampPickerItem

extends Object
implements Parcelable
java.lang.Object
   ↳ com.pspdfkit.annotations.stamps.StampPickerItem

Class Overview

Entity representing single stamp in StampPickerDialog.

Summary

Nested Classes
class StampPickerItem.BitmapStampBuilder Builder for creating custom stamps with bitmap image. 
class StampPickerItem.Builder Builder for creating custom stamps from PredefinedStampType or custom String stamp type. 
Constants
float DEFAULT_STAMP_ANNOTATION_ASPECT_RATIO Default stamp annotation aspect ration.
float DEFAULT_STAMP_ANNOTATION_PDF_HEIGHT Default stamp annotation height.
float DEFAULT_STAMP_ANNOTATION_PDF_WIDTH Default stamp annotation width.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<StampPickerItem> CREATOR A field that generates the instances of this class from the provided Parcel.
Public Methods
StampAnnotation createStampAnnotation(int pageIndex)
Creates stamp annotation from picker item data.
int describeContents()
static StampPickerItem.BitmapStampBuilder fromBitmap(Bitmap bitmap)
Creates builder for stamp annotation with bitmap image.
static StampPickerItem.Builder fromPredefinedType(Context context, PredefinedStampType predefinedStampType)
Creates builder for stamp annotations pre-filled with properties of PredefinedStampType.
static StampPickerItem.Builder fromStampType(Context context, StampType stampType)
Creates builder for stamp annotation using a custom stamp type.
static StampPickerItem.Builder fromTitle(Context context, String title)
Creates builder for stamp annotation using a title.
AppearanceStreamGenerator getAppearanceStreamGenerator()
Returns appearance stream generator that replaces default stamp appearance.
Bitmap getBitmap()
Returns bitmap if set, null otherwise.
float getDefaultPdfHeight()
Default height of this stamp type in pdf coordinates.
float getDefaultPdfWidth()
Default width of this stamp type in pdf coordinates.
static List<StampPickerItem> getDefaultStampPickerItems(Context context)
Returns default list of stamp picker items.
StampType getStampType()
String getSubtitle()
Integer getTextColor()
Returns text textColor if set, null otherwise.
String getTitle()
boolean isCustomStamp()
Returns true for special custom stamp can be personalized by users.
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final float DEFAULT_STAMP_ANNOTATION_ASPECT_RATIO

Default stamp annotation aspect ration.

Constant Value: 0.33333334

public static final float DEFAULT_STAMP_ANNOTATION_PDF_HEIGHT

Default stamp annotation height.

Constant Value: 70.0

public static final float DEFAULT_STAMP_ANNOTATION_PDF_WIDTH

Default stamp annotation width.

Constant Value: 210.0

Fields

public static final Creator<StampPickerItem> CREATOR

A field that generates the instances of this class from the provided Parcel.

Public Methods

public StampAnnotation createStampAnnotation (int pageIndex)

Creates stamp annotation from picker item data.

Parameters
pageIndex Page to create stamp annotation on.

public int describeContents ()

public static StampPickerItem.BitmapStampBuilder fromBitmap (Bitmap bitmap)

Creates builder for stamp annotation with bitmap image.

Parameters
bitmap Bitmap used for custom stamp annotation.

public static StampPickerItem.Builder fromPredefinedType (Context context, PredefinedStampType predefinedStampType)

Creates builder for stamp annotations pre-filled with properties of PredefinedStampType.

Parameters
context The context used to access resources.
predefinedStampType Predefined stamp type used to initialize builder properties.

public static StampPickerItem.Builder fromStampType (Context context, StampType stampType)

Creates builder for stamp annotation using a custom stamp type.

Parameters
context The context used to access resources.
stampType Stamp type to use for created stamp annotation.

public static StampPickerItem.Builder fromTitle (Context context, String title)

Creates builder for stamp annotation using a title.

Parameters
context The context used to access resources.
title Text that is displayed on the stamp.

public AppearanceStreamGenerator getAppearanceStreamGenerator ()

Returns appearance stream generator that replaces default stamp appearance.

Returns
  • Appearance stream generator if set, null otherwise.

public Bitmap getBitmap ()

Returns bitmap if set, null otherwise. Stamp picker items with bitmap are special items with:

  • null #subtitle
  • null #title
  • null #textColor

Returns
  • Bitmap if set, null otherwise.

public float getDefaultPdfHeight ()

Default height of this stamp type in pdf coordinates. Also used to ensure correct stamp aspect ratio in StampPickerDialog.

public float getDefaultPdfWidth ()

Default width of this stamp type in pdf coordinates. Also used to ensure correct stamp aspect ratio in StampPickerDialog.

public static List<StampPickerItem> getDefaultStampPickerItems (Context context)

Returns default list of stamp picker items.

Parameters
context Context used in created StampPickerItems.
Returns
  • List of default stamp picker items.

public StampType getStampType ()

See Also

public String getSubtitle ()

See Also

public Integer getTextColor ()

Returns text textColor if set, null otherwise.

Returns
  • Text textColor.

public String getTitle ()

See Also

public boolean isCustomStamp ()

Returns true for special custom stamp can be personalized by users.

Returns
  • true for special custom stamp can be personalized by users.

public void writeToParcel (Parcel dest, int flags)