public class

ToolManager

extends Object
implements PDFViewCtrl.ActionCompletedListener PDFViewCtrl.ToolManager
java.lang.Object
   ↳ com.pdftron.pdf.tools.ToolManager

Class Overview

This class implements the PDFViewCtrl.ToolManager interface. The ToolManager interface is basically a listener for the several different events triggered by PDFViewCtrl, including gesture, layout and custom events.

The Tool interface defined in this class is used to propagate these events to the different tools, so making it possible to control which actions to execute upon such events. Each concrete Tool implementation decides which is the next tool, and the ToolManager uses the getNextToolMode() to check if it must stop the event loop or create a new tool and continue to propagate the event.

For example, the code for onDown(MotionEvent) is as below:

 if (mTool != null) {
     ToolMode prev_tm = mTool.getAnnotType(), next_tm;
     do {
         mTool.onDown(e);
         next_tm = mTool.getNextToolMode();
         if (prev_tm != next_tm) {
             setTool(createTool(next_tm, mTool));
             prev_tm = next_tm;
         } else {
             break;
         }
     } while (true);
 }
 

With this being said, a Tool implementation should prevent forming tools in a cyclic way.

Summary

Nested Classes
interface ToolManager.ActionGoBackListener  
interface ToolManager.AdvancedAnnotationListener This interface can be used to monitor advanced annotation events from various tools. 
enum ToolManager.AnnotAction  
interface ToolManager.AnnotationModificationListener This interface can be used to monitor annotation modification events such as added/edited/removed. 
interface ToolManager.AnnotationPermissionListener Callback for annotation permissions  
interface ToolManager.AnnotationToolbarListener This interface can be used to monitor tools interaction with annotation toolbar  
interface ToolManager.AnnotationsSelectionListener This interface can be used to monitor annotation selection changed event. 
interface ToolManager.BasicAnnotationListener This interface can be used to monitor basic annotation events such as selected/unselected. 
interface ToolManager.DialogListener This interface can be used to intercept dialog events. 
interface ToolManager.EdgeEffectListener This interface can be used to listen to viewer edge effect events  
interface ToolManager.ExternalAnnotationManagerListener This interface can be used to provide custom key for annotation creation  
interface ToolManager.FileAttachmentAnnotationListener  
interface ToolManager.FullSaveListener Callback to notify subscribers that a full PDF save is required  
interface ToolManager.OnGenericMotionEventListener This interface can be used to monitor generic motion event  
interface ToolManager.OnLayoutListener This interface can be used to listen for when the PDFViewCtrl's onLayout() is triggered. 
interface ToolManager.PdfDocModificationListener This interface can be used to monitor any modification events that change the structure of the PDF document such as page manipulation, bookmark modification, etc. 
interface ToolManager.PdfOutlineModificationListener  
interface ToolManager.PdfTextModificationListener This interface can be used to monitor PDF text modification events  
interface ToolManager.PreFlingListener  
interface ToolManager.PreToolManagerListener This interface can be used to avoid executing Tool's code in the ToolManager implementation (the events will be called before Tool's ones). 
interface ToolManager.PresetsListener  
interface ToolManager.QuickMenuListener This interface can be used to detect if the built-in Tools quick menu item has been clicked. 
interface ToolManager.SnackbarListener  
interface ToolManager.SpecialAnnotationListener  
interface ToolManager.StampDialogListener  
interface ToolManager.Tool This interface is used to forward events from PDFViewCtrl.ToolManager to the actual implementation of the Tool. 
interface ToolManager.ToolChangedListener This interface can be used to listen for when the current tool changes. 
interface ToolManager.ToolManagerChangedListener Listener called when the ToolManager has changed. 
enum ToolManager.ToolMode Tool modes  
interface ToolManager.ToolModeBase Base tool mode  
interface ToolManager.ToolSetListener This interface can be used to listen for when a new tool is set as current tool of ToolManager. 
Public Constructors
ToolManager(PDFViewCtrl pdfViewCtrl)
Class constructor.
Public Methods
void addActionGoBackListener(ToolManager.ActionGoBackListener listener)
void addAnnotStyleProperty(AnnotStyleProperty annotStyleProperty)
Add an AnnotStyleProperty used to hide annotation style properties in the annotation style dialog.
void addAnnotationModificationListener(ToolManager.AnnotationModificationListener listener)
void addAnnotationsSelectionListener(ToolManager.AnnotationsSelectionListener listener)
void addCustomizedTool(HashMap<ToolManager.ToolModeBase, Class<? extends Tool>> toolClassMap)
Add a custom tool to tool class map
void addCustomizedTool(Tool tool, Object... params)
Add a custom tool to tool class map
void addCustomizedTool(Tool tool)
Add a custom tool to tool class map
void addCustomizedToolParams(HashMap<ToolManager.ToolModeBase, Object[]> toolParamMap)
Add a custom tool to tool class map
void addDialogListener(ToolManager.DialogListener listener)
void addFullSaveListener(ToolManager.FullSaveListener listener)
void addOnLayoutListener(ToolManager.OnLayoutListener listener)
void addPdfDocModificationListener(ToolManager.PdfDocModificationListener listener)
void addPdfOutlineModificationListener(ToolManager.PdfOutlineModificationListener listener)
void addPdfTextModificationListener(ToolManager.PdfTextModificationListener listener)
void addToolChangedListener(ToolManager.ToolChangedListener listener)
void addToolCreatedListener(ToolManager.ToolChangedListener listener)
Adds the ToolManager.ToolChangedListener called when tool created.
void addToolManagerChangedListener(ToolManager.ToolManagerChangedListener listener)
void addToolSetListener(ToolManager.ToolSetListener listener)
void annotationCouldNotBeAdded(String errorMessage)
Lets various tools raise the annotation could not be add event from a unified location.
void backToDefaultTool()
Used to force the next tool to be the default tool if previously set
boolean canResumePdfDocWithoutReloading()
Pan createDefaultTool()
Creates the default tool (Pan tool).
ToolManager.Tool createTool(ToolManager.ToolModeBase newTool, ToolManager.Tool currentTool, Bundle bundle, boolean force)
ToolManager.Tool createTool(ToolManager.ToolModeBase newTool, ToolManager.Tool currentTool, boolean showPreset)
Creates the specified tool and copies the necessary info from the previous tool if provided.
ToolManager.Tool createTool(ToolManager.ToolModeBase newTool, ToolManager.Tool currentTool)
Creates the specified tool and copies the necessary info from the previous tool if provided.
ToolManager.Tool createTool(ToolManager.ToolModeBase newTool, ToolManager.Tool currentTool, Bundle bundle)
Creates the specified tool and copies the necessary info from the previous tool if provided.
void deselectAll()
Deselects all annotations
void destroy()
Cleans up resources.
void disableAnnotEditing(Integer[] annotTypes)
Disables annotation editing by type.
void disableToolMode(ToolMode[] toolModes)
Disables tool modes.
void disableUpdateModifyDateAnnotTypes(int[] disabledAnnotTypes)
void disableUpdateModifyDateFieldTypes(int[] disabledFieldTypes)
boolean editInkAnnots()
Gets whether editing ink annotation should open the annotation toolbar
void enableAnnotEditing(Integer[] annotTypes)
Enables annotation editing by type.
void enableAnnotManager(String userId)
Enables annotation manager for annotation syncing
void enableAnnotManager(String userId, String userName, PDFViewCtrl.AnnotationManagerMode undoMode, AnnotManager.EditPermissionMode editMode, AnnotManager.AnnotationSyncingListener listener)
Enables annotation manager for annotation syncing
void enableAnnotManager(String userId, String userName, AnnotManager.AnnotationSyncingListener listener)
Enables annotation manager for annotation syncing
void enableAnnotManager(String userId, AnnotManager.AnnotationSyncingListener listener)
Enables annotation manager for annotation syncing
void enableAnnotationLayer()
Enable separate rendering layer for annotations.
void enableToolMode(ToolMode[] toolModes)
Enables tool modes.
void freeTextInlineToggleEnabled(boolean freeTextInlineToggleEnabled)
Sets whether to show the FreeText inline toggle button
String generateKey()
AnnotManager getAnnotManager()
AnnotSnappingManager getAnnotSnappingManager()
Returns the class associated with calculating and storing annotation snapping.
HashMap<Integer, AnnotStyleProperty> getAnnotStyleProperties()
Returns list of AnnotStyleProperty used to hide elements of the AnnotStyleDialgFragment
ArrayList<ToolManager.ToolMode> getAnnotToolbarPrecedence()
Gets the precedence of tool mode in Annotation Toolbar
Annot getAnnotationAt(int x, int y)
Gets the annotation at the (x, y) position expressed in screen coordinates.
ToolManager.AnnotationPermissionListener getAnnotationPermissionListener()
int getAnnotationToolbarHeight()
Gets the annotation toolbar height
String getAuthorId()
Gets the user ID used for checking whether an annotation is created by current user.
String getAuthorName()
Gets the user ID used for checking whether an annotation is created by current user.
String getCacheFileName()
FragmentActivity getCurrentActivity()
Get the activity to which the ToolManager is currently attached, or null if not attached.
boolean getDefaultStoreNewSignature()
Gets whether "Store signature" setting in the CreateSignatureFragment dialog should be enabled or disabled by default.
static ToolManager.ToolMode getDefaultToolMode(ToolManager.ToolModeBase toolModeBase)
static ToolManager.ToolModeBase getDefaultToolModeBase(ToolManager.ToolModeBase toolModeBase)
String getDigitalSignatureKeystore()
Gets digital signature keystore file path
String getDigitalSignatureKeystorePassword()
Gets digital signature keystore password
Set<ToolManager.ToolMode> getDisabledToolModes()
ToolManager.EdgeEffectListener getEdgeEffectListener()
Eraser.EraserType getEraserType()
Gets the type of eraser.
float getFreeHighlighterAutoSmoothingRange()
Gets how wide the range would be for auto smoothing vertical and horizontal strokes, in pixel.
String getFreeTextCacheFileName()
Set<String> getFreeTextFonts()
Gets the list of free text fonts to have as options in the properties popup (Gets whiteList fonts among the PDFNet system fonts)
Set<String> getFreeTextFontsFromAssets()
Gets custom font list from Assets for free text tool
Set<String> getFreeTextFontsFromStorage()
Gets custom font list from Storage for free text tool
int getFreeTextToggleButtonColorInt()
ToolManager.AnnotAction getLastAnnotAction()
AnnotEditRectGroup.SelectionMode getMultiSelectMode()
Gets the mode of multi-select tool.
ArrayList<ToolManager.Tool> getOldTools()
OnAnnotStyleChangedListener getOnStyleChangedListener()
PDFViewCtrl getPDFViewCtrl()
ToolManager.PresetsListener getPresetsListener()
RedactionManager getRedactionManager()
String getSelectedAnnotId()
Gets the identification of the selected annotation
int getSelectedAnnotPageNum()
Gets the page number of selected annotation
int getSelectionBoxMargin()
Gets the margin between selection box and annotation bounding box
int[] getSignatureColors()
Returns the colors used for signing.
ToolManager.SnackbarListener getSnackbarListener()
SnapUtils getSnapUtils()
Returns the class associated with handling drawing and calculating snapping modes.
int getSnappingModes()
Gets snapping modes for measurement tools
SoundManager getSoundManager()
ToolManager.StampDialogListener getStampDialogListener()
boolean getStickyNoteShowPopup()
Gets whether shows stick note pop up dialog
TextToSpeech getTTS()
Gets the Text To Speech object
int getTapToCreateShapeHalfWidth()
Gets the half width for tap to create shapes
int getTheme()
ToolManager.Tool getTool()
Gets the current ToolManager.Tool instance.
int getToolbarHeight()
Gets the toolbar height
UndoRedoManager getUndoRedoManger()
Gets the undo redo manager
Set<Integer> getUpdateModifyDateDisabledAnnotTypes()
Set<Integer> getUpdateModifyDateDisabledFieldTypes()
boolean hasAnnotToolbarPrecedence()
Gets whether precedence is set in Annotation Toolbar
boolean hasCurrentActivity()
Whether ToolManager is currently attached with an activity
void hideBuiltInPageNumber()
Hide built in page number indicator
void initTTS()
Initialize system Text To Speech
boolean isAnnotEditingDisabled(int annotType)
Checks whether the editing of an annot type is disabled.
boolean isAnnotPermissionCheckEnabled()
Gets whether annotation author permission is enabled
boolean isAutoResizeFreeText()
Gets whether can auto resize free text when editing
boolean isAutoSelectAnnotation()
Gets auto select annotation after annotation is created
boolean isBuiltInPageNumberIndicatorVisible()
Indicates whether to use/show the built-in page number indicator.
boolean isCopyAnnotatedTextToNoteEnabled()
Gets whether to copy annotated text to note
boolean isCreatingAnnotation()
The overload implementation of isCreatingAnnotation().
boolean isDeleteEmptyFreeText()
Gets whether can delete FreeText if empty content was entered
boolean isDoubleTapToZoom()
Gets whether can double tap to zoom
boolean isEditFreeTextOnTap()
Gets whether can edit FreeText on tap
boolean isFreehandTimerEnabled()
Gets whether free hand annotations are saved on a timer basis.
boolean isInkMultiStrokeEnabled()
Gets whether multi-stroke is enabled for ink tool
boolean isInkSmoothingEnabled()
Gets whether to smooth ink annotation
boolean isInsertMultipleImagesEnabled()
Gets whether image stamp tool can insert multiple images.
boolean isLoupeEnabled()
Gets whether loupe is enabled or not on text markup annotation
boolean isMoveAnnotationBetweenPages()
Gets whether moving annotations between pages is enabled
boolean isNightMode()
Gets whether night mode is enabled for tools
boolean isOpenEditToolbarFromPan()
Gets whether edit tool will open when tools selected in pan quick menu
boolean isPaused()
Indicates lifecycle onPause
boolean isPdfContentEditingEnabled()
Gets whether to show option to edit original PDF content.
boolean isPersistStoreSignatureSetting()
Gets whether to use the user's last set "Store signature" setting in the CreateSignatureFragment dialog.
boolean isQuickMenuDisabled()
Gets whether the long press quick menu is disabled
boolean isQuickMenuJustClosed()
boolean isReadOnly()
Gets whether the file associated with PDFViewCtrl is read-only.
boolean isRealTimeAnnotEdit()
Gets whether annotation editing is real time
boolean isReflowTextSelectionMenuEnabled()
boolean isRestrictedTapAnnotCreation()
Gets whether to allow tap to create annotations on another type of annotation, for example for free text and sticky note.
boolean isRichContentEnabledForFreeText()
Gets whether rich content is enabled for FreeText tool
boolean isShowAnnotIndicators()
Gets whether annotation indicator is showing for annotations with comments
boolean isShowAuthorDialog()
Gets whether to show author dialog the first time when user annotates.
boolean isShowRichContentOption()
Gets whether to show rich content switch for FreeText tool Note: this will only take effect on Lollipop and up.
boolean isShowRotateHandle()
Gets whether to show rotate handle when annotation selected
boolean isShowSavedSignature()
Gets whether can show saved signature in signature dialog
boolean isShowSignatureFromImage()
Gets whether can show pick signature from image in signature dialog
boolean isShowSignaturePresets()
Gets whether signature presets are shown in the signature dialog
boolean isShowTypedSignature()
Gets whether can show typed signature button in signature dialog
boolean isShowUndoRedo()
Gets whether the viewer show undo/redo buttons in the toolbar.
boolean isSkipNextTapEvent()
boolean isSnappingEnabledForMeasurementTools()
Gets whether snapping is enabled for measurement tools
boolean isStylusAsPen()
Gets whether to use stylus to draw without entering ink tool
boolean isTextFieldCustomAppearanceEnabled()
boolean isTextMarkupAdobeHack()
Gets whether the TextMarkup annotations are compatible with Adobe (Adobe's quads don't follow the specification, but they don't handle quads that do).
boolean isToolModeDisabled(ToolManager.ToolMode toolMode)
Checks whether the specified tool mode is disabled.
boolean isUsingDigitalSignature()
Gets whether can use digital signature for signature widget
boolean isUsingPressureSensitiveSignatures()
Gets whether the viewer will use pressure sensitivity for signatures
boolean isfreeTextInlineToggleEnabled()
Gets whether show the FreeText inline toggle button
void onActionCompleted(Action action)
The overload implementation of onActionCompleted(Action).
void onAnnotPainterUpdated(int page, long which, CurvePainter painter)
Called when annotation CurvePainter has been updated.
void onAnnotStyleColorChange(ArrayList<AnnotStyle> styles)
void onAnnotStyleDismiss(AnnotStyleDialogFragment annotStyleDialog)
void onAttachFileSelected(PointF targetPoint)
Pass the file attachment selected event.
void onChangePointerIcon(PointerIcon pointerIcon)
The overload implementation of onChangePointerIcon(PointerIcon).
void onClose()
The overload implementation of onClose().
void onConfigurationChanged(Configuration newConfig)
The overload implementation of onConfigurationChanged(Configuration).
void onControlReady()
The overload implementation of onControlReady().
void onCustomEvent(Object obj)
The overload implementation of onCustomEvent(Object).
void onDestroy()
Called when destroy() is called.
void onDocumentDownloadEvent(PDFViewCtrl.DownloadState mode, int page_num, int page_downloaded, int page_count, String message)
boolean onDoubleTap(MotionEvent e)
The overload implementation of onDoubleTap(MotionEvent).
void onDoubleTapEnd(MotionEvent e)
The overload implementation of onDoubleTapEnd(MotionEvent).
boolean onDoubleTapEvent(MotionEvent e)
The overload implementation of onDoubleTapEvent(MotionEvent).
void onDoubleTapZoomAnimationBegin()
The overload implementation of onDoubleTapZoomAnimationBegin().
void onDoubleTapZoomAnimationEnd()
The overload implementation of onDoubleTapZoomAnimationEnd().
boolean onDown(MotionEvent e)
The overload implementation of onDown(MotionEvent).
void onDraw(Canvas canvas, Matrix tfm)
The overload implementation of onDraw(Canvas, Matrix).
boolean onDrawEdgeEffects(Canvas canvas, int width, int verticalOffset)
The overload implementation of onDrawEdgeEffects(Canvas, int, int).
void onFileAttachmentSelected(FileAttachment fileAttachment)
Lets various tools raise the file attachment selected event.
void onFileCreated(String fileLocation, ToolManager.AdvancedAnnotationListener.AnnotAction action)
Lets various tools raise the onFileCreated event.
boolean onFlingStop()
The overload implementation of onFlingStop().
void onFreehandStylusUsedFirstTime()
Lets various tools raise the freehand stylus used for the first time event.
boolean onGenericMotionEvent(MotionEvent event)
The overload implementation of onGenericMotionEvent(MotionEvent).
void onGoBackSelected()
Goes back to previous page when action is GoBack
void onImageSignatureSelected(PointF targetPoint, int targetPage, Long widget)
Pass the image signature selected event.
void onImageStamperSelected(PointF targetPoint)
Pass the image stamper selected event.
void onInkEditSelected(Annot inkAnnot, int pageNum)
Pass the ink edit selected event.
void onInlineFreeTextEditingStarted()
Pass inline free text editing started event.
boolean onKeyUp(int keyCode, KeyEvent event)
The overload implementation of onKeyUp(int, KeyEvent).
void onLayout(boolean changed, int l, int t, int r, int b)
The overload implementation of onLayout(boolean, int, int, int, int).
boolean onLongPress(MotionEvent e)
The overload implementation of onLongPress(MotionEvent).
boolean onMove(MotionEvent e1, MotionEvent e2, float x_dist, float y_dist)
The overload implementation of onMove(MotionEvent, MotionEvent, float, float).
boolean onNewFileCreated(String filePath, int pageNumber)
Opens a newly created file.
boolean onNewFileCreated(String filePath)
Opens a newly created file.
void onOpenAnnotationToolbar(ToolManager.ToolMode mode)
Called when the annotation toolbar should open for a tool
void onOpenEditToolbar(ToolManager.ToolMode mode)
Called when the edit toolbar should open for a tool
void onPageTurning(int old_page, int cur_page)
The overload implementation of onPageTurning(int, int).
void onPause()
Called when pause() is called.
boolean onPointerDown(MotionEvent e)
The overload implementation of onPointerDown(MotionEvent).
void onPostSingleTapConfirmed()
The overload implementation of onPostSingleTapConfirmed().
void onPullEdgeEffects(int which_edge, float delta_distance)
The overload implementation of onPullEdgeEffects(int, float).
boolean onQuickMenuClicked(QuickMenuItem menuItem)
void onQuickMenuDismissed()
a callback to be invoked when quick menu is dismissed
void onQuickMenuLocationRequested()
void onQuickMenuShown()
a callback to be invoked when quick menu is shown
void onReleaseEdgeEffects()
The overload implementation of onReleaseEdgeEffects().
void onRenderingFinished()
The overload implementation of onRenderingFinished().
void onResume()
Called when resume() is called.
void onSaveFileAttachmentSelected(FileAttachment fileAttachment, Intent intent)
Raise event for file attachment annotation
boolean onScale(float x, float y)
The overload implementation of onScale(float, float).
boolean onScaleBegin(float x, float y)
The overload implementation of onScaleBegin(float, float).
boolean onScaleEnd(float x, float y)
The overload implementation of onScaleEnd(float, float).
void onScrollChanged(int l, int t, int oldl, int oldt)
The overload implementation of onScrollChanged(int, int, int, int).
void onSetDoc()
The overload implementation of onSetDoc().
boolean onShowPress(MotionEvent e)
The overload implementation of onShowPress(MotionEvent).
boolean onShowQuickMenu(QuickMenu quickMenu, Annot annot)
a callback to be invoked when quick menu is about to show
boolean onSingleTapConfirmed(MotionEvent e)
The overload implementation of onSingleTapConfirmed(MotionEvent).
boolean onSingleTapUp(MotionEvent e)
The overload implementation of onSingleTapUp(MotionEvent).
boolean onUp(MotionEvent e, PDFViewCtrl.PriorEventMode priorEventMode)
The overload implementation of onUp(MotionEvent, PDFViewCtrl.PriorEventMode).
void raiseAllAnnotationsRemovedEvent()
Call this function when all annotations in the document have been removed.
void raiseAnnotationActionEvent()
Call this function when an action has taken place that changes the document.
void raiseAnnotationsAddedEvent(Map<Annot, Integer> annots)
Call this function when annotations have been added to the document.
void raiseAnnotationsModifiedEvent(Map<Annot, Integer> annots, Bundle bundle)
Call this function when annotations in the document have been modified.
void raiseAnnotationsPreModifyEvent(Map<Annot, Integer> annots)
Call this function before annotations in the document are modified.
void raiseAnnotationsPreRemoveEvent(Map<Annot, Integer> annots)
Call this function before annotations are removed from the document.
void raiseAnnotationsRemovedEvent(Map<Annot, Integer> annots)
Call this function when annotations have been removed from the document.
void raiseAnnotationsRemovedEvent(int pageNum)
Call this function when all annotations in the specified page have been removed from the document.
void raiseAnnotationsRemovedEvent(Map<Annot, Integer> annots, Bundle bundle)
Call this function when annotations have been removed from the document.
void raiseAnnotationsSelectionChangedEvent(HashMap<Annot, Integer> annots)
Lets various tools raise the annotations selection changed event.
void raiseBookmarkModified(List<UserBookmarkItem> bookmarkItems)
Call this function when document bookmark has been modified.
void raiseFullSaveRequired()
boolean raiseInterceptAnnotationHandlingEvent(Annot annot, Bundle extra, ToolManager.ToolMode toolMode)
Handle annotation
boolean raiseInterceptDialogEvent(AlertDialog dialog)
This method is deprecated. see raiseInterceptDialogFragmentEvent(DialogFragment)
boolean raiseInterceptDialogFragmentEvent(DialogFragment dialogFragment)
Call this function when a dialog fragment is about to show up.
void raisePageLabelChangedEvent()
Call this function when the page labels have changed in this document.
void raisePageMoved(int from, int to)
Call this function when a page in the document have been moved to a new position.
void raisePagesAdded(List<Integer> pageList)
Call this function when new pages have been added to the document.
void raisePagesCropped()
Call this function when pages of the document have been cropped.
void raisePagesDeleted(List<Integer> pageList)
Call this function when pages have been deleted from the document.
void raisePagesMoved(List<Integer> pagesMoved, int toPage, int currentPage)
Call this function when pages in the document have been moved to a new position.
void raisePagesRotated(List<Integer> pageList)
Call this function when pages in the document have been rotated.
void raisePdfOutlineModified()
Call this function when document outline has been modified..
void raisePdfTextModified()
Call this function when document text content has been modified..
void removeActionGoBackListener(ToolManager.ActionGoBackListener listener)
void removeAnnotationModificationListener(ToolManager.AnnotationModificationListener listener)
void removeAnnotationsSelectionListener(ToolManager.AnnotationsSelectionListener listener)
void removeFullSaveListener(ToolManager.FullSaveListener listener)
void removeOnLayoutListener(ToolManager.OnLayoutListener listener)
void removePdfDocModificationListener(ToolManager.PdfDocModificationListener listener)
void removePdfOutlineModificationListener(ToolManager.PdfOutlineModificationListener listener)
void removePdfTextModificationListener(ToolManager.PdfTextModificationListener listener)
void removeToolChangedListener(ToolManager.ToolChangedListener listener)
void removeToolCreatedListener(ToolManager.ToolChangedListener listener)
Removes the ToolManager.ToolChangedListener called when tool created.
void removeToolManagerChangedListener(ToolManager.ToolManagerChangedListener listener)
void removeToolSetListener(ToolManager.ToolSetListener listener)
void reselectAnnot()
Re-selects the last selected annotation
void resetIndicator()
Resets annotation indicators
void resetSkipNextTapEvent()
Resets skipping the next tap event.
Tool safeCreateTool(ToolManager.ToolModeBase mode)
Creates tool safely, if there is any exception, creates default tool
void selectAnnot(Annot annot, int pageNum)
Selects an annotation
void selectAnnot(String annotId, int pageNum)
Selects the annotation.
void setAddImageStamperTool(boolean addImageStamperTool)
Sets whether to enable image stamper tool
void setAdvancedAnnotationListener(ToolManager.AdvancedAnnotationListener listener)
void setAnnotPermissionCheckEnabled(boolean enable)
Sets whether to check annotation author permission
void setAnnotToolbarPrecedence(ToolMode[] toolModes)
Sets an array that determines which tool icon should show when space is limited (portrait mode on small devices when collapsed)
void setAnnotationPermissionListener(ToolManager.AnnotationPermissionListener annotationPermissionListener)
void setAnnotationToolbarListener(ToolManager.AnnotationToolbarListener annotationToolbarListener)
void setAuthorId(String authorId)
Sets the user ID used for checking whether an annotation is created by current user.
void setAuthorName(String authorName)
Sets the user ID used for checking whether an annotation is created by current user.
void setAutoResizeFreeText(boolean autoResizeFreeText)
Sets whether can auto resize free text when editing
void setAutoSelectAnnotation(boolean autoSelect)
Sets whether auto select annotation after annotation is created
void setBasicAnnotationListener(ToolManager.BasicAnnotationListener listener)
void setBuiltInPageNumberIndicatorVisible(boolean visible)
Indicates whether to use/show the built-in page number indicator.
void setCacheFileName(String tag)
Sets the cache file name
void setCanOpenEditToolbarFromPan(boolean canOpenEditToolbarFromPan)
Sets whether edit tool will open when tools selected in pan quick menu
void setCanResumePdfDocWithoutReloading(boolean canResumePdfDocWithoutReloading)
Sets if can resume PDF Doc without reloading.
void setCopyAnnotatedTextToNoteEnabled(boolean enable)
Sets whether to copy annotated text to note
void setCurrentActivity(FragmentActivity activity)
Set the activity to which the ToolManager is currently attached, or null if not attached.
void setDefaultStoreNewSignature(boolean defaultStoreNewSignature)
Sets whether "Store signature" setting in the CreateSignatureFragment dialog should be enabled or disabled by default.
void setDefaultToolCLass(Class<? extends Pan> cLass)
set default tool class
void setDeleteEmptyFreeText(boolean deleteEmptyFreeText)
Sets whether can delete FreeText if empty content was entered
void setDigitalSignatureKeystorePassword(String digitalSignatureKeystore)
Sets digital signature keystore password
void setDigitalSignatureKeystorePath(String digitalSignatureKeystore)
Sets digital signature keystore file path
void setDisableQuickMenu(boolean disabled)
Sets whether disable showing the long press quick menu
void setDoubleTapToZoom(boolean doubleTapToZoom)
Sets whether can double tap to zoom the viewer
void setEdgeEffectListener(ToolManager.EdgeEffectListener edgeEffectListner)
void setEditFreeTextOnTap(boolean editFreeTextOnTap)
Sets whether can edit FreeText on tap
void setEditInkAnnots(boolean editInkAnnots)
Sets whether editing ink annotation should open the annotation toolbar
void setEraserType(Eraser.EraserType type)
Sets the type of eraser.
void setExternalAnnotationManagerListener(ToolManager.ExternalAnnotationManagerListener externalAnnotationManagerListener)
void setFileAttachmentAnnotationListener(ToolManager.FileAttachmentAnnotationListener listener)
void setFreeHandTimerEnabled(boolean freehandTimerEnabled)
Sets whether free hand annotations are saved on a timer basis.
void setFreeHighlighterAutoSmoothingRange(float autoSmoothingRange)
Sets how wide the range would be for auto smoothing vertical and horizontal strokes, in dp independent of zoom.
void setFreeTextFonts(Set<String> freeTextFonts)
Sets list of free text fonts to have as options in the properties popup.
void setFreeTextFontsFromAssets(Set<String> fontNameList)
Sets custom font list from Assets for free text tool if sets font list from Assets, then it is not possible to set font list from storage The system fonts list won't load anymore
void setFreeTextFontsFromStorage(Set<String> fontPathList)
Sets custom font list from device storage for free text tool if font list from Assets is not set, then it's possible to set font list from storage The system fonts list won't load anymore
void setFreeTextToggleButtonColorInt(int color)
void setInkMultiStrokeEnabled(boolean multiStrokeEnabled)
Sets whether multi-stroke is enabled for ink tool
void setInkSmoothingEnabled(boolean enable)
Sets whether to smooth ink annotation
void setInsertMultipleImagesEnabled(boolean insertMultipleImagesEnabled)
Sets whether image stamp tool can insert multiple images.
void setLoupeEnabled(boolean loupeEnabled)
Sets whether loupe is disabled for tools setLoupeEnabled(false) will disable the loupe on text markup annotation
void setMoveAnnotationBetweenPages(boolean moveAnnotBetweenPages)
Sets whether moving annotations between pages is enabled
void setMultiSelectMode(AnnotEditRectGroup.SelectionMode mode)
Sets the mode of multi-select tool.
void setNightMode(boolean isNightMode)
Sets whether night mode is enabled
void setOnGenericMotionEventListener(ToolManager.OnGenericMotionEventListener onGenericMotionEventListener)
void setOnStyleChangedListener(OnAnnotStyleChangedListener onAnnotStyleChangedListener)
void setPdfContentEditingEnabled(boolean pdfContentEditingEnabled)
Sets whether to show option to edit original PDF content.
void setPersistStoreSignatureSetting(boolean persistStoreSignatureSetting)
Sets whether to use the user's last set "Store signature" setting in the CreateSignatureFragment dialog.
void setPreFlingListener(ToolManager.PreFlingListener listener)
void setPreToolManagerListener(ToolManager.PreToolManagerListener listener)
void setPresetsListener(ToolManager.PresetsListener listener)
void setQuickMenuJustClosed(boolean closed)
Sets whether the quick menu is just closed.
void setQuickMenuListener(ToolManager.QuickMenuListener listener)
void setReadOnly(boolean readOnly)
Indicates whether the file associated with PDFViewCtrl is read-only.
void setRealTimeAnnotEdit(boolean realTimeAnnotEdit)
Sets whether annotation editing is real time
void setReflowTextSelectionMenuEnabled(boolean reflowTextSelectionMenuEnabled)
void setRestrictedTapAnnotCreation(boolean restrictedTapAnnotCreation)
Sets whether to allow tap to create annotations on another type of annotation, for example for free text and sticky note.
void setRichContentEnabledForFreeText(boolean enabled)
Sets whether rich content is enabled for FreeText tool
void setSelectedAnnot(Annot annot, int pageNum)
Sets the selected annotation
void setSelectionBoxMargin(int marginInDp)
Sets the margin between selection box and annotation bounding box
void setShowAnnotIndicators(boolean showAnnotIndicators)
Sets whether annotation indicator is showing for annotations with comments
void setShowAuthorDialog(boolean show)
Sets whether to show author dialog the first time when user annotates.
void setShowRichContentOption(boolean showRichContentOption)
Sets whether to show rich content switch for FreeText tool Note: this will only take effect on Lollipop and up.
void setShowRotateHandle(boolean showRotateHandle)
Sets whether to show rotate handle when annotation selected
void setShowSavedSignatures(boolean showSavedSignature)
Sets whether can show saved signature in signature dialog
void setShowSignatureFromImage(boolean showSignatureFromImage)
Sets whether can show pick signature from image in signature dialog
void setShowSignaturePresets(boolean showSignaturePresets)
Sets whether to show color presets in the signature dialog
void setShowTypedSignature(boolean showTypedSignature)
Sets whether can show typed siganture button in signature dialog
void setShowUndoRedo(boolean showUndoRedo)
Sets whether to show undo/redo buttons in the toolbar
void setSignSignatureFieldsWithStamps(boolean useStamp)
For collaboration apps that requires syncing signature widget, set to true.
void setSignatureColors(int... signatureColors)
Sets the colors used for signing.
void setSkipReadOnlyCheck(boolean skipReadOnlyCheck)
Sets whether the viewer should skip read only checks on a document.
void setSkipSameToolCreation(boolean skipSameToolCreation)
Sets whether to skip tool creation if same tool creation is requested
void setSnackbarListener(ToolManager.SnackbarListener listener)
void setSnappingEnabledForMeasurementTools(boolean enabled)
Sets whether snapping is enabled for measurement tools
void setSnappingMode(int modeFlags)
Set the point snapping mode for the SnapToNearestInDoc method.
void setStampDialogListener(ToolManager.StampDialogListener listener)
void setStickyNoteShowPopup(boolean show)
Sets whether show pop up dialog when sticky note is added/ selected/ etc.
void setStylusAsPen(boolean stylusAsPen)
Sets whether to use stylus to draw without entering ink tool
void setTapToCreateShapeHalfWidth(int halfWidthInDp)
Sets the half width for tap to create shapes
void setTextFieldCustomAppearanceEnabled(boolean enabled)
void setTextMarkupAdobeHack(boolean enable)
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).
void setThemeProvider(ThemeProvider themeProvider)
void setTool(ToolManager.Tool t)
Sets the current ToolManager.Tool instance.
void setUsePressureSensitiveSignatures(boolean usePressureSensitiveSignatures)
Sets whether to use pressure sensitivity on styluses for signatures.
void setUsingDigitalSignature(boolean usingDigitalSignature)
Sets whether can use digital signature for signature widget
void showBuiltInPageNumber()
Show built in page number indicator
void skipNextTapEvent()
Skips the next tap event.
boolean skipReadOnlyCheck()
Returns whether the viewer should skip read only checks on a document.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pdftron.pdf.PDFViewCtrl.ActionCompletedListener
From interface com.pdftron.pdf.PDFViewCtrl.ToolManager

