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 addAnnotStyleProperty(AnnotStyleProperty annotStyleProperty)
Add an AnnotStyleProperty used to hide annotation style properties in the annotation style dialog.
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(ToolManager.ToolModeBase toolMode, Class<? extends Tool> toolClass)
Add customized tool
ToolManagerBuilder addCustomizedTool(Tool tool)
Add customized tool
ToolManager build(PdfViewCtrlTabBaseFragment fragment)
Building tool manager by given PdfViewCtrlTabFragment2 or PdfViewCtrlTabFragment2 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
ToolManagerBuilder freeTextInlineToggleEnabled(boolean freeTextInlineToggleEnabled)
Sets whether to show the FreeText inline toggle button
static ToolManagerBuilder from()
Creates a new ToolManagerBuilder for constructing ToolManager.
static ToolManagerBuilder from(Context context, int styleRes)
Creates a new ToolManagerBuilder for constructing ToolManager.
Set<ToolManager.ToolMode> getDisabledToolModes(Context context)
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.
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 setMultiSelectMode(AnnotEditRectGroup.SelectionMode mode)
Sets the multi-select mode.
ToolManagerBuilder setOpenToolbar(boolean openToolbar)
Sets whether ink tool will open annotation toolbar
ToolManagerBuilder setPdfContentEditingEnabled(boolean pdfContentEditingEnabled)
Sets whether to show option to edit original PDF content.
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 setShowRichContentOption(boolean showRichContentOption)
Sets whether to show rich content switch for FreeText.
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 addAnnotStyleProperty (AnnotStyleProperty annotStyleProperty)

Add an AnnotStyleProperty used to hide annotation style properties in the annotation style dialog.

Parameters
annotStyleProperty the AnnotStyleProperty used to hide annotation style properties

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 (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)

Add customized tool

Parameters
tool The customized tool
Returns
  • ToolManagerBuilder

public ToolManager build (PdfViewCtrlTabBaseFragment fragment)

Building tool manager by given PdfViewCtrlTabFragment2 or PdfViewCtrlTabFragment2 and sets fragment listener

Parameters
fragment The PdfViewCtrlTabFragment2
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 ToolManagerBuilder freeTextInlineToggleEnabled (boolean freeTextInlineToggleEnabled)

Sets whether to show the FreeText inline toggle button

Parameters
freeTextInlineToggleEnabled true showing the FreeText inline toggle button. Default to true.

public static ToolManagerBuilder from ()

Creates a new ToolManagerBuilder for constructing ToolManager.

Returns
  • a new ToolManagerBuilder instance

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 Set<ToolManager.ToolMode> getDisabledToolModes (Context context)

public ToolManagerBuilder setAddImage (boolean addImage)

Sets whether user can add stamper image

Parameters
addImage true then able to add image, false other wise. Default to true.
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. Default to false.

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. Default to false.

public ToolManagerBuilder setAutoResizeFreeText (boolean autoResizeFreeText)

Sets whether can auto resize free text when editing

Parameters
autoResizeFreeText if true can auto resize, false otherwise. Default to false.

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. Default to true.

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. Default to false.

public ToolManagerBuilder setCopyAnnot (boolean copyAnnot)

Sets whether to copy annotated text to note. Default to true.

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. Default to false.

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. Default to true.

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. Default to false.

public ToolManagerBuilder setEditInk (boolean editInk)

Sets whether user can edit ink annotation

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

public ToolManagerBuilder setEraserType (Eraser.EraserType type)

Sets the eraser type.

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

public ToolManagerBuilder setInkSmoothing (boolean inkSmoothing)

Sets whether to smooth ink annotation. Default to true.

Parameters
inkSmoothing enable ink smoothing

public ToolManagerBuilder setMultiSelectMode (AnnotEditRectGroup.SelectionMode mode)

Sets the multi-select mode.

Parameters
mode the AnnotEditRectGroup.SelectionMode for multi-select tool Default to RECTANGULAR

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. Default to true.
Returns
  • ToolManagerBuilder

public ToolManagerBuilder setPdfContentEditingEnabled (boolean pdfContentEditingEnabled)

Sets whether to show option to edit original PDF content.

Parameters
pdfContentEditingEnabled true if show option to edit original PDF content. Default to false.

public ToolManagerBuilder setRealTimeAnnotEdit (boolean realTimeAnnotEdit)

Sets whether annotation editing is real time

Parameters
realTimeAnnotEdit true if real time, false otherwise. Default to true.

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. Default to false.

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. Default to false.

public ToolManagerBuilder setShowRichContentOption (boolean showRichContentOption)

Sets whether to show rich content switch for FreeText. This API only takes effect for Lollipop+.

Parameters
showRichContentOption true show rich content switch for FreeText. Default to true.

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. Default to true.

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. Default to true.

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. Default to true.

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. Default to false.

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). Default to true.

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. Default to true.

public void writeToParcel (Parcel dest, int flags)