java.lang.Object
   ↳ Fragment
     ↳ com.pdftron.pdf.controls.PdfViewCtrlTabFragment
Known Direct Subclasses

Class Overview

The PdfViewCtrlTabFragment shows PDFViewCtrl out of the box with a various of controls such as AnnotationToolbar, ThumbnailSlider, ThumbnailsViewFragment etc.

Summary

Nested Classes
class PdfViewCtrlTabFragment.SaveFolderWrapper Wraps either a File or an ExternalFileInfo in order to make saving easier. 
interface PdfViewCtrlTabFragment.TabListener Callback interface to be invoked when an interaction is needed. 
Constants
int ANIMATE_DURATION_HIDE
int ANIMATE_DURATION_SHOW
String BUNDLE_TAB_CONFIG
String BUNDLE_TAB_CONTENT_LAYOUT
String BUNDLE_TAB_CUSTOM_HEADERS
String BUNDLE_TAB_FILE_EXTENSION
String BUNDLE_TAB_ITEM_SOURCE
String BUNDLE_TAB_PASSWORD
String BUNDLE_TAB_PDFVIEWCTRL_ID
String BUNDLE_TAB_TAG
String BUNDLE_TAB_TITLE
Public Constructors
PdfViewCtrlTabFragment()
Public Methods
void addAnnotationToolbarListener(AnnotationToolbar.AnnotationToolbarListener listener)
void addQuickMenuListener(ToolManager.QuickMenuListener listener)
void annotationsCouldNotBeAdded(String errorMessage)
The overloaded implementation of annotationsCouldNotBeAdded(String).
void applyCutout(int top, int bottom)
void attachFileSelected(PointF targetPoint)
Called when a location has been selected for adding the file attachment.
boolean canDocBeSaved()
Checks whether the document can be saved.
void cancelFindText()
Cancels finding text.
void clearPageBackAndForwardStacks()
Clears the stacks of page backward/forward.
void closeNavigationList()
Closes the navigation list if it was opened as side sheet
void createAnnotationToolbar()
static Bundle createBasicPdfViewCtrlTabBundle(String tag, String title, String fileExtension, String password, int itemSource, ViewerConfig config)
Returns the bundle having information needed to create a tab fragment.
static Bundle createBasicPdfViewCtrlTabBundle(String tag, String title, String fileExtension, String password, int itemSource)
Returns the bundle having information needed to create a tab fragment.
static Bundle createBasicPdfViewCtrlTabBundle(Context context, Uri fileUri, String title, String password, ViewerConfig config)
Returns the bundle having information needed to create a tab fragment.
static Bundle createBasicPdfViewCtrlTabBundle(Context context, Uri fileUri, String password, ViewerConfig config)
Returns the bundle having information needed to create a tab fragment.
static Bundle createBasicPdfViewCtrlTabBundle(Context context, Uri fileUri, String password)
Returns the bundle having information needed to create a tab fragment.
boolean doesSaveDocNeedNewTab()
void exitSearchMode()
Exits the search mode.
void fileAttachmentSelected(FileAttachment attachment)
Called when a file attachment has been selected.
void fileCreated(String filepath, ToolManager.AdvancedAnnotationListener.AnnotAction action)
Called when an annotation needs to perform an action with a file created
void forceSave()
Saves the changes to the document forcefully
void freeTextInlineEditingStarted()
Called when free text inline editing has started.
void freehandStylusUsedFirstTime()
Called when free hand stylus has been used for the firs time.
AnnotationToolbar getAnnotationToolbar()
Returns AnnotationToolbar associated with this tab.
int getBookmarkDialogCurrentTab()
Returns which tab in bookmark dialog is selected.
FileInfo getCurrentFileInfo()
Returns the current file info.
long getCurrentFileSize()
PageBackButtonInfo getCurrentPageInfo()
Returns the current page info.
File getFile()
Returns the file.
String getFilePath()
Returns the path of the document
boolean getHasWarnedAboutCanNotEditDuringConversion()
Checks whether a warning about can not edit during conversion has been shown.
PDFViewCtrl getPDFViewCtrl()
Returns the PDFViewCtrl associated with this tab.
PDFDoc getPdfDoc()
Returns the PDF document
int getReflowTextSize()
Returns the reflow text size.
int getTabErrorCode()
Returns the error code, if any.
int getTabSource()
Returns the item source of the tab.
String getTabTag()
Returns the tab tag.
String getTabTitle()
Returns the filename of the tab
String getTabTitleWithExtension()
Returns the filename of the tab
ToolManager getToolManager()
Returns ToolManager associated with this tab.
Uri getUriFile()
Returns the URI file
void gotoNextSearch()
Goes to the next text in search.
void gotoPreviousSearch()
Goes to the previous text in search.
boolean handleKeyUp(int keyCode, KeyEvent event)
Handles key when pressed up.
void handleOnlineShare()
Handles sharing.
void handleSaveAsCopy()
void handleSaveCroppedCopy()
void handleSaveFlattenedCopy()
void handleSaveOptimizedCopy(OptimizeParams params)
void handleSavePasswordCopy()
boolean handleSpecialFile()
Handles if the file is special case.
void handleViewFileAttachments()
void handleViewSelectedFileAttachment(File localFolder, ExternalFileInfo extFolder)
boolean hasUserCropBox()
void hideAnnotationToolbar()
Hides the annotation toolbar.
void hideBackAndForwardButtons()
Hides backward/forward buttons.
void highlightFullTextSearchResult(TextSearchResult result)
Highlights the results of full text search.
void highlightSearchResults()
Starts the TextHighlighter tool.
void imageSignatureSelected(PointF targetPoint, int targetPage, Long widget)
Called when a location or widget has been selected for adding the image signature Only one of the param should be valid
void imageStamperSelected(PointF targetPoint)
Called when a location has been selected for adding the image stamp.
boolean isAnnotationMode()
Checks if the tab is in annotation mode.
boolean isContinuousPageMode()
Checks if the tab is in continuous page mode.
boolean isDocModifiedAfterOpening()
Checks whether the document modified after opening.
boolean isDocumentReady()
Checks if the document is ready.
boolean isNavigationListShowing()
Gets whether the navigation side sheet is visible
boolean isNonContinuousVerticalPageMode()
boolean isNotPdf()
Checks whether the document is not PDF.
boolean isOpenFileFailed()
Checks if opening file failed.
boolean isPasswordProtected()
boolean isReflowMode()
Checks if the tab is in reflow mode.
boolean isRtlMode()
Checks whether right-to-left mode is enabled
boolean isSearchMode()
Checks whether it is in search mode.
boolean isSinglePageMode()
Checks if the tab is in single page mode.
boolean isTabReadOnly()
Checks if the tab is ready only.
boolean isThumbSliderVisible()
void localFileWriteAccessCheck()
Handles if local file doesn't have write access.
void moveFile(String oldFilePath)
boolean newFileSelectedFromTool(String filePath)
void onActivityResult(int requestCode, int resultCode, Intent data)
Handles the activity result
void onAddNewPage(Page page)
void onAddNewPages(Page[] pages)
void onAddProgressIndicator()
Handles when a blank page without content is added to the document as a placeholder.
void onAllAnnotationsRemoved()
The overloaded implementation of onAllAnnotationsRemoved().
void onAnnotationAction()
The overloaded implementation of onAnnotationAction().
void onAnnotationSelected(Annot annot, int pageNum)
Called when an annotation has been selected.
void onAnnotationUnselected()
Called when an annotation has been unselected.
void onAnnotationsAdded(Map<Annot, Integer> annots)
The overloaded implementation of onAnnotationsAdded(Map).
void onAnnotationsModified(Map<Annot, Integer> annots, Bundle extra)
The overloaded implementation of onAnnotationsModified(Map, Bundle)
void onAnnotationsPreModify(Map<Annot, Integer> annots)
The overloaded implementation of onAnnotationsPreModify(Map).
void onAnnotationsPreRemove(Map<Annot, Integer> annots)
The overloaded implementation of onAnnotationsPreRemove(Map).
void onAnnotationsRemoved(Map<Annot, Integer> annots)
The overloaded implementation of onAnnotationsRemoved(Map).
void onAnnotationsRemovedOnPage(int pageNum)
The overloaded implementation of onAnnotationsRemovedOnPage(int).
void onBookmarkModified()
The overloaded implementation of onBookmarkModified().
void onChangePointerIcon(PointerIcon pointerIcon)
The overloaded implementation of onChangePointerIcon(PointerIcon).
void onConfigurationChanged(Configuration newConfig)
The overloaded implementation of Fragment#onConfigurationChanged(Configuration).
void onConversionEvent(PDFViewCtrl.ConversionState state, int totalPagesConverted)
Handles an update during document conversion.
void onCreate(Bundle savedInstanceState)
The overloaded implementation of Fragment#onCreate(Bundle).
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
The overloaded implementation of Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle).
void onDeleteCurrentPage()
void onDestroy()
The overloaded implementation of Fragment#onDestroy().
void onDestroyView()
The overloaded implementation of Fragment#onDestroyView().
void onDocPagesModified()
Handles when document pages are modified.
void onDocumentLoaded()
Handles terminating document load.
boolean onDoubleTap(MotionEvent e)
The overloaded implementation of onDoubleTap(MotionEvent).
boolean onDown(MotionEvent e)
void onDownloadEvent(PDFViewCtrl.DownloadState state, int page_num, int page_downloaded, int page_count, String message)
Handles an update during download.
boolean onEnterFullscreenMode()
Called before the containing host fragment enters fullscreen mode (system status bar and navigation bar will be hidden).
boolean onExitFullscreenMode()
Called before the containing host fragment exits fullscreen mode (system status bar and/or navigation bar will be shown).
void onExportAnnotations(PDFDoc outputDoc)
Called when document annotations have been exported.
void onGenericMotionEvent(MotionEvent event)
Handles generic motion events.
void onHiddenChanged(boolean hidden)
The overloaded implementation of Fragment#onHiddenChanged(boolean).
boolean onHideToolbars()
Called when the androidx.appcompat.widget.Toolbar toolbar of the containing host fragment will be hidden.
boolean onInterceptAnnotationHandling(Annot annot, Bundle extra, ToolManager.ToolMode toolMode)
Intercept tool's response to user actions (such as clicking on links, clicking on form widget, or about to change annotation properties etc.) If handled, tool will stop default logic.
boolean onInterceptDialog(AlertDialog dialog)
Intercept handling of dialog
boolean onKeyUp(int keyCode, KeyEvent event)
Propagates onKeyUp(int, KeyEvent) to the tools.
boolean onLongPress(MotionEvent e)
The overloaded implementation of onLongPress(MotionEvent).
void onLowMemory()
The overloaded implementation of Fragment#onLowMemory().
boolean onMove(MotionEvent e1, MotionEvent e2, float x_dist, float y_dist)
The overloaded implementation of onMove(MotionEvent, MotionEvent, float, float).
void onPageChange(int old_page, int cur_page, PDFViewCtrl.PageChangeState state)
Handles changes the page number.
void onPageLabelsChanged()
Called when page labels have been changed
void onPageMoved(int from, int to)
The overloaded implementation of onPageMoved(int, int).
void onPagesAdded(List<Integer> pageList)
The overloaded implementation of onPagesAdded(List).
void onPagesCropped()
The overloaded implementation of onPagesCropped().
void onPagesDeleted(List<Integer> pageList)
The overloaded implementation of onPagesDeleted(List).
void onPagesRotated(List<Integer> pageList)
The overloaded implementation of onPagesRotated(List).
void onPause()
The overloaded implementation of Fragment#onPause().
void onPortfolioDialogFragmentFileClicked(int fileType, PortfolioDialogFragment dialog, String fileName)
void onPositionProgressIndicatorPage(Rect position)
Handles when the position of the blank page without content moves.
void onProgressIndicatorPageVisibilityChanged(boolean isVisible)
Handles when the blank page without content enters or leaves the screen.
boolean onQuickMenuClicked(QuickMenuItem menuItem)
The overloaded implementation of onQuickMenuClicked(QuickMenuItem).
void onQuickMenuDismissed()
The overloaded implementation of onQuickMenuDismissed().
void onQuickMenuShown()
The overloaded implementation of onQuickMenuShown().
void onReflowSingleTapUp(MotionEvent event)
The overloaded implementation of onReflowSingleTapUp(MotionEvent).
void onRemoveContentPendingIndicator()
Handles when the content on the page the user was previously trying to access is accessible.
void onRemoveProgressIndicator()
Handles when a blank page without content is removed from the document.
void onRenderingFinished()
Handles when PDFViewCtrl finishes rendering.
void onRenderingStarted()
Handles when PDFViewCtrl starts rendering.
void onResume()
The overloaded implementation of Fragment#onResume().
void onSaveInstanceState(Bundle outState)
boolean onScale(float x, float y)
The overloaded implementation of onScale(float, float).
boolean onScaleBegin(float x, float y)
The overloaded implementation of onScaleBegin(float, float).
boolean onScaleEnd(float x, float y)
The overloaded implementation of onScaleEnd(float, float).
void onScrollChanged(int l, int t, int oldl, int oldt)
The overloaded implementation of onScrollChanged(int, int, int, int).
void onShowContentPendingIndicator()
Handles when it user is trying to access the next page of the PDFViewCtrl but there is no room for the visual progress indicator in the viewer.
boolean onShowQuickMenu(QuickMenu quickMenu, Annot annot)
Called when quick menu is about to show.
boolean onShowToolbar()
Called when the androidx.appcompat.widget.Toolbar toolbar of the containing host fragment will be shown.
boolean onSingleTapConfirmed(MotionEvent e)
The overloaded implementation of onSingleTapConfirmed(MotionEvent).
void onStop()
The overloaded implementation of Fragment#onStop().
void onThumbSliderStartTrackingTouch()
The overloaded implementation of onThumbSliderStartTrackingTouch().
void onThumbSliderStopTrackingTouch(int pageNum)
The overloaded implementation of onThumbSliderStopTrackingTouch(int).
void onThumbnailsViewDialogDismiss(int pageNum, boolean docPagesModified)
Handles when thumbnails view dialog is dismissed.
void onUndoRedoCalled()
Handles when undo/redo operation is done.
boolean onUp(MotionEvent e, PDFViewCtrl.PriorEventMode priorEventMode)
The overloaded implementation of onUp(MotionEvent, PDFViewCtrl.PriorEventMode).
void onViewCreated(View view, Bundle savedInstanceState)
The overloaded implementation of Fragment#onViewCreated(View, Bundle).
void openNavigationList(BookmarksDialogFragment bookmarksDialogFragment, int marginTop, int marginBottom)
Opens the navigation list as a side sheet
void queryTextSubmit(String text)
Submits the query text.
void redo()
Redo the last undo operation.
void refreshPageCount()
Refreshes the number of pages.
void removeAnnotationToolbarListener(AnnotationToolbar.AnnotationToolbarListener listener)
void removeFromRecentList()
Removes the current file from the recent list.
void removeQuickMenuListener(ToolManager.QuickMenuListener listener)
void resetAutoSavingTimer()
void resetFullTextResults()
Resets full text results.
void save(boolean close, boolean forceSave, boolean skipSpecialFileCheck, boolean upload)
Saves the changes to the document.
void save(boolean close, boolean forceSave, boolean skipSpecialFileCheck)
Saves the changes to the document.
void saveExternalFile(boolean close, boolean forceSave)
Saves external document file.
void saveLocalFile(boolean close, boolean forceSave)
Saves local document file.
void setBookmarkDialogCurrentTab(int index)
Sets the which tab in bookmarks dialog should be selected.
void setCanAddToTabInfo(boolean enabled)
Sets if the file an be added to tab info.
void setColorModeChanged()
Specifies that color mode has been changed.
void setCurrentPageHelper(int nextPageNum, boolean setPDFViewCtrl)
Helper to set the current page.
static void setDebug(boolean debug)
void setHasWarnedAboutCanNotEditDuringConversion()
Specifies that the warning about can not edit during conversion has been shown.
void setReflowMode(boolean isReflowMode)
Sets the reflow mode.
void setRtlMode(boolean isRtlMode)
Sets right-to-left mode
void setSavedAndClosedShown()
Confirms that document saved toast has been shown.
void setSavingEnabled(boolean enabled)
Set enable or disable auto-saving annotations.
void setSearchMatchCase(boolean matchCase)
Sets the search rule for match case.
void setSearchMode(boolean enabled)
Sets search mode
void setSearchNavButtonsVisible(boolean visible)
Sets the visibility of search navigation buttons.
void setSearchQuery(String text)
Specifies the search query.
void setSearchSettings(boolean matchCase, boolean wholeWord)
Sets the search rules for match case and whole word.
void setSearchWholeWord(boolean wholeWord)
Sets the search rule for whole word.
void setStateEnabled(boolean enabled)
set enable or disable saving state of document from outside
void setTabListener(PdfViewCtrlTabFragment.TabListener listener)
void setThumbSliderVisible(boolean visible, boolean animateThumbSlider)
Sets the visibility of thumbnail slider.
void setViewerTopMargin(int height)
void setVisibilityOfImaginedToolbar(boolean visible)
void showAnnotationToolbar(int mode, Annot inkAnnot, int pageNum, ToolManager.ToolMode toolMode, boolean dismissAfterUse)
Shows the annotation toolbar.
void showReadOnlyAlert(DialogFragment dialogToDismiss)
void stopAutoSavingTimer()
boolean toggleReflow()
Toggles the reflow mode.
boolean toggleRtlMode()
Toggles right-to-left mode.
void toolChanged(ToolManager.Tool newTool, ToolManager.Tool oldTool)
Event called when the tool changes.
void undo()
Undo the last modification.
void updateColorMode()
Updates the color mode.
void updateCurrentPageInfo()
Updates the current page info.
void updateNavigationListLayout(int marginTop, int marginBottom, boolean animated)
void updatePrintAnnotationsMode(boolean enabled)
Updates annotation mode in print.
void updatePrintDocumentMode(boolean enabled)
Updates documentation mode in print.
void updatePrintSummaryMode(boolean enabled)
Updates summery mode in print.
void updateRecentList()
Updates the recent list.
void updateViewMode(PDFViewCtrl.PagePresentationMode pagePresentationMode)
Updates the view mode.
void userCropDialogDismiss()
Dismisses the user crop dialog.
void zoomInOutReflow(boolean flagZoomIn)
Zooms in/out reflow mode.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pdftron.pdf.PDFViewCtrl.DocumentDownloadListener
From interface com.pdftron.pdf.PDFViewCtrl.DocumentLoadListener
From interface com.pdftron.pdf.PDFViewCtrl.PageChangeListener
From interface com.pdftron.pdf.PDFViewCtrl.RenderingListener
From interface com.pdftron.pdf.PDFViewCtrl.UniversalDocumentConversionListener
From interface com.pdftron.pdf.PDFViewCtrl.UniversalDocumentProgressIndicatorListener
From interface com.pdftron.pdf.controls.ReflowControl.OnReflowTapListener
From interface com.pdftron.pdf.controls.ThumbnailSlider.OnThumbnailSliderTrackingListener
From interface com.pdftron.pdf.controls.UndoRedoPopupWindow.OnUndoRedoListener
From interface com.pdftron.pdf.dialog.PortfolioDialogFragment.PortfolioDialogFragmentListener
From interface com.pdftron.pdf.tools.ToolManager.AdvancedAnnotationListener
From interface com.pdftron.pdf.tools.ToolManager.AnnotationModificationListener
From interface com.pdftron.pdf.tools.ToolManager.BasicAnnotationListener
From interface com.pdftron.pdf.tools.ToolManager.OnGenericMotionEventListener
From interface com.pdftron.pdf.tools.ToolManager.PdfDocModificationListener
From interface com.pdftron.pdf.tools.ToolManager.PreToolManagerListener
From interface com.pdftron.pdf.tools.ToolManager.QuickMenuListener
From interface com.pdftron.pdf.tools.ToolManager.ToolChangedListener