Public Constructors

public ToolManager (PDFViewCtrl pdfViewCtrl)

Class constructor.

Parameters
pdfViewCtrl the PDFViewCtrl. It must not be null.

Public Methods

public void addActionGoBackListener (ToolManager.ActionGoBackListener listener)

Parameters
listener the listener

public void 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 void addAnnotationModificationListener (ToolManager.AnnotationModificationListener listener)

Parameters
listener the listener

public void addAnnotationsSelectionListener (ToolManager.AnnotationsSelectionListener listener)

Parameters
listener the listener

public void addCustomizedTool (HashMap<ToolManager.ToolModeBase, Class<? extends Tool>> toolClassMap)

Add a custom tool to tool class map

Parameters
toolClassMap customized tool mode and class map

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

Add a custom tool to tool class map

Parameters
tool customized tool.
params parameter for instantiate tool

public void addCustomizedTool (Tool tool)

Add a custom tool to tool class map

Parameters
tool customized tool

public void addCustomizedToolParams (HashMap<ToolManager.ToolModeBase, Object[]> toolParamMap)

Add a custom tool to tool class map

Parameters
toolParamMap tool mode and tool initialize parameter map

public void addDialogListener (ToolManager.DialogListener listener)

Parameters
listener the lsitener

public void addFullSaveListener (ToolManager.FullSaveListener listener)

