public static class

StampPickerItem.Builder

extends Object
java.lang.Object
   ↳ com.pspdfkit.annotations.stamps.StampPickerItem.Builder

Class Overview

Builder for creating custom stamps from PredefinedStampType or custom String stamp type.

Summary

Public Methods
StampPickerItem build()
Build stamp item that can be used in setAvailableStampPickerItems(List).
StampPickerItem.Builder withAppearanceStreamGenerator(AppearanceStreamGenerator appearanceStreamGenerator)
Sets appearance stream generator that replaces default stamp appearance.
StampPickerItem.Builder withDateTimeSubtitle(boolean addDate, boolean addTime)
Method for conveniently setting stamp subtitle to date, time or date-time string.
StampPickerItem.Builder withSize(float pdfWidth, float pdfHeight)
Sets default stamp width and height in pdf points.
StampPickerItem.Builder withSize(float pdfSize)
Sets default stamp size in pdf points.
StampPickerItem.Builder withSubtitle(String subtitle)
Sets text displayed in second line of the stamp.
StampPickerItem.Builder withTextColor(Integer textColor)
Sets text color of the stamp.
StampPickerItem.Builder withTitle(String title)
Sets custom text that replaces the default stamp text.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public StampPickerItem build ()

Build stamp item that can be used in setAvailableStampPickerItems(List).

public StampPickerItem.Builder withAppearanceStreamGenerator (AppearanceStreamGenerator appearanceStreamGenerator)

Sets appearance stream generator that replaces default stamp appearance.

Parameters
appearanceStreamGenerator Generator for appearance stream that should replace stamp's default appearance. Generator is expected to be Parcelable or an exception will be thrown.

public StampPickerItem.Builder withDateTimeSubtitle (boolean addDate, boolean addTime)

Method for conveniently setting stamp subtitle to date, time or date-time string.

This method uses localized date-time formats DateFormat#getDateFormat(Context) and DateFormat#getTimeFormat(Context). If both addDate and addTime flags are enabled created date-time string uses above formats separated by ", ".

If you want further control over stamp subtitle use withSubtitle(String) to set any string as stamp subtitle.

Parameters
addDate Add date portion to date-time string.
addTime Add time portion to date-time string.

public StampPickerItem.Builder withSize (float pdfWidth, float pdfHeight)

Sets default stamp width and height in pdf points.

Parameters
pdfWidth Required stamp width in pdf points.
pdfHeight Required stamp height in pdf points.

public StampPickerItem.Builder withSize (float pdfSize)

Sets default stamp size in pdf points. This is equivalent to calling withSize(float, float) with the same width and height parameters.

Parameters
pdfSize Required stamp width and height in pdf points.

public StampPickerItem.Builder withSubtitle (String subtitle)

Sets text displayed in second line of the stamp.

Parameters
subtitle Text displayed in second line of the stamp or null if second line should not be displayed.
See Also

public StampPickerItem.Builder withTextColor (Integer textColor)

Sets text color of the stamp. Stamp's background color is calculated from this color to ensure that stamp text is visible.

Parameters
textColor Text color used for stamps title and subtitle.

public StampPickerItem.Builder withTitle (String title)

Sets custom text that replaces the default stamp text.

Parameters
title Title or null to clear title to display default stamp text.
See Also