Constants

public static final int ANIMATE_DURATION_HIDE

Constant Value: 250 (0x000000fa)

public static final int ANIMATE_DURATION_SHOW

Constant Value: 250 (0x000000fa)

public static final String BUNDLE_TAB_CONFIG

Constant Value: "bundle_tab_config"

public static final String BUNDLE_TAB_CONTENT_LAYOUT

Constant Value: "bundle_tab_content_layout"

public static final String BUNDLE_TAB_CUSTOM_HEADERS

Constant Value: "bundle_tab_custom_headers"

public static final String BUNDLE_TAB_FILE_EXTENSION

Constant Value: "bundle_tab_file_extension"

public static final String BUNDLE_TAB_ITEM_SOURCE

Constant Value: "bundle_tab_item_source"

public static final String BUNDLE_TAB_PASSWORD

Constant Value: "bundle_tab_password"

public static final String BUNDLE_TAB_PDFVIEWCTRL_ID

Constant Value: "bundle_tab_pdfviewctrl_id"

public static final String BUNDLE_TAB_TAG

Constant Value: "bundle_tab_tag"

public static final String BUNDLE_TAB_TITLE

Constant Value: "bundle_tab_title"

Public Constructors

public PdfViewCtrlTabFragment ()

Public Methods

public void addAnnotationToolbarListener (AnnotationToolbar.AnnotationToolbarListener listener)