Parameters
listener the listener

public void addOnLayoutListener (ToolManager.OnLayoutListener listener)

Parameters
listener the listener

public void addPdfDocModificationListener (ToolManager.PdfDocModificationListener listener)

Parameters
listener the listener

public void addPdfOutlineModificationListener (ToolManager.PdfOutlineModificationListener listener)

Parameters
listener the listener

public void addPdfTextModificationListener (ToolManager.PdfTextModificationListener listener)

Parameters
listener the listener

public void addToolChangedListener (ToolManager.ToolChangedListener listener)

Parameters
listener the listener

public void addToolCreatedListener (ToolManager.ToolChangedListener listener)

Adds the ToolManager.ToolChangedListener called when tool created.

Parameters
listener the listener

public void addToolManagerChangedListener (ToolManager.ToolManagerChangedListener listener)

public void addToolSetListener (ToolManager.ToolSetListener listener)

Parameters
listener the listener

public void annotationCouldNotBeAdded (String errorMessage)

Lets various tools raise the annotation could not be add event from a unified location.

public void backToDefaultTool ()

Used to force the next tool to be the default tool if previously set

public boolean canResumePdfDocWithoutReloading ()

Returns
  • True if can resume PDF Doc without reloading

public Pan createDefaultTool ()

Creates the default tool (Pan tool). If instantiate default tool failed, it will create Pan tool

