public class

ToolManagerBuilder

extends Object
implements Parcelable
java.lang.Object
   ↳ com.pdftron.pdf.config.ToolManagerBuilder

Class Overview

ToolManagerBuilder is a helper for constructing ToolManager with xml configuration and set ToolManager to PDFViewCtrl

For example, you can initialize ToolManager as following:

  ToolManager toolManager = ToolManagerBuilder
      .from()
      .build(getActivity(), mPDFViewCtrl);
 
where mPDFViewCtrl is an instance of PDFViewCtrl

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<ToolManagerBuilder> CREATOR
Public Methods
ToolManagerBuilder addCustomizedTool(ToolManager.ToolModeBase toolMode, Class<? extends Tool> toolClass)
Add customized tool
ToolManagerBuilder addCustomizedTool(Tool tool, Object... params)
Add customized tool
ToolManagerBuilder addCustomizedTool(ToolManager.ToolModeBase toolMode, Class<? extends Tool> toolClass, Object... params)
Add customized tool
ToolManagerBuilder addCustomizedTool(Tool tool)
Add customized tool
ToolManager build(PdfViewCtrlTabFragment fragment)
Building tool manager by given PdfViewCtrlTabFragment and sets fragment listener
ToolManager build(FragmentActivity activity, PDFViewCtrl pdfViewCtrl)
Building tool manager by given PDFViewCtrl
int describeContents()
ToolManagerBuilder disableAnnotEditing(int[] annotTypes)
Disable editing by annot type in tool manager
ToolManagerBuilder disableToolModes(ToolMode[] toolModes)
Disable tool modes in tool manager
static ToolManagerBuilder from(Context context, int styleRes)
Creates a new ToolManagerBuilder for constructing ToolManager.
static ToolManagerBuilder from()
Creates a new ToolManagerBuilder for constructing ToolManager.
ToolManagerBuilder setAddImage(boolean addImage)
Sets whether user can add stamper image
ToolManagerBuilder setAnnotPermission(boolean annotPermission)
Sets whether to check annotation author permission
ToolManagerBuilder setAnnotToolbarPrecedence(ToolMode[] toolModes)
An array that determines which tool icon should show when space is limited (portrait mode on small devices when collapsed)
ToolManagerBuilder setAnnotationLayerEnabled(boolean annotationLayerEnabled)
Sets whether to enable annotation layer
ToolManagerBuilder setAutoResizeFreeText(boolean autoResizeFreeText)
Sets whether can auto resize free text when editing
ToolManagerBuilder setAutoSelect(boolean autoSelect)
Sets whether auto select annotation after annotation is created
ToolManagerBuilder setBuildInPageIndicator(boolean buildInPageIndicator)
Indicates whether to use/show the built-in page number indicator.
ToolManagerBuilder setCopyAnnot(boolean copyAnnot)
Sets whether to copy annotated text to note
ToolManagerBuilder setDigitalSignatureKeystorePassword(String digitalSignatureKeystorePassword)
Sets the digital signature keystore password
ToolManagerBuilder setDigitalSignatureKeystorePath(String digitalSignatureKeystorePath)
Sets the digital signature keystore file path
ToolManagerBuilder setDisableEditingAnnotTypesId(int disableEditingAnnotId)
Sets disabled editing annot type reference int id
ToolManagerBuilder setDisableQuickMenu(boolean disableQuickMenu)
Sets whether disable showing the long press quick menu
ToolManagerBuilder setDisableToolModesId(int disableToolModesId)
Sets disabled tool modes reference array id
ToolManagerBuilder setDoubleTapToZoom(boolean doubleTapToZoom)
Sets whether can double tap to zoom, true by default
ToolManagerBuilder setEditFreeTextOnTap(boolean editFreeTextOnTap)
Sets whether can edit freetext annotation on tap
ToolManagerBuilder setEditInk(boolean editInk)
Sets whether user can edit ink annotation
ToolManagerBuilder setEraserType(Eraser.EraserType type)
Sets the eraser type.
ToolManagerBuilder setInkSmoothing(boolean inkSmoothing)
Sets whether to smooth ink annotation
ToolManagerBuilder setOpenToolbar(boolean openToolbar)
Sets whether ink tool will open annotation toolbar
ToolManagerBuilder setRealTimeAnnotEdit(boolean realTimeAnnotEdit)
Sets whether annotation editing is real time
ToolManagerBuilder setSelectionBoxMargin(int selectionBoxMargin)
Sets the margin between annotation bounding box and selection box.
ToolManagerBuilder setShowAnnotIndicator(boolean showAnnotIndicator)
Sets whether can show indicator for annotations with comments
ToolManagerBuilder setShowAuthor(boolean showAuthor)
ets whether to show author dialog the first time when user annotates.
ToolManagerBuilder setShowSavedSignatures(boolean showSavedSignatures)
Sets whether can show saved signature in signature dialog
ToolManagerBuilder setShowSignatureFromImage(boolean showSignatureFromImage)
Sets whether can show pick from image in signature dialog
ToolManagerBuilder setShowUndoRedo(boolean showUndoRedo)
Sets whether to show undo/redo buttons in the toolbar.
ToolManagerBuilder setStyle(Context context, int styleRes)
Sets configuration to tool manager
ToolManagerBuilder setStylusAsPen(boolean stylusAsPen)
Sets whether to use stylus to draw without entering ink tool
ToolManagerBuilder setTextMarkupAdobeHack(boolean textMarkupAdobeHack)
Sets whether the TextMarkup annotations are compatible with Adobe (Adobe's quads don't follow the specification, but they don't handle quads that do).
ToolManagerBuilder setUseDigitalSignature(boolean useDigitalSignature)
Sets whether to use digital signature instead of signature
ToolManagerBuilder setUsePressureSensitiveSignatures(boolean usePressureSensitiveSignatures)
Sets whether to use pressure sensitivity on styluses for signatures.
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<ToolManagerBuilder> CREATOR

Public Methods

public ToolManagerBuilder addCustomizedTool (ToolManager.ToolModeBase toolMode, Class<? extends Tool> toolClass)

Add customized tool

Parameters
toolMode The customized tool mode
toolClass The customized tool mode class
Returns
  • ToolManagerBuilder

public ToolManagerBuilder addCustomizedTool (Tool tool, Object... params)

Add customized tool

Parameters
tool customized tool.
params parameter for instantiate tool
Returns
  • ToolManagerBuilder

public ToolManagerBuilder addCustomizedTool (ToolManager.ToolModeBase toolMode, Class<? extends Tool> toolClass, Object... params)

Add customized tool

Parameters
toolMode customized tool mode.
toolClass The customized tool mode class
params parameter for instantiate tool
Returns
  • ToolManagerBuilder

public ToolManagerBuilder addCustomizedTool (Tool tool)

Add customized tool

Parameters
tool The customized tool
Returns
  • ToolManagerBuilder

public ToolManager build (PdfViewCtrlTabFragment fragment)

Building tool manager by given PdfViewCtrlTabFragment and sets fragment listener

Parameters
fragment The PdfViewCtrlTabFragment
Returns
  • tool manager

public ToolManager build (FragmentActivity activity, PDFViewCtrl pdfViewCtrl)

Building tool manager by given PDFViewCtrl

Parameters
pdfViewCtrl The pdfviewCtrl
Returns
  • tool manager

public int describeContents ()

public ToolManagerBuilder disableAnnotEditing (int[] annotTypes)

Disable editing by annot type in tool manager

Parameters
annotTypes disabled editing of annot types
Returns
  • ToolManagerBuilder

public ToolManagerBuilder disableToolModes (ToolMode[] toolModes)

Disable tool modes in tool manager

Parameters
toolModes disabled tool modes
Returns
  • ToolManagerBuilder

public static ToolManagerBuilder from (Context context, int styleRes)

Creates a new ToolManagerBuilder for constructing ToolManager.

Parameters
context The context
styleRes style resource that contains tool manager configuration
Returns
  • a new ToolManagerBuilder instance

public static ToolManagerBuilder from ()

Creates a new ToolManagerBuilder for constructing ToolManager.

Returns
  • a new ToolManagerBuilder instance

public ToolManagerBuilder setAddImage (boolean addImage)

Sets whether user can add stamper image

Parameters
addImage true then able to add image, false other wise
Returns
  • ToolManagerBuilder

public ToolManagerBuilder setAnnotPermission (boolean annotPermission)

Sets whether to check annotation author permission

Parameters
annotPermission if true, annotation created by user A cannot be modified by user B, else anyone can modify any annotation

public ToolManagerBuilder setAnnotToolbarPrecedence (ToolMode[] toolModes)

An array that determines which tool icon should show when space is limited (portrait mode on small devices when collapsed)

Parameters
toolModes the tool modes in the order of importance
Returns
  • ToolManagerBuilder

public ToolManagerBuilder setAnnotationLayerEnabled (boolean annotationLayerEnabled)

Sets whether to enable annotation layer

Parameters
annotationLayerEnabled true if annotation layer is enabled, false otherwise

public ToolManagerBuilder setAutoResizeFreeText (boolean autoResizeFreeText)

Sets whether can auto resize free text when editing

Parameters
autoResizeFreeText if true can auto resize, false otherwise

public ToolManagerBuilder setAutoSelect (boolean autoSelect)

Sets whether auto select annotation after annotation is created

Parameters
autoSelect if true, after creating annotation, it will auto select it and show quick menu

public ToolManagerBuilder setBuildInPageIndicator (boolean buildInPageIndicator)

Indicates whether to use/show the built-in page number indicator.

Parameters
buildInPageIndicator true to show the built-in page number indicator, false otherwise.

public ToolManagerBuilder setCopyAnnot (boolean copyAnnot)

Sets whether to copy annotated text to note

Parameters
copyAnnot enable copy annotated text to note

public ToolManagerBuilder setDigitalSignatureKeystorePassword (String digitalSignatureKeystorePassword)

Sets the digital signature keystore password

Parameters
digitalSignatureKeystorePassword the keystore password

public ToolManagerBuilder setDigitalSignatureKeystorePath (String digitalSignatureKeystorePath)

Sets the digital signature keystore file path

Parameters
digitalSignatureKeystorePath the keystore file path

public ToolManagerBuilder setDisableEditingAnnotTypesId (int disableEditingAnnotId)

Sets disabled editing annot type reference int id

Parameters
disableEditingAnnotId disabled editing of annotation type int array id
Returns
  • ToolManagerBuilder

public ToolManagerBuilder setDisableQuickMenu (boolean disableQuickMenu)

Sets whether disable showing the long press quick menu

Parameters
disableQuickMenu if true, disable showing the long press quick menu

public ToolManagerBuilder setDisableToolModesId (int disableToolModesId)

Sets disabled tool modes reference array id

Parameters
disableToolModesId disabled tool modes string array id
Returns
  • ToolManagerBuilder

public ToolManagerBuilder setDoubleTapToZoom (boolean doubleTapToZoom)

Sets whether can double tap to zoom, true by default

Parameters
doubleTapToZoom if true, can double tap to zoom, false otherwise

public ToolManagerBuilder setEditFreeTextOnTap (boolean editFreeTextOnTap)

Sets whether can edit freetext annotation on tap

Parameters
editFreeTextOnTap true if tap will start edit freetext, false otherwise

public ToolManagerBuilder setEditInk (boolean editInk)

Sets whether user can edit ink annotation

Parameters
editInk true then able to edit ink, false other wise
Returns
  • ToolManagerBuilder

public ToolManagerBuilder setEraserType (Eraser.EraserType type)

Sets the eraser type.

Parameters
type the Eraser.EraserType for eraser tool Default to HYBRID_ERASER

public ToolManagerBuilder setInkSmoothing (boolean inkSmoothing)

Sets whether to smooth ink annotation

Parameters
inkSmoothing enable ink smoothing

public ToolManagerBuilder setOpenToolbar (boolean openToolbar)

Sets whether ink tool will open annotation toolbar

Parameters
openToolbar if true, click ink from quick menu will open the annotation toolbar in ink mode, false otherwise
Returns
  • ToolManagerBuilder

public ToolManagerBuilder setRealTimeAnnotEdit (boolean realTimeAnnotEdit)

Sets whether annotation editing is real time

Parameters
realTimeAnnotEdit true if real time, false otherwise

public ToolManagerBuilder setSelectionBoxMargin (int selectionBoxMargin)

Sets the margin between annotation bounding box and selection box.

Parameters
selectionBoxMargin margin value in DP, default to 16dp.

public ToolManagerBuilder setShowAnnotIndicator (boolean showAnnotIndicator)

Sets whether can show indicator for annotations with comments

Parameters
showAnnotIndicator true if show indicator, false otherwise

public ToolManagerBuilder setShowAuthor (boolean showAuthor)

ets whether to show author dialog the first time when user annotates.

Parameters
showAuthor if true, show author dialog the first time when user annotates

public ToolManagerBuilder setShowSavedSignatures (boolean showSavedSignatures)

Sets whether can show saved signature in signature dialog

Parameters
showSavedSignatures true if saved signature will show in signature dialog, false otherwise

public ToolManagerBuilder setShowSignatureFromImage (boolean showSignatureFromImage)

Sets whether can show pick from image in signature dialog

Parameters
showSignatureFromImage true if pick from image icon will show in signature dialog, false otherwise

public ToolManagerBuilder setShowUndoRedo (boolean showUndoRedo)

Sets whether to show undo/redo buttons in the toolbar.

Parameters
showUndoRedo true if showing undo/redo buttons in the toolbar.

public ToolManagerBuilder setStyle (Context context, int styleRes)

Sets configuration to tool manager

Parameters
styleRes style resource that contains tool manager configuration
Returns
  • ToolManagerBuilder instance

public ToolManagerBuilder setStylusAsPen (boolean stylusAsPen)

Sets whether to use stylus to draw without entering ink tool

Parameters
stylusAsPen enable inking with stylus in pan mode

public ToolManagerBuilder setTextMarkupAdobeHack (boolean textMarkupAdobeHack)

Sets whether the TextMarkup annotations are compatible with Adobe (Adobe's quads don't follow the specification, but they don't handle quads that do).

public ToolManagerBuilder setUseDigitalSignature (boolean useDigitalSignature)

Sets whether to use digital signature instead of signature

Parameters
useDigitalSignature true if using digital signature instead of signature, false otherwise. Default to false.

public ToolManagerBuilder setUsePressureSensitiveSignatures (boolean usePressureSensitiveSignatures)

Sets whether to use pressure sensitivity on styluses for signatures.

Parameters
usePressureSensitiveSignatures true if using pressure sensitivity for signatures.

public void writeToParcel (Parcel dest, int flags)