Parameters
listener The listener

public void addQuickMenuListener (ToolManager.QuickMenuListener listener)

Parameters
listener The listener

public void annotationsCouldNotBeAdded (String errorMessage)

The overloaded implementation of annotationsCouldNotBeAdded(String).

Parameters
errorMessage The error message

public void applyCutout (int top, int bottom)

public void attachFileSelected (PointF targetPoint)

Called when a location has been selected for adding the file attachment.

Parameters
targetPoint The target location to add the file attachment

public boolean canDocBeSaved ()

Checks whether the document can be saved.

Returns
  • True if the document can be saved

public void cancelFindText ()

Cancels finding text.

public void clearPageBackAndForwardStacks ()

Clears the stacks of page backward/forward.

public void closeNavigationList ()

Closes the navigation list if it was opened as side sheet

public void createAnnotationToolbar ()

public static Bundle createBasicPdfViewCtrlTabBundle (String tag, String title, String fileExtension, String password, int itemSource, ViewerConfig config)

Returns the bundle having information needed to create a tab fragment.

Parameters
tag The tab tag
title The title of tab
fileExtension The extension of the document
password The password of the document
itemSource The source of the document FileInfo
config The configuration of the Fragment ViewerConfig
Returns
  • The bundle

public static Bundle createBasicPdfViewCtrlTabBundle (String tag, String title, String fileExtension, String password, int itemSource)