Returns
  • the default tool

public ToolManager.Tool createTool (ToolManager.ToolModeBase newTool, ToolManager.Tool currentTool, Bundle bundle, boolean force)

public ToolManager.Tool createTool (ToolManager.ToolModeBase newTool, ToolManager.Tool currentTool, boolean showPreset)

Creates the specified tool and copies the necessary info from the previous tool if provided. Calls the toolChanged(Tool, Tool) if possible.

It showPreset is true, then the default presets are shown when using the tool.

Parameters
newTool the identifier for the tool to be created
currentTool the current tool before this call
showPreset whether this tool should be associated with preset bundle data

public ToolManager.Tool createTool (ToolManager.ToolModeBase newTool, ToolManager.Tool currentTool)

Creates the specified tool and copies the necessary info from the previous tool if provided. Calls the toolChanged(Tool, Tool) if possible.

Parameters
newTool the identifier for the tool to be created
currentTool the current tool before this call

public ToolManager.Tool createTool (ToolManager.ToolModeBase newTool, ToolManager.Tool currentTool, Bundle bundle)

Creates the specified tool and copies the necessary info from the previous tool if provided. Calls the toolChanged(Tool, Tool) if possible.

Parameters
newTool the identifier for the tool to be created
currentTool the current tool before this call
bundle bundle containing metadata

public void deselectAll ()

Deselects all annotations

public void destroy ()

Cleans up resources.

public void disableAnnotEditing (Integer[] annotTypes)

Disables annotation editing by type.

Parameters
annotTypes annot types to be disabled

public void disableToolMode (ToolMode[] toolModes)

Disables tool modes. Pan tool cannot be disabled.

Parameters
toolModes tool modes to be disabled

public void disableUpdateModifyDateAnnotTypes (int[] disabledAnnotTypes)

public void disableUpdateModifyDateFieldTypes (int[] disabledFieldTypes)

public boolean editInkAnnots ()

Gets whether editing ink annotation should open the annotation toolbar

Returns
  • true if can edit ink annotation via annotation toolbar, false otherwise

public void enableAnnotEditing (Integer[] annotTypes)

Enables annotation editing by type.

Parameters
annotTypes annot types to be enabled

public void enableAnnotManager (String userId)

Enables annotation manager for annotation syncing

Parameters
userId the unique identifier of the current user

public void enableAnnotManager (String userId, String userName, PDFViewCtrl.AnnotationManagerMode undoMode, AnnotManager.EditPermissionMode editMode, AnnotManager.AnnotationSyncingListener listener)

Enables annotation manager for annotation syncing

