public class

CustomStampOption

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.model.CustomStampOption
Known Direct Subclasses

Class Overview

The option for creating a custom rubber stamp.

Summary

Fields
public int bgColorEnd
public int bgColorStart
public int borderColor
public double fillOpacity
public boolean isPointingLeft
public boolean isPointingRight
public String secondText
public String text
public int textColor
Public Constructors
CustomStampOption(String text, String secondText, int bgColorStart, int bgColorEnd, int textColor, int borderColor, double fillOpacity, boolean isPointingLeft, boolean isPointingRight)
Class constructor
CustomStampOption(CustomStampOption another)
Class constructor
CustomStampOption(Obj stampObj)
Class constructor
Public Methods
synchronized static void addCustomStamp(Context context, CustomStampOption customStampOption, Bitmap bitmap)
Saves a new custom rubber stamp.
static Obj convertToObj(CustomStampOption customStampOption)
Creates an SDF obj option from a certain custom rubber stamp
static String createSecondText(boolean hasDate, boolean hasTime)
Creates the second text based on whether the custom rubber stamp has date/time
synchronized static void duplicateCustomStamp(Context context, int index)
Duplicates a certain custom rubber stamp right after the current position.
synchronized static Bitmap getCustomStampBitmap(Context context, int index)
Gets the custom rubber stamp bitmap for a specific index.
synchronized static Obj getCustomStampObj(Context context, int index)
Gets the saved custom rubber stamp at a certain position.
synchronized static int getCustomStampsCount(Context context)
Gets the number of saved custom rubber stamps.
boolean hasDateStamp()
boolean hasTimeStamp()
synchronized static List<Obj> loadCustomStamps(Context context)
Loads all saved custom rubber stamps.
synchronized static void moveCustomStamp(Context context, int fromPosition, int toPosition)
Moves a specific custom rubber stamp to a new position.
synchronized static void removeAllCustomStamps(Context context)
Removes all saved custom rubber stamps.
synchronized static void removeCustomStamp(Context context, int index)
Removes a specific custom rubber stamp from saved custom rubber stamps.
synchronized static void removeCustomStamps(Context context, List<Integer> indexes)
Removes certain custom rubber stamps from saved custom rubber stamps.
synchronized static void updateCustomStamp(Context context, int index, CustomStampOption customStampOption, Bitmap bitmap)
Updates an existing saved custom rubber stamp.
void updateDateTime()
Updates the second line text since date/time could have be changed.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public int bgColorEnd

public int bgColorStart

public int borderColor

public double fillOpacity

public boolean isPointingLeft

public boolean isPointingRight

public String secondText

public String text

public int textColor

Public Constructors

public CustomStampOption (String text, String secondText, int bgColorStart, int bgColorEnd, int textColor, int borderColor, double fillOpacity, boolean isPointingLeft, boolean isPointingRight)

Class constructor

Parameters
text The text to be displayed in the rubber stamp
secondText The text to be displayed below first text
bgColorStart The start background color in gradient background
bgColorEnd The end background color in gradient background
textColor The text color
borderColor The border color
fillOpacity The fill opacity
isPointingLeft True if pointing left
isPointingRight True if pointing right

public CustomStampOption (CustomStampOption another)

Class constructor

Parameters
another Another custom rubber stamp option object

public CustomStampOption (Obj stampObj)

Class constructor

Parameters
stampObj The stamp SDF Obj
Throws
PDFNetException PDFNet exception

Public Methods

public static synchronized void addCustomStamp (Context context, CustomStampOption customStampOption, Bitmap bitmap)

Saves a new custom rubber stamp.

Parameters
context The context
customStampOption The new custom rubber stamp
bitmap The generated bitmap which can be reloaded later to avoid recreating the bitmap

public static Obj convertToObj (CustomStampOption customStampOption)

Creates an SDF obj option from a certain custom rubber stamp

Parameters
customStampOption The custom rubber stamp option
Returns
  • The stamp's SDF Obj
Throws
PDFNetException PDFNet exception

public static String createSecondText (boolean hasDate, boolean hasTime)

Creates the second text based on whether the custom rubber stamp has date/time

Parameters
hasDate True if the custom rubber stamp has date; False otherwise
hasTime True if the custom rubber stamp has date; False otherwise
Returns
  • The second text

public static synchronized void duplicateCustomStamp (Context context, int index)

Duplicates a certain custom rubber stamp right after the current position.

Parameters
context The context
index The zero-indexed position

public static synchronized Bitmap getCustomStampBitmap (Context context, int index)

Gets the custom rubber stamp bitmap for a specific index.

Parameters
context The context
index The zero-indexed position of the saved custom rubber stamp
Returns
  • The bitmap of custom rubber stamp, or null if it could not be obtained

public static synchronized Obj getCustomStampObj (Context context, int index)

Gets the saved custom rubber stamp at a certain position.

Parameters
context The context
index The zero-indexed position of the saved custom rubber stamp
Returns
  • The saved custom rubber stamp as SDF Obj

public static synchronized int getCustomStampsCount (Context context)

Gets the number of saved custom rubber stamps.

Parameters
context The context
Returns
  • The number of saved custom rubber stamps

public boolean hasDateStamp ()

Returns
  • True if the custom rubber stamp has date

public boolean hasTimeStamp ()

Returns
  • True if the custom rubber stamp has time

public static synchronized List<Obj> loadCustomStamps (Context context)

Loads all saved custom rubber stamps.

Parameters
context The context
Returns
  • The saved custom rubber stamps as SDF Obj

public static synchronized void moveCustomStamp (Context context, int fromPosition, int toPosition)

Moves a specific custom rubber stamp to a new position.

Parameters
context The context
fromPosition The index of custom rubber stamp to be moved
toPosition The new index of custom rubber stamp

public static synchronized void removeAllCustomStamps (Context context)

Removes all saved custom rubber stamps.

Parameters
context The context

public static synchronized void removeCustomStamp (Context context, int index)

Removes a specific custom rubber stamp from saved custom rubber stamps.

Parameters
context The context
index The index of custom rubber stamp to be removed

public static synchronized void removeCustomStamps (Context context, List<Integer> indexes)

Removes certain custom rubber stamps from saved custom rubber stamps.

Parameters
context The context
indexes The indexes of custom rubber stamps to be removed. The indexes shouldn't contain repeated items and are supposed to be in ascending order.

public static synchronized void updateCustomStamp (Context context, int index, CustomStampOption customStampOption, Bitmap bitmap)

Updates an existing saved custom rubber stamp.

Parameters
context The context
index The zero-indexed position
customStampOption The updated custom rubber stamp
bitmap The generated bitmap which can be reloaded later to avoid recreating the bitmap

public void updateDateTime ()

Updates the second line text since date/time could have be changed.