Returns the bundle having information needed to create a tab fragment.

Parameters
tag The tab tag
title The title of tab
fileExtension The extension of the document
password The password of the document
itemSource The source of the document FileInfo
Returns
  • The bundle

public static Bundle createBasicPdfViewCtrlTabBundle (Context context, Uri fileUri, String title, String password, ViewerConfig config)

Returns the bundle having information needed to create a tab fragment.

Parameters
context The context
fileUri The uri of the document
title The title of tab
password The password of the document
config The configuration of the Fragment ViewerConfig
Returns
  • The bundle

public static Bundle createBasicPdfViewCtrlTabBundle (Context context, Uri fileUri, String password, ViewerConfig config)

Returns the bundle having information needed to create a tab fragment.

Parameters
context The context
fileUri The uri of the document
password The password of the document
config The configuration of the Fragment ViewerConfig
Returns
  • The bundle

public static Bundle createBasicPdfViewCtrlTabBundle (Context context, Uri fileUri, String password)

Returns the bundle having information needed to create a tab fragment.

Parameters
context The context
fileUri The uri of the document
password The password of the document
Returns
  • The bundle

public boolean doesSaveDocNeedNewTab ()

public void exitSearchMode ()

Exits the search mode.

public void fileAttachmentSelected (FileAttachment attachment)