Parameters
userId the unique identifier of the current user
userName the name of the current user
undoMode one of ADMIN_UNDO_OTHERS ADMIN_UNDO_OWN
editMode one of EDIT_OTHERS EDIT_OWN
listener the AnnotManager.AnnotationSyncingListener

public void enableAnnotManager (String userId, String userName, AnnotManager.AnnotationSyncingListener listener)

Enables annotation manager for annotation syncing

Parameters
userId the unique identifier of the current user
userName the name of current user
listener the AnnotManager.AnnotationSyncingListener

public void enableAnnotManager (String userId, AnnotManager.AnnotationSyncingListener listener)

Enables annotation manager for annotation syncing

Parameters
userId the unique identifier of the current user
listener the AnnotManager.AnnotationSyncingListener

public void enableAnnotationLayer ()

Enable separate rendering layer for annotations. Once enabled, can no longer disable in the same session.

public void enableToolMode (ToolMode[] toolModes)

Enables tool modes.

Parameters
toolModes tool modes to be enabled

public void freeTextInlineToggleEnabled (boolean freeTextInlineToggleEnabled)

Sets whether to show the FreeText inline toggle button

Parameters
freeTextInlineToggleEnabled true if showing the FreeText inline toggle button, false otherwise

public String generateKey ()

Returns
  • The generated key

public AnnotManager getAnnotManager ()

Returns
  • The annotation manager

public AnnotSnappingManager getAnnotSnappingManager ()

Returns the class associated with calculating and storing annotation snapping.

public HashMap<Integer, AnnotStyleProperty> getAnnotStyleProperties ()

Returns list of AnnotStyleProperty used to hide elements of the AnnotStyleDialgFragment

public ArrayList<ToolManager.ToolMode> getAnnotToolbarPrecedence ()

Gets the precedence of tool mode in Annotation Toolbar

Returns
  • the tool modes in the order of importance

public Annot getAnnotationAt (int x, int y)

Gets the annotation at the (x, y) position expressed in screen coordinates.

Note: This method is permission aware.

Parameters
x x coordinate of the screen point
y y coordinate of the screen point
Returns
  • The annotation found. If no annotation was found, it returns a null pointer.

public ToolManager.AnnotationPermissionListener getAnnotationPermissionListener ()

public int getAnnotationToolbarHeight ()

Gets the annotation toolbar height

Returns
  • annotation toolbar height in pixel, -1 if annotation toolbar not visible

public String getAuthorId ()

Gets the user ID used for checking whether an annotation is created by current user.

Returns
  • author identification

public String getAuthorName ()

Gets the user ID used for checking whether an annotation is created by current user.

Returns
  • author name

public String getCacheFileName ()

Returns
  • The cache file name

public FragmentActivity getCurrentActivity ()

Get the activity to which the ToolManager is currently attached, or null if not attached. DO NOT HOLD LONG-LIVED REFERENCES TO THE OBJECT RETURNED BY THIS METHOD, AS THIS WILL CAUSE MEMORY LEAKS.

public boolean getDefaultStoreNewSignature ()

Gets whether "Store signature" setting in the CreateSignatureFragment dialog should be enabled or disabled by default.

See setDefaultStoreNewSignature(boolean) for details.

Returns
  • true if "Store signature" is enabled by default, false otherwise

public static ToolManager.ToolMode getDefaultToolMode (ToolManager.ToolModeBase toolModeBase)

public static ToolManager.ToolModeBase getDefaultToolModeBase (ToolManager.ToolModeBase toolModeBase)

public String getDigitalSignatureKeystore ()

Gets digital signature keystore file path

Returns
  • the digital signature keystore file path

public String getDigitalSignatureKeystorePassword ()

Gets digital signature keystore password

Returns
  • the digital signature keystore password

public Set<ToolManager.ToolMode> getDisabledToolModes ()

Returns
  • the set of disabled tool modes

public ToolManager.EdgeEffectListener getEdgeEffectListener ()

public Eraser.EraserType getEraserType ()

Gets the type of eraser.

Returns
  • the type of eraser

public float getFreeHighlighterAutoSmoothingRange ()

Gets how wide the range would be for auto smoothing vertical and horizontal strokes, in pixel.

public String getFreeTextCacheFileName ()

Returns
  • The free text cache file name

public Set<String> getFreeTextFonts ()

Gets the list of free text fonts to have as options in the properties popup (Gets whiteList fonts among the PDFNet system fonts)

public Set<String> getFreeTextFontsFromAssets ()

Gets custom font list from Assets for free text tool

public Set<String> getFreeTextFontsFromStorage ()

Gets custom font list from Storage for free text tool

public int getFreeTextToggleButtonColorInt ()

public ToolManager.AnnotAction getLastAnnotAction ()

Returns
  • the previous annotation action that was applied.

public AnnotEditRectGroup.SelectionMode getMultiSelectMode ()

Gets the mode of multi-select tool.

Returns
  • the mode of multi-select tool

public ArrayList<ToolManager.Tool> getOldTools ()

Returns
  • the list of old tools

public OnAnnotStyleChangedListener getOnStyleChangedListener ()

public PDFViewCtrl getPDFViewCtrl ()

Returns
  • The PDFViewCtrl

public ToolManager.PresetsListener getPresetsListener ()

public RedactionManager getRedactionManager ()

Returns
  • The redaction manager

public String getSelectedAnnotId ()

Gets the identification of the selected annotation

Returns
  • the annotation identification

public int getSelectedAnnotPageNum ()

Gets the page number of selected annotation

Returns
  • the page number

public int getSelectionBoxMargin ()

Gets the margin between selection box and annotation bounding box

Returns
  • the margin in dp

public int[] getSignatureColors ()

Returns the colors used for signing.

Returns
  • array of color resources used for signing.

public ToolManager.SnackbarListener getSnackbarListener ()

public SnapUtils getSnapUtils ()

Returns the class associated with handling drawing and calculating snapping modes.

public int getSnappingModes ()

Gets snapping modes for measurement tools

Returns
  • a bitwise combination of the members of `GeometryCollection.SnappingMode`

public SoundManager getSoundManager ()

public ToolManager.StampDialogListener getStampDialogListener ()

public boolean getStickyNoteShowPopup ()

Gets whether shows stick note pop up dialog

Returns
  • true if shows, false otherwise

public TextToSpeech getTTS ()

Gets the Text To Speech object

Returns
  • TextToSpeech object

public int getTapToCreateShapeHalfWidth ()

Gets the half width for tap to create shapes

Returns
  • the half width in dp

public int getTheme ()

public ToolManager.Tool getTool ()

Gets the current ToolManager.Tool instance.

public int getToolbarHeight ()

Gets the toolbar height

Returns
  • toolbar height in pixel, -1 if annotation toolbar not visible

public UndoRedoManager getUndoRedoManger ()

Gets the undo redo manager

Returns
  • undo redo manager

public Set<Integer> getUpdateModifyDateDisabledAnnotTypes ()

public Set<Integer> getUpdateModifyDateDisabledFieldTypes ()

public boolean hasAnnotToolbarPrecedence ()

Gets whether precedence is set in Annotation Toolbar

Returns
  • true if there is precedence, false otherwise

public boolean hasCurrentActivity ()

Whether ToolManager is currently attached with an activity

public void hideBuiltInPageNumber ()

Hide built in page number indicator

public void initTTS ()

Initialize system Text To Speech

public boolean isAnnotEditingDisabled (int annotType)

Checks whether the editing of an annot type is disabled.

Parameters
annotType The annot type
Returns
  • True if editing of the annot type is disabled

public boolean isAnnotPermissionCheckEnabled ()

Gets whether annotation author permission is enabled

Returns
  • true if enabled, false otherwise

public boolean isAutoResizeFreeText ()

Gets whether can auto resize free text when editing

Returns
  • true if can auto resize, false otherwise

public boolean isAutoSelectAnnotation ()

Gets auto select annotation after annotation is created

Returns
  • true if auto select, false otherwise

public boolean isBuiltInPageNumberIndicatorVisible ()

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

Returns
  • true to show the built-in page number indicator, false otherwise.

public boolean isCopyAnnotatedTextToNoteEnabled ()

Gets whether to copy annotated text to note

Returns
  • true if enabled, false otherwise

public boolean isCreatingAnnotation ()

The overload implementation of isCreatingAnnotation().

public boolean isDeleteEmptyFreeText ()

Gets whether can delete FreeText if empty content was entered

Returns
  • true if delete FreeText if empty content was entered, false otherwise

public boolean isDoubleTapToZoom ()

Gets whether can double tap to zoom

Returns
  • true if can double tap to zoom, false otherwise

public boolean isEditFreeTextOnTap ()

Gets whether can edit FreeText on tap

Returns
  • true if start edit on tap, false otherwise

public boolean isFreehandTimerEnabled ()

Gets whether free hand annotations are saved on a timer basis. This flag is ignored if isInkMultiStrokeEnabled() returns false.

Returns
  • true if enabled

public boolean isInkMultiStrokeEnabled ()

Gets whether multi-stroke is enabled for ink tool

Returns
  • true if enabled

public boolean isInkSmoothingEnabled ()

Gets whether to smooth ink annotation

Returns
  • true if enabled, false otherwise

public boolean isInsertMultipleImagesEnabled ()

Gets whether image stamp tool can insert multiple images.

Returns
  • true if enabled

public boolean isLoupeEnabled ()

Gets whether loupe is enabled or not on text markup annotation

Returns
  • true if enabled

public boolean isMoveAnnotationBetweenPages ()

Gets whether moving annotations between pages is enabled

Returns
  • true if enabled

public boolean isNightMode ()

Gets whether night mode is enabled for tools

Returns
  • true if enabled, false otherwise

public boolean isOpenEditToolbarFromPan ()

Gets whether edit tool will open when tools selected in pan quick menu

Returns
  • true if click tools from quick menu will open the edit toolbar in pan mode, false otherwise

public boolean isPaused ()

Indicates lifecycle onPause

public boolean isPdfContentEditingEnabled ()

Gets whether to show option to edit original PDF content.

Returns
  • true if show option to edit original PDF content, false otherwise.

public boolean isPersistStoreSignatureSetting ()

Gets whether to use the user's last set "Store signature" setting in the CreateSignatureFragment dialog.

Returns
  • true if "Store signature" setting should persist the next time a user creates a signature, false otherwise

public boolean isQuickMenuDisabled ()

Gets whether the long press quick menu is disabled

Returns
  • true if disabled, false otherwise

public boolean isQuickMenuJustClosed ()

Returns
  • True if the quick menu is just closed

public boolean isReadOnly ()

Gets whether the file associated with PDFViewCtrl is read-only.

public boolean isRealTimeAnnotEdit ()

Gets whether annotation editing is real time

Returns
  • true if real time, false otherwise

public boolean isReflowTextSelectionMenuEnabled ()

public boolean isRestrictedTapAnnotCreation ()

Gets whether to allow tap to create annotations on another type of annotation, for example for free text and sticky note.

Returns
  • true if creating tap type annotations is not allowed on other type of annotations.

public boolean isRichContentEnabledForFreeText ()

Gets whether rich content is enabled for FreeText tool

Returns
  • true if enabled, false otherwise

public boolean isShowAnnotIndicators ()

Gets whether annotation indicator is showing for annotations with comments

Returns
  • true if enabled, false otherwise

public boolean isShowAuthorDialog ()

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

public boolean isShowRichContentOption ()

Gets whether to show rich content switch for FreeText tool Note: this will only take effect on Lollipop and up.

Returns
  • true if show switch, false otherwise

public boolean isShowRotateHandle ()

Gets whether to show rotate handle when annotation selected

Returns
  • true if rotation handle should be shown.

public boolean isShowSavedSignature ()

Gets whether can show saved signature in signature dialog

Returns
  • true if show saved signatures, false otherwise

public boolean isShowSignatureFromImage ()

Gets whether can show pick signature from image in signature dialog

Returns
  • true if show image picking icon, false otherwise

public boolean isShowSignaturePresets ()

Gets whether signature presets are shown in the signature dialog

Returns
  • true if color presets are shown in the signature dialog, false otherwise

public boolean isShowTypedSignature ()

Gets whether can show typed signature button in signature dialog

Returns
  • true if show typed signature button, false otherwise

public boolean isShowUndoRedo ()

Gets whether the viewer show undo/redo buttons in the toolbar.

Returns
  • true if showing undo/redo buttons in the toolbar.

public boolean isSkipNextTapEvent ()

Returns
  • True if next tap event is skipped.

public boolean isSnappingEnabledForMeasurementTools ()

Gets whether snapping is enabled for measurement tools

Returns
  • true if enabled, false otherwise

public boolean isStylusAsPen ()

Gets whether to use stylus to draw without entering ink tool

Returns
  • true if enabled, false otherwise

public boolean isTextFieldCustomAppearanceEnabled ()

public boolean isTextMarkupAdobeHack ()

Gets 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 boolean isToolModeDisabled (ToolManager.ToolMode toolMode)

Checks whether the specified tool mode is disabled.

Parameters
toolMode The tool mode
Returns
  • True if the tool mode is disabled

public boolean isUsingDigitalSignature ()

Gets whether can use digital signature for signature widget

Returns
  • true if can use digital signature

public boolean isUsingPressureSensitiveSignatures ()

Gets whether the viewer will use pressure sensitivity for signatures

Returns
  • true if show image picking icon, false otherwise

public boolean isfreeTextInlineToggleEnabled ()

Gets whether show the FreeText inline toggle button

Returns
  • true if showing the FreeText inline toggle button, false otherwise

public void onActionCompleted (Action action)

The overload implementation of onActionCompleted(Action).

Parameters
action the action which was completed

public void onAnnotPainterUpdated (int page, long which, CurvePainter painter)

Called when annotation CurvePainter has been updated. Called from background thread.

Parameters
page the page number
which the annotation key

public void onAnnotStyleColorChange (ArrayList<AnnotStyle> styles)

public void onAnnotStyleDismiss (AnnotStyleDialogFragment annotStyleDialog)

public void onAttachFileSelected (PointF targetPoint)

Pass the file attachment selected event.

Parameters
targetPoint target location to add the image stamp

public void onChangePointerIcon (PointerIcon pointerIcon)

The overload implementation of onChangePointerIcon(PointerIcon).

Parameters
pointerIcon The pointer icon

public void onClose ()

The overload implementation of onClose().

public void onConfigurationChanged (Configuration newConfig)

The overload implementation of onConfigurationChanged(Configuration).

Parameters
newConfig the new device configuration

public void onControlReady ()

The overload implementation of onControlReady().

public void onCustomEvent (Object obj)

The overload implementation of onCustomEvent(Object).

Parameters
obj the Object passed in when calling #postCustomEvent(Object).

public void onDestroy ()

Called when destroy() is called.

public void onDocumentDownloadEvent (PDFViewCtrl.DownloadState mode, int page_num, int page_downloaded, int page_count, String message)

Parameters
mode the state of the update.
page_num the number of the page that was just downloaded. Meaningful if type is DownloadState#PAGE.
page_downloaded the total number of pages that have been downloaded
page_count the page count of the associated document
message error message in case the download has failed

public boolean onDoubleTap (MotionEvent e)

The overload implementation of onDoubleTap(MotionEvent).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public void onDoubleTapEnd (MotionEvent e)

The overload implementation of onDoubleTapEnd(MotionEvent).

public boolean onDoubleTapEvent (MotionEvent e)

The overload implementation of onDoubleTapEvent(MotionEvent).

public void onDoubleTapZoomAnimationBegin ()

The overload implementation of onDoubleTapZoomAnimationBegin().

public void onDoubleTapZoomAnimationEnd ()

The overload implementation of onDoubleTapZoomAnimationEnd().

public boolean onDown (MotionEvent e)

The overload implementation of onDown(MotionEvent).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public void onDraw (Canvas canvas, Matrix tfm)

The overload implementation of onDraw(Canvas, Matrix).

Parameters
canvas The android.graphics.Canvas object to draw on PDFViewCtrl.
tfm The extra transformation matrix applied to 'canvas'. This matrix is normally an identity matrix unless when the built-in page sliding is in process. The inverse of this matrix can be temporarily applied to 'canvas' in order to make the content drawn in this function appear stationary during sliding.

public boolean onDrawEdgeEffects (Canvas canvas, int width, int verticalOffset)

The overload implementation of onDrawEdgeEffects(Canvas, int, int).

Parameters
canvas canvas used to draw edge effect
width width of the edge effect
verticalOffset vertical offset to draw edge effect
Returns
  • whether the viewer should be invalidated

public void onFileAttachmentSelected (FileAttachment fileAttachment)

Lets various tools raise the file attachment selected event.

Parameters
fileAttachment the selected file attachment

public void onFileCreated (String fileLocation, ToolManager.AdvancedAnnotationListener.AnnotAction action)

Lets various tools raise the onFileCreated event.

Parameters
fileLocation file location
action Annotation action associated with the raised event

public boolean onFlingStop ()

The overload implementation of onFlingStop().

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public void onFreehandStylusUsedFirstTime ()

Lets various tools raise the freehand stylus used for the first time event.

public boolean onGenericMotionEvent (MotionEvent event)

The overload implementation of onGenericMotionEvent(MotionEvent).

Parameters
event the up motion event
Returns
  • true if the event was handled, false otherwise.

public void onGoBackSelected ()

Goes back to previous page when action is GoBack

public void onImageSignatureSelected (PointF targetPoint, int targetPage, Long widget)

Pass the image signature selected event.

Parameters
targetPoint target page location to add the image signature
targetPage target page number to add the image signature
widget target form widget to add the image signature (only one of target point or widget will be valid)

public void onImageStamperSelected (PointF targetPoint)

Pass the image stamper selected event.

Parameters
targetPoint target location to add the image stamp

public void onInkEditSelected (Annot inkAnnot, int pageNum)

Pass the ink edit selected event.

Parameters
inkAnnot the ink annotation to be modified

public void onInlineFreeTextEditingStarted ()

Pass inline free text editing started event.

public boolean onKeyUp (int keyCode, KeyEvent event)

The overload implementation of onKeyUp(int, KeyEvent).

Parameters
keyCode A key code that represents the button pressed, from android.view.KeyEvent.
event The KeyEvent object that defines the button action.
Returns
  • true if the event was handled, false otherwise.

public void onLayout (boolean changed, int l, int t, int r, int b)

The overload implementation of onLayout(boolean, int, int, int, int).

Parameters
changed This is a new size or position for this view.
l Left position, relative to parent.
t Top position, relative to parent.
r Right position, relative to parent.
b Bottom position, relative to parent.

public boolean onLongPress (MotionEvent e)

The overload implementation of onLongPress(MotionEvent).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public boolean onMove (MotionEvent e1, MotionEvent e2, float x_dist, float y_dist)

The overload implementation of onMove(MotionEvent, MotionEvent, float, float).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, true should be returned so that while the tool is moving, the content will not be scrolled.

public boolean onNewFileCreated (String filePath, int pageNumber)

Opens a newly created file.

Parameters
filePath local file path of the document
pageNumber the initial page number to scroll to when the document is opened
Returns
  • whether a new file was opened

public boolean onNewFileCreated (String filePath)

Opens a newly created file.

Parameters
filePath local file path of the document
Returns
  • whether a new file was opened.

public void onOpenAnnotationToolbar (ToolManager.ToolMode mode)

Called when the annotation toolbar should open for a tool

Parameters
mode the tool mode

public void onOpenEditToolbar (ToolManager.ToolMode mode)

Called when the edit toolbar should open for a tool

Parameters
mode the tool mode

public void onPageTurning (int old_page, int cur_page)

The overload implementation of onPageTurning(int, int).

public void onPause ()

Called when pause() is called.

public boolean onPointerDown (MotionEvent e)

The overload implementation of onPointerDown(MotionEvent).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public void onPostSingleTapConfirmed ()

The overload implementation of onPostSingleTapConfirmed().

public void onPullEdgeEffects (int which_edge, float delta_distance)

The overload implementation of onPullEdgeEffects(int, float).

Parameters
which_edge -1 for left edge, 1 for right edge
delta_distance distance of edge effect

public boolean onQuickMenuClicked (QuickMenuItem menuItem)

Parameters
menuItem the menu item. See: QuickMenuItem

public void onQuickMenuDismissed ()

a callback to be invoked when quick menu is dismissed

public void onQuickMenuLocationRequested ()

public void onQuickMenuShown ()

a callback to be invoked when quick menu is shown

public void onReleaseEdgeEffects ()

The overload implementation of onReleaseEdgeEffects().

public void onRenderingFinished ()