Called when a file attachment has been selected.

Parameters
attachment The file attachment

public void fileCreated (String filepath, ToolManager.AdvancedAnnotationListener.AnnotAction action)

Called when an annotation needs to perform an action with a file created

Parameters
filepath location of the file associated with annotation
action the specific action associated with the file

public void forceSave ()

Saves the changes to the document forcefully

public void freeTextInlineEditingStarted ()

Called when free text inline editing has started.

public void freehandStylusUsedFirstTime ()

Called when free hand stylus has been used for the firs time.

public AnnotationToolbar getAnnotationToolbar ()

Returns AnnotationToolbar associated with this tab.

Returns
  • The AnnotationToolbar

public int getBookmarkDialogCurrentTab ()

Returns which tab in bookmark dialog is selected.

Returns
  • The index of tab

public FileInfo getCurrentFileInfo ()

Returns the current file info.

Returns

public long getCurrentFileSize ()

public PageBackButtonInfo getCurrentPageInfo ()

Returns the current page info.

Returns
  • The current page info

public File getFile ()

Returns the file.

Returns
  • the file

public String getFilePath ()

Returns the path of the document

Returns
  • the path of the document

public boolean getHasWarnedAboutCanNotEditDuringConversion ()

Checks whether a warning about can not edit during conversion has been shown.

Returns
  • True if the warning has been shown

public PDFViewCtrl getPDFViewCtrl ()

Returns the PDFViewCtrl associated with this tab.

Returns
  • The PDFViewCtrl

public PDFDoc getPdfDoc ()

Returns the PDF document

Returns
  • The PDF document associated with this tab

public int getReflowTextSize ()

Returns the reflow text size.

Returns
  • The reflow text size.

public int getTabErrorCode ()

Returns the error code, if any.

See PdfDocManager

Returns
  • The error code

public int getTabSource ()

Returns the item source of the tab.

Returns
  • the item source of the tab

public String getTabTag ()

Returns the tab tag.

Returns
  • the tab tag

public String getTabTitle ()

Returns the filename of the tab

Returns
  • filename without extension

public String getTabTitleWithExtension ()

Returns the filename of the tab

Returns
  • filename with extension

public ToolManager getToolManager ()

Returns ToolManager associated with this tab.

Returns
  • The ToolManager

public Uri getUriFile ()

Returns the URI file

Returns
  • the URI file

public void gotoNextSearch ()

Goes to the next text in search.

public void gotoPreviousSearch ()

Goes to the previous text in search.

public boolean handleKeyUp (int keyCode, KeyEvent event)

Handles key when pressed up.

Parameters
keyCode The key code
event The key event
Returns
  • True if the key is handled

public void handleOnlineShare ()

Handles sharing.

public void handleSaveAsCopy ()

public void handleSaveCroppedCopy ()

public void handleSaveFlattenedCopy ()

public void handleSaveOptimizedCopy (OptimizeParams params)

public void handleSavePasswordCopy ()

public boolean handleSpecialFile ()

Handles if the file is special case.

Returns
  • True if the file is special case.

public void handleViewFileAttachments ()

public void handleViewSelectedFileAttachment (File localFolder, ExternalFileInfo extFolder)

public boolean hasUserCropBox ()

public void hideAnnotationToolbar ()

Hides the annotation toolbar.

public void hideBackAndForwardButtons ()

Hides backward/forward buttons.

public void highlightFullTextSearchResult (TextSearchResult result)

Highlights the results of full text search.

Parameters
result The TextSearchResult

public void highlightSearchResults ()

Starts the TextHighlighter tool.

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

Called when a location or widget has been selected for adding the image signature Only one of the param should be valid

Parameters
targetPoint the target location in page point
targetPage the target page
widget the target widget

public void imageStamperSelected (PointF targetPoint)

Called when a location has been selected for adding the image stamp.

Parameters
targetPoint The target location to add the image stamp

public boolean isAnnotationMode ()

Checks if the tab is in annotation mode.

Returns
  • True if the tab is in annotation mode.

public boolean isContinuousPageMode ()

Checks if the tab is in continuous page mode.

Returns
  • True if the tab is in continuous page mode

public boolean isDocModifiedAfterOpening ()

Checks whether the document modified after opening.

Returns
  • true if the document is modified after opening; false otherwise