The overload implementation of onRenderingFinished().

public void onResume ()

Called when resume() is called.

public void onSaveFileAttachmentSelected (FileAttachment fileAttachment, Intent intent)

Raise event for file attachment annotation

public boolean onScale (float x, float y)

The overload implementation of onScale(float, float).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public boolean onScaleBegin (float x, float y)

The overload implementation of onScaleBegin(float, float).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public boolean onScaleEnd (float x, float y)

The overload implementation of onScaleEnd(float, float).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public void onScrollChanged (int l, int t, int oldl, int oldt)

The overload implementation of onScrollChanged(int, int, int, int).

Parameters
l current horizontal scroll origin
t current vertical scroll origin
oldl previous horizontal scroll origin
oldt previous vertical scroll origin

public void onSetDoc ()

The overload implementation of onSetDoc().

public boolean onShowPress (MotionEvent e)

The overload implementation of onShowPress(MotionEvent).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public boolean onShowQuickMenu (QuickMenu quickMenu, Annot annot)

a callback to be invoked when quick menu is about to show

public boolean onSingleTapConfirmed (MotionEvent e)

The overload implementation of onSingleTapConfirmed(MotionEvent).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public boolean onSingleTapUp (MotionEvent e)

The overload implementation of onSingleTapUp(MotionEvent).

Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public boolean onUp (MotionEvent e, PDFViewCtrl.PriorEventMode priorEventMode)

The overload implementation of onUp(MotionEvent, PDFViewCtrl.PriorEventMode).

Parameters
e the up motion event
priorEventMode indicates the prior event type.
Returns
  • true if the event is swallowed by the tool. This way, PDFViewCtrl will not perform its usual task associated with this event. In general, false should be returned.

public void raiseAllAnnotationsRemovedEvent ()

Call this function when all annotations in the document have been removed.

public void raiseAnnotationActionEvent ()

Call this function when an action has taken place that changes the document.

public void raiseAnnotationsAddedEvent (Map<Annot, Integer> annots)

Call this function when annotations have been added to the document.

Parameters
annots map of annotations added

public void raiseAnnotationsModifiedEvent (Map<Annot, Integer> annots, Bundle bundle)

Call this function when annotations in the document have been modified.

Parameters
annots map of annotations modified

public void raiseAnnotationsPreModifyEvent (Map<Annot, Integer> annots)

Call this function before annotations in the document are modified.

Parameters
annots map of annotations about to be modified

public void raiseAnnotationsPreRemoveEvent (Map<Annot, Integer> annots)

Call this function before annotations are removed from the document.

Parameters
annots map of annotations about to be removed

public void raiseAnnotationsRemovedEvent (Map<Annot, Integer> annots)

Call this function when annotations have been removed from the document.

Parameters
annots map of annotations removed

public void raiseAnnotationsRemovedEvent (int pageNum)

Call this function when all annotations in the specified page have been removed from the document.

Parameters
pageNum The page number where the annotations are on

public void raiseAnnotationsRemovedEvent (Map<Annot, Integer> annots, Bundle bundle)

Call this function when annotations have been removed from the document.

Parameters
annots map of annotations removed
bundle The Bundle containing additional metadata for the event

public void raiseAnnotationsSelectionChangedEvent (HashMap<Annot, Integer> annots)

Lets various tools raise the annotations selection changed event.

Parameters
annots the selected annotations

public void raiseBookmarkModified (List<UserBookmarkItem> bookmarkItems)

Call this function when document bookmark has been modified.

Parameters
bookmarkItems the new bookmarks after modification

public void raiseFullSaveRequired ()

public boolean raiseInterceptAnnotationHandlingEvent (Annot annot, Bundle extra, ToolManager.ToolMode toolMode)

Handle annotation

Parameters
annot annotation
extra
toolMode tool mode

public boolean raiseInterceptDialogEvent (AlertDialog dialog)

This method is deprecated.
see raiseInterceptDialogFragmentEvent(DialogFragment)

Call this function when a dialog is about to show up.

public boolean raiseInterceptDialogFragmentEvent (DialogFragment dialogFragment)

Call this function when a dialog fragment is about to show up.

public void raisePageLabelChangedEvent ()

Call this function when the page labels have changed in this document.

public void raisePageMoved (int from, int to)

Call this function when a page in the document have been moved to a new position.

public void raisePagesAdded (List<Integer> pageList)

Call this function when new pages have been added to the document.

public void raisePagesCropped ()

Call this function when pages of the document have been cropped.

public void raisePagesDeleted (List<Integer> pageList)

Call this function when pages have been deleted from the document.

public void raisePagesMoved (List<Integer> pagesMoved, int toPage, int currentPage)

Call this function when pages in the document have been moved to a new position.

public void raisePagesRotated (List<Integer> pageList)

Call this function when pages in the document have been rotated.

public void raisePdfOutlineModified ()

Call this function when document outline has been modified..

public void raisePdfTextModified ()

Call this function when document text content has been modified..

public void removeActionGoBackListener (ToolManager.ActionGoBackListener listener)

Parameters
listener the listener

public void removeAnnotationModificationListener (ToolManager.AnnotationModificationListener listener)

Parameters
listener the listener

public void removeAnnotationsSelectionListener (ToolManager.AnnotationsSelectionListener listener)

Parameters
listener the listener

public void removeFullSaveListener (ToolManager.FullSaveListener listener)

Parameters
listener the listener

public void removeOnLayoutListener (ToolManager.OnLayoutListener listener)

Parameters
listener the listener

public void removePdfDocModificationListener (ToolManager.PdfDocModificationListener listener)

Parameters
listener the listener

public void removePdfOutlineModificationListener (ToolManager.PdfOutlineModificationListener listener)

Parameters
listener the listener

public void removePdfTextModificationListener (ToolManager.PdfTextModificationListener listener)

Parameters
listener the listener

public void removeToolChangedListener (ToolManager.ToolChangedListener listener)

Parameters
listener the listener

public void removeToolCreatedListener (ToolManager.ToolChangedListener listener)

Removes the ToolManager.ToolChangedListener called when tool created.

Parameters
listener the listener

public void removeToolManagerChangedListener (ToolManager.ToolManagerChangedListener listener)

public void removeToolSetListener (ToolManager.ToolSetListener listener)

Parameters
listener the listener

public void reselectAnnot ()

Re-selects the last selected annotation

public void resetIndicator ()

Resets annotation indicators

public void resetSkipNextTapEvent ()

Resets skipping the next tap event.

public Tool safeCreateTool (ToolManager.ToolModeBase mode)

Creates tool safely, if there is any exception, creates default tool

Parameters
mode tool mode
Returns
  • tool

public void selectAnnot (Annot annot, int pageNum)

Selects an annotation

Parameters
annot the annotation
pageNum the page number where the annotation is on

public void selectAnnot (String annotId, int pageNum)

Selects the annotation.

Parameters
annotId The annotation ID
pageNum The page number where the annotation is on

public void setAddImageStamperTool (boolean addImageStamperTool)

Sets whether to enable image stamper tool

Parameters
addImageStamperTool if true, image stamper tool will be available

public void setAdvancedAnnotationListener (ToolManager.AdvancedAnnotationListener listener)

Parameters
listener the listener

public void setAnnotPermissionCheckEnabled (boolean enable)

Sets whether to check annotation author permission

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

public void setAnnotToolbarPrecedence (ToolMode[] toolModes)

Sets 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

public void setAnnotationPermissionListener (ToolManager.AnnotationPermissionListener annotationPermissionListener)

public void setAnnotationToolbarListener (ToolManager.AnnotationToolbarListener annotationToolbarListener)

Parameters
annotationToolbarListener the listener

public void setAuthorId (String authorId)

Sets the user ID used for checking whether an annotation is created by current user.

Parameters
authorId author identification

public void setAuthorName (String authorName)

Sets the user ID used for checking whether an annotation is created by current user.

Parameters
authorName author name

public void setAutoResizeFreeText (boolean autoResizeFreeText)

Sets whether can auto resize free text when editing

Parameters
autoResizeFreeText if true can auto resize, false otherwise

public void setAutoSelectAnnotation (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 void setBasicAnnotationListener (ToolManager.BasicAnnotationListener listener)

Parameters
listener the listener

public void setBuiltInPageNumberIndicatorVisible (boolean visible)

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

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

public void setCacheFileName (String tag)

Sets the cache file name

Parameters
tag The tag which will be used to generate cache file name

public void setCanOpenEditToolbarFromPan (boolean canOpenEditToolbarFromPan)

Sets whether edit tool will open when tools selected in pan quick menu

Parameters
canOpenEditToolbarFromPan if true, click tools from quick menu will open the edit toolbar in pan mode, false otherwise

public void setCanResumePdfDocWithoutReloading (boolean canResumePdfDocWithoutReloading)

Sets if can resume PDF Doc without reloading.

Parameters
canResumePdfDocWithoutReloading True if can resume PDF Doc without reloading

public void setCopyAnnotatedTextToNoteEnabled (boolean enable)

Sets whether to copy annotated text to note

Parameters
enable enable copy annotated text to note

public void setCurrentActivity (FragmentActivity activity)

Set the activity to which the ToolManager is currently attached, or null if not attached.

public void setDefaultStoreNewSignature (boolean defaultStoreNewSignature)

Sets whether "Store signature" setting in the CreateSignatureFragment dialog should be enabled or disabled by default.

If isPersistStoreSignatureSetting() is true, then this default value is used the very first time the user creates a new signature. When the user creates the next signatures, this value is ignored and instead will read their last used "Store signature" setting.

If isPersistStoreSignatureSetting() is false, then this default value is used every time the user creates a new signature

Default true.

Parameters
defaultStoreNewSignature true if show saved signatures, false otherwise

public void setDefaultToolCLass (Class<? extends Pan> cLass)

set default tool class

Parameters
cLass default tool class

public void setDeleteEmptyFreeText (boolean deleteEmptyFreeText)

Sets whether can delete FreeText if empty content was entered

Parameters
deleteEmptyFreeText true if delete FreeText if empty content was entered, false otherwise

public void setDigitalSignatureKeystorePassword (String digitalSignatureKeystore)

Sets digital signature keystore password

public void setDigitalSignatureKeystorePath (String digitalSignatureKeystore)

Sets digital signature keystore file path

public void setDisableQuickMenu (boolean disabled)

Sets whether disable showing the long press quick menu

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

public void setDoubleTapToZoom (boolean doubleTapToZoom)

Sets whether can double tap to zoom the viewer

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

public void setEdgeEffectListener (ToolManager.EdgeEffectListener edgeEffectListner)

public void setEditFreeTextOnTap (boolean editFreeTextOnTap)

Sets whether can edit FreeText on tap

Parameters
editFreeTextOnTap true if start edit on tap, false otherwise

public void setEditInkAnnots (boolean editInkAnnots)

Sets whether editing ink annotation should open the annotation toolbar

Parameters
editInkAnnots if true, can edit ink annotation via annotation toolbar, false otherwise

public void setEraserType (Eraser.EraserType type)

Sets the type of eraser.

Parameters
type the type of eraser

public void setExternalAnnotationManagerListener (ToolManager.ExternalAnnotationManagerListener externalAnnotationManagerListener)

public void setFileAttachmentAnnotationListener (ToolManager.FileAttachmentAnnotationListener listener)

Parameters
listener the listener

public void setFreeHandTimerEnabled (boolean freehandTimerEnabled)

Sets whether free hand annotations are saved on a timer basis. This flag is ignored if isInkMultiStrokeEnabled() returns false.

Parameters
freehandTimerEnabled true if enabled. Default to true.

public void setFreeHighlighterAutoSmoothingRange (float autoSmoothingRange)

Sets how wide the range would be for auto smoothing vertical and horizontal strokes, in dp independent of zoom.

Parameters
autoSmoothingRange indicating how wide is the range to auto smooth vertical and horizontal strokes, in dp.

public void setFreeTextFonts (Set<String> freeTextFonts)

Sets list of free text fonts to have as options in the properties popup. (Sets whiteList fonts among the PDFNet system fonts)

public void setFreeTextFontsFromAssets (Set<String> fontNameList)

Sets custom font list from Assets for free text tool if sets font list from Assets, then it is not possible to set font list from storage The system fonts list won't load anymore

Parameters
fontNameList array of custom font's absolute path from Assets

public void setFreeTextFontsFromStorage (Set<String> fontPathList)

Sets custom font list from device storage for free text tool if font list from Assets is not set, then it's possible to set font list from storage The system fonts list won't load anymore

Parameters
fontPathList array of custom font's absolute path from device storage

public void setFreeTextToggleButtonColorInt (int color)

public void setInkMultiStrokeEnabled (boolean multiStrokeEnabled)

Sets whether multi-stroke is enabled for ink tool

Parameters
multiStrokeEnabled true if enabled. Default to true.

public void setInkSmoothingEnabled (boolean enable)

Sets whether to smooth ink annotation

Parameters
enable enable ink smoothing

public void setInsertMultipleImagesEnabled (boolean insertMultipleImagesEnabled)

Sets whether image stamp tool can insert multiple images.

Parameters
insertMultipleImagesEnabled true if enabled. Default to false.

public void setLoupeEnabled (boolean loupeEnabled)

Sets whether loupe is disabled for tools setLoupeEnabled(false) will disable the loupe on text markup annotation

Parameters
loupeEnabled true if enabled. Default to true.

public void setMoveAnnotationBetweenPages (boolean moveAnnotBetweenPages)

Sets whether moving annotations between pages is enabled

Parameters
moveAnnotBetweenPages true if enabled. Default to false.

public void setMultiSelectMode (AnnotEditRectGroup.SelectionMode mode)

Sets the mode of multi-select tool.

Parameters
mode the mode of multi-select tool

public void setNightMode (boolean isNightMode)

Sets whether night mode is enabled

Parameters
isNightMode enable night mode for tools

public void setOnGenericMotionEventListener (ToolManager.OnGenericMotionEventListener onGenericMotionEventListener)

Parameters
onGenericMotionEventListener the listener

public void setOnStyleChangedListener (OnAnnotStyleChangedListener onAnnotStyleChangedListener)

public void 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 void setPersistStoreSignatureSetting (boolean persistStoreSignatureSetting)

Sets whether to use the user's last set "Store signature" setting in the CreateSignatureFragment dialog.

Default true.

Parameters
persistStoreSignatureSetting true if "Store signature" setting should persist the next time a user creates signature, false otherwise

public void setPreFlingListener (ToolManager.PreFlingListener listener)

Parameters
listener the listener

public void setPreToolManagerListener (ToolManager.PreToolManagerListener listener)

Parameters
listener the listener

public void setPresetsListener (ToolManager.PresetsListener listener)

public void setQuickMenuJustClosed (boolean closed)

Sets whether the quick menu is just closed.

Parameters
closed True if the quick menu is just closed

public void setQuickMenuListener (ToolManager.QuickMenuListener listener)

Parameters
listener the listener

public void setReadOnly (boolean readOnly)

Indicates whether the file associated with PDFViewCtrl is read-only.

public void setRealTimeAnnotEdit (boolean realTimeAnnotEdit)

Sets whether annotation editing is real time

Parameters
realTimeAnnotEdit true if real time, false otherwise

public void setReflowTextSelectionMenuEnabled (boolean reflowTextSelectionMenuEnabled)

public void setRestrictedTapAnnotCreation (boolean restrictedTapAnnotCreation)

Sets whether to allow tap to create annotations on another type of annotation, for example for free text and sticky note.

Parameters
restrictedTapAnnotCreation true if creating tap type annotations is not allowed on other type of annotations. Default to false.

public void setRichContentEnabledForFreeText (boolean enabled)

Sets whether rich content is enabled for FreeText tool

Parameters
enabled true if enabled, false otherwise Note: this will only take effect on Lollipop and up.

public void setSelectedAnnot (Annot annot, int pageNum)

Sets the selected annotation

Parameters
annot the annotation
pageNum the page number where the annotation is on

public void setSelectionBoxMargin (int marginInDp)

Sets the margin between selection box and annotation bounding box

Parameters
marginInDp the margin in DP, default to 16dp.

public void setShowAnnotIndicators (boolean showAnnotIndicators)

Sets whether annotation indicator is showing for annotations with comments

Parameters
showAnnotIndicators true if enabled, false otherwise

public void setShowAuthorDialog (boolean show)

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

public void setShowRichContentOption (boolean showRichContentOption)

Sets whether to show rich content switch for FreeText tool Note: this will only take effect on Lollipop and up.

Parameters
showRichContentOption true if show switch, false otherwise

public void setShowRotateHandle (boolean showRotateHandle)

Sets whether to show rotate handle when annotation selected

Parameters
showRotateHandle true if rotation handle should be shown. Default to true.

public void setShowSavedSignatures (boolean showSavedSignature)

Sets whether can show saved signature in signature dialog

Parameters
showSavedSignature true if show saved signatures, false otherwise

public void setShowSignatureFromImage (boolean showSignatureFromImage)

Sets whether can show pick signature from image in signature dialog

Parameters
showSignatureFromImage true if show pick from image button, false otherwise

public void setShowSignaturePresets (boolean showSignaturePresets)

Sets whether to show color presets in the signature dialog

Parameters
showSignaturePresets true if color presets should be shown in the signature dialog, false otherwise

public void setShowTypedSignature (boolean showTypedSignature)

Sets whether can show typed siganture button in signature dialog

Parameters
showTypedSignature true if show typed signature button button, false otherwise

public void 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 void setSignSignatureFieldsWithStamps (boolean useStamp)

For collaboration apps that requires syncing signature widget, set to true.

public void setSignatureColors (int... signatureColors)

Sets the colors used for signing. Minimum one color and maximum three colors, any additional colors are ignored.

When set, users will not be able to change these colors through the annotation style dialog.

Parameters
signatureColors color resources used for creating signatures.

public void setSkipReadOnlyCheck (boolean skipReadOnlyCheck)

Sets whether the viewer should skip read only checks on a document. Default false.

Parameters
skipReadOnlyCheck True if viewer should skip read only check, false otherwise

public void setSkipSameToolCreation (boolean skipSameToolCreation)

Sets whether to skip tool creation if same tool creation is requested

Parameters
skipSameToolCreation true if current tool will be returned by createTool(ToolModeBase, Tool) when new tool mode is the same as current tool mode. Default to false.

public void setSnackbarListener (ToolManager.SnackbarListener listener)

public void setSnappingEnabledForMeasurementTools (boolean enabled)

Sets whether snapping is enabled for measurement tools

Parameters
enabled true if enabled, false otherwise

public void setSnappingMode (int modeFlags)

Set the point snapping mode for the SnapToNearestInDoc method. By default SnapToNearestInDoc will snap to line endpoints, midpoints, and intersections.

Parameters
modeFlags a bitwise combination of the members of `GeometryCollection.SnappingMode`

public void setStampDialogListener (ToolManager.StampDialogListener listener)

public void setStickyNoteShowPopup (boolean show)

Sets whether show pop up dialog when sticky note is added/ selected/ etc.

Parameters
show if true, show sticky note pop up when sticky note is created/ prepare to modify

public void setStylusAsPen (boolean stylusAsPen)

Sets whether to use stylus to draw without entering ink tool

Parameters
stylusAsPen enable inking with stylus in pan mode

public void setTapToCreateShapeHalfWidth (int halfWidthInDp)

Sets the half width for tap to create shapes

Parameters
halfWidthInDp the half width in dp, default to 50dp

public void setTextFieldCustomAppearanceEnabled (boolean enabled)

public void setTextMarkupAdobeHack (boolean enable)

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 void setThemeProvider (ThemeProvider themeProvider)

public void setTool (ToolManager.Tool t)

Sets the current ToolManager.Tool instance.

There are two ways to set the current tool. One is via createTool(ToolModeBase, com.pdftron.pdf.tools.ToolManager.Tool), which is used during events. The other way is through this method, which allows for setting the tool without any events.

public void setUsePressureSensitiveSignatures (boolean usePressureSensitiveSignatures)

Sets whether to use pressure sensitivity on styluses for signatures.

Parameters
usePressureSensitiveSignatures true if using pressure sensitivity for signatures.

public void setUsingDigitalSignature (boolean usingDigitalSignature)

Sets whether can use digital signature for signature widget

Parameters
usingDigitalSignature true if can use digital signature

public void showBuiltInPageNumber ()

Show built in page number indicator

public void skipNextTapEvent ()

Skips the next tap event.

public boolean skipReadOnlyCheck ()

Returns whether the viewer should skip read only checks on a document.