public boolean isDocumentReady ()

Checks if the document is ready.

Returns
  • True if the document is ready

public boolean isNavigationListShowing ()

Gets whether the navigation side sheet is visible

Returns
  • true if the navigation side sheet is visible, false otherwise

public boolean isNonContinuousVerticalPageMode ()

public boolean isNotPdf ()

Checks whether the document is not PDF.

Returns
  • True if the document is not PDF

public boolean isOpenFileFailed ()

Checks if opening file failed.

Returns
  • True if opening file failed

public boolean isPasswordProtected ()

Returns
  • True if the document is password protected.

public boolean isReflowMode ()

Checks if the tab is in reflow mode.

Returns
  • True if the tab is in reflow mode

public boolean isRtlMode ()

Checks whether right-to-left mode is enabled

Returns
  • True if right-to-left mode is enabled.

public boolean isSearchMode ()

Checks whether it is in search mode.

Returns
  • true if in search mode; false otherwise

public boolean isSinglePageMode ()

Checks if the tab is in single page mode.

Returns
  • True if the tab is in single page mode

public boolean isTabReadOnly ()

Checks if the tab is ready only.

Returns
  • True if the tab is read only

public boolean isThumbSliderVisible ()

public void localFileWriteAccessCheck ()

Handles if local file doesn't have write access.

public void moveFile (String oldFilePath)

public boolean newFileSelectedFromTool (String filePath)

public void onActivityResult (int requestCode, int resultCode, Intent data)

Handles the activity result

public void onAddNewPage (Page page)

public void onAddNewPages (Page[] pages)

public void onAddProgressIndicator ()

Handles when a blank page without content is added to the document as a placeholder.

public void onAllAnnotationsRemoved ()

The overloaded implementation of onAllAnnotationsRemoved().

public void onAnnotationAction ()

The overloaded implementation of onAnnotationAction().

public void onAnnotationSelected (Annot annot, int pageNum)

Called when an annotation has been selected.

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

public void onAnnotationUnselected ()

Called when an annotation has been unselected.

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

The overloaded implementation of onAnnotationsAdded(Map).

Parameters
annots The list of annotations (a pair of annotation and the page number where the annotation is on)

public void onAnnotationsModified (Map<Annot, Integer> annots, Bundle extra)

The overloaded implementation of onAnnotationsModified(Map, Bundle)

Parameters
annots The list of annotations (a pair of annotation and the page number where the annotation is on)

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

The overloaded implementation of onAnnotationsPreModify(Map).

Parameters
annots The list of annotations (a pair of annotation and the page number where the annotation is on)

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

The overloaded implementation of onAnnotationsPreRemove(Map).

Parameters
annots The list of annotations (a pair of annotation and the page number where the annotation is on)

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

The overloaded implementation of onAnnotationsRemoved(Map).

Parameters
annots The list of annotations (a pair of annotation and the page number where the annotation is on)

public void onAnnotationsRemovedOnPage (int pageNum)

The overloaded implementation of onAnnotationsRemovedOnPage(int).

Parameters
pageNum The page number where the annotations are on

public void onBookmarkModified ()

The overloaded implementation of onBookmarkModified().

public void onChangePointerIcon (PointerIcon pointerIcon)

The overloaded implementation of onChangePointerIcon(PointerIcon).

Parameters
pointerIcon The pointer icon

public void onConfigurationChanged (Configuration newConfig)

The overloaded implementation of Fragment#onConfigurationChanged(Configuration).

public void onConversionEvent (PDFViewCtrl.ConversionState state, int totalPagesConverted)

Handles an update during document conversion.

Parameters
state - the state of update.
totalPagesConverted The total number of pages converted so far. Only relevant for the @link #CONVERSION_PROGRESS state. Note that pages can be processed in batches, and so the number might not

public void onCreate (Bundle savedInstanceState)

The overloaded implementation of Fragment#onCreate(Bundle).

public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

The overloaded implementation of Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle).

public void onDeleteCurrentPage ()

public void onDestroy ()

The overloaded implementation of Fragment#onDestroy().

public void onDestroyView ()

The overloaded implementation of Fragment#onDestroyView().

public void onDocPagesModified ()

Handles when document pages are modified.

public void onDocumentLoaded ()

Handles terminating document load.

public boolean onDoubleTap (MotionEvent e)

The overloaded implementation of onDoubleTap(MotionEvent).

public boolean onDown (MotionEvent e)

public void onDownloadEvent (PDFViewCtrl.DownloadState state, int page_num, int page_downloaded, int page_count, String message)

Handles an update during download.

Parameters
state the state of the update.
page_num the number of the page that was just downloaded. Meaningful if type is 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 onEnterFullscreenMode ()

Called before the containing host fragment enters fullscreen mode (system status bar and navigation bar will be hidden).

Returns
  • true if fullscreen mode can be entered, false otherwise.

public boolean onExitFullscreenMode ()

Called before the containing host fragment exits fullscreen mode (system status bar and/or navigation bar will be shown).

Returns
  • true if fullscreen mode can be exited, false otherwise.

public void onExportAnnotations (PDFDoc outputDoc)

Called when document annotations have been exported.

Parameters
outputDoc The PDFDoc containing the exported annotations

public void onGenericMotionEvent (MotionEvent event)

Handles generic motion events.

Parameters
event The generic motion event being processed.

public void onHiddenChanged (boolean hidden)

The overloaded implementation of Fragment#onHiddenChanged(boolean).

public boolean onHideToolbars ()

Called when the androidx.appcompat.widget.Toolbar toolbar of the containing host fragment will be hidden.

Returns
  • true if the toolbar can be hidden, false otherwise.

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

Intercept tool's response to user actions (such as clicking on links, clicking on form widget, or about to change annotation properties etc.) If handled, tool will stop default logic.

Parameters
annot annotation
extra extra information
toolMode tool mode that handles annotation
Returns
  • true then intercept the subclass function, false otherwise

public boolean onInterceptDialog (AlertDialog dialog)

Intercept handling of dialog

Parameters
dialog the dialog about to show up
Returns
  • true if intercept the subclass function, false otherwise

public boolean onKeyUp (int keyCode, KeyEvent event)

Propagates onKeyUp(int, KeyEvent) to the tools.

public boolean onLongPress (MotionEvent e)

The overloaded implementation of onLongPress(MotionEvent).

public void onLowMemory ()

The overloaded implementation of Fragment#onLowMemory().

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

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

public void onPageChange (int old_page, int cur_page, PDFViewCtrl.PageChangeState state)

Handles changes the page number.

Parameters
old_page the old page number
cur_page the current (new) page number
state in non-continuous page presentation modes and when the built-in page sliding is in process, this flag is used to indicate the state of page change.

public void onPageLabelsChanged ()

Called when page labels have been changed

public void onPageMoved (int from, int to)

The overloaded implementation of onPageMoved(int, int).

Parameters
from The page number on which the page moved from
to The page number on which the page moved to

public void onPagesAdded (List<Integer> pageList)

The overloaded implementation of onPagesAdded(List).

Parameters
pageList The list of pages added to the document

public void onPagesCropped ()

The overloaded implementation of onPagesCropped().

public void onPagesDeleted (List<Integer> pageList)

The overloaded implementation of onPagesDeleted(List).

Parameters
pageList The list of pages deleted from the document

public void onPagesRotated (List<Integer> pageList)

The overloaded implementation of onPagesRotated(List).

Parameters
pageList The list of rotated pages

public void onPause ()

The overloaded implementation of Fragment#onPause().

public void onPortfolioDialogFragmentFileClicked (int fileType, PortfolioDialogFragment dialog, String fileName)

public void onPositionProgressIndicatorPage (Rect position)

Handles when the position of the blank page without content moves.

Parameters
position position

public void onProgressIndicatorPageVisibilityChanged (boolean isVisible)

Handles when the blank page without content enters or leaves the screen.

Parameters
isVisible whether visible or not

public boolean onQuickMenuClicked (QuickMenuItem menuItem)

The overloaded implementation of onQuickMenuClicked(QuickMenuItem).

Parameters
menuItem The quick menu item
Returns
  • True if handled

public void onQuickMenuDismissed ()

The overloaded implementation of onQuickMenuDismissed().

public void onQuickMenuShown ()

The overloaded implementation of onQuickMenuShown().

public void onReflowSingleTapUp (MotionEvent event)

The overloaded implementation of onReflowSingleTapUp(MotionEvent).

Parameters
event The motion event

public void onRemoveContentPendingIndicator ()

Handles when the content on the page the user was previously trying to access is accessible.

public void onRemoveProgressIndicator ()

Handles when a blank page without content is removed from the document.

public void onRenderingFinished ()

Handles when PDFViewCtrl finishes rendering.

public void onRenderingStarted ()

Handles when PDFViewCtrl starts rendering.

public void onResume ()

The overloaded implementation of Fragment#onResume().

public void onSaveInstanceState (Bundle outState)

public boolean onScale (float x, float y)

The overloaded implementation of onScale(float, float).

public boolean onScaleBegin (float x, float y)

The overloaded implementation of onScaleBegin(float, float).

public boolean onScaleEnd (float x, float y)

The overloaded implementation of onScaleEnd(float, float).

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

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

public void onShowContentPendingIndicator ()

Handles when it user is trying to access the next page of the PDFViewCtrl but there is no room for the visual progress indicator in the viewer. For example in single page mode.

public boolean onShowQuickMenu (QuickMenu quickMenu, Annot annot)

Called when quick menu is about to show.

Parameters
quickMenu the quick menu that is about to show
annot the selected annot, null if no annot is selected
Returns
  • true if quick menu should not show

public boolean onShowToolbar ()

Called when the androidx.appcompat.widget.Toolbar toolbar of the containing host fragment will be shown.

Returns
  • true if the toolbar can be shown, false otherwise.

public boolean onSingleTapConfirmed (MotionEvent e)

The overloaded implementation of onSingleTapConfirmed(MotionEvent).

public void onStop ()

The overloaded implementation of Fragment#onStop().

public void onThumbSliderStartTrackingTouch ()

The overloaded implementation of onThumbSliderStartTrackingTouch().

public void onThumbSliderStopTrackingTouch (int pageNum)

The overloaded implementation of onThumbSliderStopTrackingTouch(int).

Parameters
pageNum The current page number on thumbnail slider

public void onThumbnailsViewDialogDismiss (int pageNum, boolean docPagesModified)

Handles when thumbnails view dialog is dismissed.

Parameters
pageNum The selected page number
docPagesModified True if the document pages are modified.

public void onUndoRedoCalled ()

Handles when undo/redo operation is done.

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

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

public void onViewCreated (View view, Bundle savedInstanceState)

The overloaded implementation of Fragment#onViewCreated(View, Bundle).

public void openNavigationList (BookmarksDialogFragment bookmarksDialogFragment, int marginTop, int marginBottom)

Opens the navigation list as a side sheet

public void queryTextSubmit (String text)

Submits the query text.

Parameters
text The query text

public void redo ()

Redo the last undo operation.

public void refreshPageCount ()

Refreshes the number of pages.

public void removeAnnotationToolbarListener (AnnotationToolbar.AnnotationToolbarListener listener)

public void removeFromRecentList ()

Removes the current file from the recent list.

public void removeQuickMenuListener (ToolManager.QuickMenuListener listener)

public void resetAutoSavingTimer ()

public void resetFullTextResults ()

Resets full text results.

public void save (boolean close, boolean forceSave, boolean skipSpecialFileCheck, boolean upload)

Saves the changes to the document.

Parameters
close True if the document should be closed
forceSave True if save should be done forcefully
skipSpecialFileCheck True if special file check should be skipped
upload True if the document should be uploaded

public void save (boolean close, boolean forceSave, boolean skipSpecialFileCheck)

Saves the changes to the document.

Parameters
close True if the document should be closed
forceSave True if save should be done forcefully
skipSpecialFileCheck True if special file check should be skipped

public void saveExternalFile (boolean close, boolean forceSave)

Saves external document file.

Parameters
close True if the document should be closed
forceSave True if save should be forcefully

public void saveLocalFile (boolean close, boolean forceSave)

Saves local document file.

Parameters
close True if the document should be closed
forceSave True if save should be forcefully

public void setBookmarkDialogCurrentTab (int index)

Sets the which tab in bookmarks dialog should be selected.

Parameters
index The index of tab

public void setCanAddToTabInfo (boolean enabled)

Sets if the file an be added to tab info.

Parameters
enabled True if enabled

public void setColorModeChanged ()

Specifies that color mode has been changed.

public void setCurrentPageHelper (int nextPageNum, boolean setPDFViewCtrl)

Helper to set the current page.

Parameters
nextPageNum The next page number
setPDFViewCtrl True if PDFViewCtrl should be set too

public static void setDebug (boolean debug)

public void setHasWarnedAboutCanNotEditDuringConversion ()

Specifies that the warning about can not edit during conversion has been shown.

public void setReflowMode (boolean isReflowMode)

Sets the reflow mode.

Parameters
isReflowMode True if reflow mode is enabled

public void setRtlMode (boolean isRtlMode)

Sets right-to-left mode

Parameters
isRtlMode True if right-to-left mode is enabled

public void setSavedAndClosedShown ()

Confirms that document saved toast has been shown.

public void setSavingEnabled (boolean enabled)

Set enable or disable auto-saving annotations.

Parameters
enabled True to enable auto-saving is enabled (default value is True), false otherwise

public void setSearchMatchCase (boolean matchCase)

Sets the search rule for match case.

Parameters
matchCase True if match case is enabled

public void setSearchMode (boolean enabled)

Sets search mode

Parameters
enabled true if search mode is enabled; false otherwise.

public void setSearchNavButtonsVisible (boolean visible)

Sets the visibility of search navigation buttons.

Parameters
visible True if visible

public void setSearchQuery (String text)

Specifies the search query.

Parameters
text The search query

public void setSearchSettings (boolean matchCase, boolean wholeWord)

Sets the search rules for match case and whole word.

Parameters
matchCase True if match case is enabled
wholeWord True if whole word is enabled

public void setSearchWholeWord (boolean wholeWord)

Sets the search rule for whole word.

Parameters
wholeWord True if whole word is enabled

public void setStateEnabled (boolean enabled)

set enable or disable saving state of document from outside

Parameters
enabled True to enable auto-saving is enabled (default value is True), false otherwise

public void setTabListener (PdfViewCtrlTabFragment.TabListener listener)

Parameters
listener The listener

public void setThumbSliderVisible (boolean visible, boolean animateThumbSlider)

Sets the visibility of thumbnail slider.

Parameters
visible True if the thumbnail slider should be visible
animateThumbSlider True if the visibility should be changed with animation

public void setViewerTopMargin (int height)

public void setVisibilityOfImaginedToolbar (boolean visible)

public void showAnnotationToolbar (int mode, Annot inkAnnot, int pageNum, ToolManager.ToolMode toolMode, boolean dismissAfterUse)

Shows the annotation toolbar.

Parameters
mode The mode that annotation toolbar should start with. Possible values are START_MODE_NORMAL_TOOLBAR, START_MODE_EDIT_TOOLBAR, START_MODE_FORM_TOOLBAR
inkAnnot The ink annotation
pageNum The page number
toolMode The tool mode annotation toolbar should start with
dismissAfterUse Whether should dismiss after use

public void showReadOnlyAlert (DialogFragment dialogToDismiss)

public void stopAutoSavingTimer ()

public boolean toggleReflow ()

Toggles the reflow mode.

Returns
  • True if the reflow mode will be enabled after toggling

public boolean toggleRtlMode ()

Toggles right-to-left mode.

Returns
  • True if right-to-left mode is on after toggling

public void toolChanged (ToolManager.Tool newTool, ToolManager.Tool oldTool)

Event called when the tool changes.

Parameters
newTool the new tool
oldTool the old tool

public void undo ()

Undo the last modification.

public void updateColorMode ()

Updates the color mode.

public void updateCurrentPageInfo ()

Updates the current page info.

public void updateNavigationListLayout (int marginTop, int marginBottom, boolean animated)

public void updatePrintAnnotationsMode (boolean enabled)

Updates annotation mode in print.

Parameters
enabled True if the annotation mode is checked

public void updatePrintDocumentMode (boolean enabled)

Updates documentation mode in print.

Parameters
enabled True if the documentation mode is checked

public void updatePrintSummaryMode (boolean enabled)

Updates summery mode in print.

Parameters
enabled True if the summery mode is checked

public void updateRecentList ()

Updates the recent list.

public void updateViewMode (PDFViewCtrl.PagePresentationMode pagePresentationMode)

Updates the view mode.

Parameters
pagePresentationMode The page presentation mode

public void userCropDialogDismiss ()

Dismisses the user crop dialog.

public void zoomInOutReflow (boolean flagZoomIn)

Zooms in/out reflow mode.

Parameters
flagZoomIn True if zoom in; False if zoom out