com.foxit.sdk.PDFViewCtrl Class Reference

Inherits ViewGroup, OnGestureListener, OnScaleGestureListener, and OnDoubleTapListener.

Classes

class  CacheOption
 
class  HttpRequestProperties
 
interface  IActivityResultListener
 
interface  IConnectedPDFEventListener
 
interface  IDocEventListener
 
interface  IDoubleTapEventListener
 
interface  IDrawEventListener
 
interface  IGestureEventListener
 
interface  ILayoutEventListener
 
interface  IPageEventListener
 
interface  IRecoveryEventListener
 
interface  IScaleGestureEventListener
 
interface  ITouchEventListener
 
interface  UIExtensionsManager
 

Public Member Functions

 PDFViewCtrl (Context context, AttributeSet attrs)
 
 PDFViewCtrl (Context context)
 
boolean addImagePage (final int dstIndex, String imagePath)
 
void addTask (Task task)
 
void appendPageView (View view)
 
void clearAllCacheFiles ()
 
void clearCacheFile (String url)
 
void closeDoc ()
 
boolean convertDisplayViewPtToPageViewPt (PointF displayViewPt, PointF pageViewPt, int pageIndex)
 
boolean convertDisplayViewRectToPageViewRect (RectF displayViewRectF, RectF pageViewRectF, int pageIndex)
 
boolean convertPageViewPtToDisplayViewPt (PointF pageViewPt, PointF displayViewPt, int pageIndex)
 
boolean convertPageViewPtToPdfPt (PointF pageViewPt, PointF pdfPt, int pageIndex)
 
boolean convertPageViewRectToDisplayViewRect (RectF pageViewRectF, RectF displayViewRectF, int pageIndex)
 
boolean convertPageViewRectToPdfRect (RectF pageViewRectF, RectF pdfRectF, int pageIndex)
 
boolean convertPdfPtToPageViewPt (PointF pdfPt, PointF pageViewPt, int pageIndex)
 
boolean convertPdfRectToPageViewRect (RectF pdfRectF, RectF pageViewRectF, int pageIndex)
 
void enableTilingRefresh (boolean isTilingRefresh)
 
AppProviderCallback getAppProvider ()
 
Activity getAttachedActivity ()
 
int getColorMode ()
 
ConnectedPDF getConnectedPDF ()
 
IConnectedPDFEventListener getConnectedPdfEventListener ()
 
int getCurrentPage ()
 
int getDensityDpi ()
 
Matrix getDisplayMatrix (int pageIndex)
 
int getDisplayViewHeight ()
 
int getDisplayViewWidth ()
 
PDFDoc getDoc ()
 
String getFilePath ()
 
int getHScrollPos ()
 
int getHScrollRange ()
 
int getMappingModeBackgroundColor ()
 
int getMappingModeForegroundColor ()
 
float getMaxZoomLimit ()
 
float getMinZoomLimit ()
 
int getPageCount ()
 
int getPageIndex (PointF displayViewPt)
 
int getPageLayoutMode ()
 
int getPageViewHeight (int pageIndex)
 
Rect getPageViewRect (int pageIndex)
 
int getPageViewWidth (int pageIndex)
 
int getReflowMode ()
 
ThumbListView getThumbnailView ()
 
UIExtensionsManager getUIExtensionsManager ()
 
int getUserPermission ()
 
int getViewRotation ()
 
int [] getVisiblePages ()
 
int getVScrollPos ()
 
int getVScrollRange ()
 
XFADoc getXFADoc ()
 
float getZoom ()
 
int getZoomMode ()
 
void gotoFirstPage ()
 
void gotoLastPage ()
 
void gotoNextPage ()
 
void gotoNextView ()
 
void gotoPage (int pageIndex)
 
void gotoPage (int pageIndex, PointF pdfPt)
 
void gotoPage (int pageIndex, float devOffsetX, float devOffsetY)
 
void gotoPrevPage ()
 
void gotoPrevView ()
 
void handleActivityResult (int requestCode, int resultCode, Intent data)
 
boolean hasNextView ()
 
boolean hasPrevView ()
 
boolean insertPages (int index, float width, float height, int style, int color, int rotation, int count)
 
boolean insertPages (int index, int size, int style, int color, int rotation, int count)
 
boolean insertPages (int dstIndex, int flags, String layerName, String srcFilePath, byte[] password, int[] pageRanges)
 
boolean insertPages (int dstIndex, int flags, String layerName, PDFDoc srcDoc, int[] pageRanges)
 
boolean isDynamicXFA ()
 
boolean isNightMode ()
 
boolean isOwner ()
 
boolean isPageVisible (int pageIndex)
 
boolean movePage (int index, int dstIndex)
 
boolean onDoubleTap (MotionEvent e)
 
boolean onDoubleTapEvent (MotionEvent e)
 
boolean onDown (MotionEvent e)
 
boolean onFling (MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
 
void onLongPress (MotionEvent e)
 
boolean onScale (ScaleGestureDetector detector)
 
boolean onScaleBegin (ScaleGestureDetector detector)
 
void onScaleEnd (ScaleGestureDetector detector)
 
boolean onScroll (MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
 
void onShowPress (MotionEvent e)
 
boolean onSingleTapConfirmed (MotionEvent e)
 
boolean onSingleTapUp (MotionEvent e)
 
boolean onTouchEvent (MotionEvent e)
 
void openDoc (final String path, final byte[] password)
 
void openDoc (Uri uri, final byte[] password)
 
void openDocFromMemory (final byte[] buffer, final byte[] password)
 
void openDocFromUrl (String url, byte[] password, CacheOption cacheOption, HttpRequestProperties properties)
 
void recoverForOOM ()
 
void refresh (int pageIndex, Rect rect)
 
void registerActivityResultListener (IActivityResultListener listener)
 
void registerDocEventListener (IDocEventListener listener)
 
void registerDoubleTapEventListener (IDoubleTapEventListener listener)
 
void registerDrawEventListener (IDrawEventListener listener)
 
void registerGestureEventListener (IGestureEventListener listener)
 
void registerLayoutEventListener (ILayoutEventListener listener)
 
void registerPageEventListener (IPageEventListener listener)
 
void registerRecoveryEventListener (IRecoveryEventListener listener)
 
void registerScaleGestureEventListener (IScaleGestureEventListener listener)
 
void registerTouchEventListener (ITouchEventListener listener)
 
boolean removePages (int[] pageIndexes)
 
void removeTask (Task task)
 
boolean rotatePages (int[] pageIndexes, int rotation)
 
void rotateView (int rotation)
 
void saveDoc (String filePath, int flag)
 
void scrollView (float distanceX, float distanceY)
 
void setAppProvider (AppProviderCallback callback)
 
void setAttachedActivity (Activity attachedActivity)
 
void setBackgroundColor (int color)
 
void setColorMode (int colorMode)
 
void setConnectedPDFEventListener (IConnectedPDFEventListener listener)
 
boolean setCropMode (int mode)
 
boolean setCropRect (int pageIndex, RectF cropRect)
 
void setDoc (PDFDoc pdfDocument)
 
void setFilePath (String filePath)
 
void setHScrollPos (int pos)
 
void setMappingModeBackgroundColor (int mappingModeBackgroundColor)
 
void setMappingModeForegroundColor (int mappingModeForegroundColor)
 
void setMaxZoomLimit (float maxZoomLimit)
 
void setMinZoomLimit (float minZoomLimit)
 
void setNightMode (boolean bNightMode)
 
void setPageLayoutMode (@PageMode int lMode)
 
void setPageSpacing (int space)
 
void setPageSpacing (int space, int direction)
 
void setReflowMode (int reflowMode)
 
void setUIExtensionsManager (UIExtensionsManager manager)
 
void setVScrollPos (int pos)
 
void setZoom (Point devicePt, float factor)
 
void setZoom (float factor)
 
void setZoomMode (int zMode)
 
void unregisterActivityResultListener (IActivityResultListener listener)
 
void unregisterDocEventListener (IDocEventListener listener)
 
void unregisterDoubleTapEventListener (IDoubleTapEventListener listener)
 
void unregisterDrawEventListener (IDrawEventListener listener)
 
void unregisterGestureEventListener (IGestureEventListener listener)
 
void unregisterLayoutEventListener (ILayoutEventListener listener)
 
void unregisterPageEventListener (IPageEventListener listener)
 
void unregisterRecoveryEventListener (IRecoveryEventListener listener)
 
void unregisterScaleGestureEventListener (IScaleGestureEventListener listener)
 
void unregisterTouchEventListener (ITouchEventListener listener)
 
void updatePagesLayout ()
 

Static Public Member Functions

static void lock ()
 
static void unlock ()
 

Public Attributes

boolean shouldRecover = true
 

Static Public Attributes

static final int PAGESPACING_HORIZONTAL = 0x0001
 
static final int PAGESPACING_VERTICAL = 0x0002
 
static final int ZOOMMODE_CUSTOMIZE = 0
 
static final int ZOOMMODE_FITHEIGHT = 2
 
static final int ZOOMMODE_FITPAGE = 3
 
static final int ZOOMMODE_FITWIDTH = 1
 

Detailed Description

Class PDFViewCtrl represents a PDF view control.

PDFViewCtrl class provides the functionaries to interact with rendering PDF documents. It implements some essential features which are required in interactive rendering applications. There are three coordinate systems for PDF view control:

  • Display View Coordinate System: Which is the displaying area of view control, all the pages will be displayed on the display view.
  • Page View Coordinate System: It use upper-left corner of the page view as origin point(0, 0).
  • PDF Coordinate System: The PDF page coordinate system.

Foxit has implemented an automatically recovering system when Foxit PDF SDK runs out of memory. When OOM happens, the Foxit PDF SDK will try to restore to the latest reading status before OOM. However, if the user has modified/added/deleted something on PDF document, those will not recovered by Foxit PDF SDK.

Constructor & Destructor Documentation

◆ PDFViewCtrl() [1/2]

com.foxit.sdk.PDFViewCtrl.PDFViewCtrl ( Context  context,
AttributeSet  attrs 
)

Construct a new PDF viewer control.

Parameters
contextA Context object which species the context.
attrsAn AttributeSet object which species the attribute set.

◆ PDFViewCtrl() [2/2]

com.foxit.sdk.PDFViewCtrl.PDFViewCtrl ( Context  context)

Construct a new PDF viewer control.

Parameters
contextA Context object which species the context.

Member Function Documentation

◆ addImagePage()

boolean com.foxit.sdk.PDFViewCtrl.addImagePage ( final int  dstIndex,
String  imagePath 
)

Add image as a page for the current document.

Parameters
dstIndexA page index in current PDF document. This is used to specify where the image will be added. If parameter dstIndex is less than 0, the image will be added to the first.
If parameter dstIndex is equal to or larger than current page count, the image will be added to the end.
imagePathThe image path. The format of the picture needs to be in line with Android's official requirements(.jpg,.png,.gif,.bmp,.webp)
Returns
true means success, while false means failure.

◆ addTask()

void com.foxit.sdk.PDFViewCtrl.addTask ( Task  task)

Add task to view control.

Parameters
taskThe task which would be added.

◆ appendPageView()

void com.foxit.sdk.PDFViewCtrl.appendPageView ( View  view)

Append a customized view after pdf page views.

Parameters
viewThe specified view to add. User-defined view is appended as the new last page view. User events and interactions of the appended view is handled by themselves. The pdf file is not changed. This method can be called multi-times.

◆ clearAllCacheFiles()

void com.foxit.sdk.PDFViewCtrl.clearAllCacheFiles ( )

Clear all the cache files.

See also
openDocFromUrl(String, byte[], CacheOption, HttpRequestProperties)

◆ clearCacheFile()

void com.foxit.sdk.PDFViewCtrl.clearCacheFile ( String  url)

Clear the cache file by the specified url.

Parameters
urlThe url of the document that used in openDocFromUrl(String, byte[], CacheOption, HttpRequestProperties)
See also
openDocFromUrl(String, byte[], CacheOption, HttpRequestProperties)

◆ closeDoc()

void com.foxit.sdk.PDFViewCtrl.closeDoc ( )

Close the displayed document.

◆ convertDisplayViewPtToPageViewPt()

boolean com.foxit.sdk.PDFViewCtrl.convertDisplayViewPtToPageViewPt ( PointF  displayViewPt,
PointF  pageViewPt,
int  pageIndex 
)

Convert display view point to page view point.

Parameters
displayViewPtThe display view point.
pageViewPtOutput parameter that receives the page view point as result.
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
true means success.
false means failure.

◆ convertDisplayViewRectToPageViewRect()

boolean com.foxit.sdk.PDFViewCtrl.convertDisplayViewRectToPageViewRect ( RectF  displayViewRectF,
RectF  pageViewRectF,
int  pageIndex 
)

Convert display view rectangle to page view rectangle.

Parameters
displayViewRectFThe display view rectangle.
pageViewRectFOutput parameter that receives the page view rectangle as result.
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
true means success.
false means failure.

◆ convertPageViewPtToDisplayViewPt()

boolean com.foxit.sdk.PDFViewCtrl.convertPageViewPtToDisplayViewPt ( PointF  pageViewPt,
PointF  displayViewPt,
int  pageIndex 
)

Convert page view point to display view point.

Parameters
pageViewPtThe page view point.
displayViewPtOutput parameter that receives the display view point as result.
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
true means success.
false means failure.

◆ convertPageViewPtToPdfPt()

boolean com.foxit.sdk.PDFViewCtrl.convertPageViewPtToPdfPt ( PointF  pageViewPt,
PointF  pdfPt,
int  pageIndex 
)

Convert page view point to PDF point.

Parameters
pageViewPtThe point on the page view.
pdfPtOutput parameter that receives the PDF point as result.
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
true means success.
false means failure.

◆ convertPageViewRectToDisplayViewRect()

boolean com.foxit.sdk.PDFViewCtrl.convertPageViewRectToDisplayViewRect ( RectF  pageViewRectF,
RectF  displayViewRectF,
int  pageIndex 
)

Convert page view rectangle to display view rectangle.

Parameters
pageViewRectFThe page view rectangle.
displayViewRectFOutput parameter that receives the display view rectangle as result.
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
true means success.
false means failure.

◆ convertPageViewRectToPdfRect()

boolean com.foxit.sdk.PDFViewCtrl.convertPageViewRectToPdfRect ( RectF  pageViewRectF,
RectF  pdfRectF,
int  pageIndex 
)

Convert page view rectangle to pdf rectangle.

Parameters
pageViewRectFThe page view rectangle.
pdfRectFOutput parameter that receives the pdf rectangle as result
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
true means success.
false means failure.

◆ convertPdfPtToPageViewPt()

boolean com.foxit.sdk.PDFViewCtrl.convertPdfPtToPageViewPt ( PointF  pdfPt,
PointF  pageViewPt,
int  pageIndex 
)

Convert pdf point to page view point coordination.

Parameters
pdfPtThe PDF point.
pageViewPtOutput parameter that receives the page view point as result
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
true means success.
false means failure.

◆ convertPdfRectToPageViewRect()

boolean com.foxit.sdk.PDFViewCtrl.convertPdfRectToPageViewRect ( RectF  pdfRectF,
RectF  pageViewRectF,
int  pageIndex 
)

Convert pdf rectangle to page view rectangle.

Parameters
pdfRectFThe PDF rectangle.
pageViewRectFOutput parameter that receives the page view rectangle as result.
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
true means success.
false means failure.

◆ enableTilingRefresh()

void com.foxit.sdk.PDFViewCtrl.enableTilingRefresh ( boolean  isTilingRefresh)

Whether to refresh page view by using tiling or not.

Parameters
isTilingRefreshtrue means using tiling refresh. or refresh the whole page view.

◆ getAppProvider()

AppProviderCallback com.foxit.sdk.PDFViewCtrl.getAppProvider ( )

Get the AppProviderCallback object.

Returns
The AppProviderCallback object.

◆ getAttachedActivity()

Activity com.foxit.sdk.PDFViewCtrl.getAttachedActivity ( )

Get the attached activity

Returns
The attached activity.

◆ getColorMode()

int com.foxit.sdk.PDFViewCtrl.getColorMode ( )

Get the colorMode

Returns
colorMode

◆ getConnectedPDF()

ConnectedPDF com.foxit.sdk.PDFViewCtrl.getConnectedPDF ( )

Get current Connected PDF.

Returns
The ConnectedPDF object.

◆ getConnectedPdfEventListener()

IConnectedPDFEventListener com.foxit.sdk.PDFViewCtrl.getConnectedPdfEventListener ( )

Get a ConnectedPDF event listener.

Returns
The IConnectedPDFEventListener object.

◆ getCurrentPage()

int com.foxit.sdk.PDFViewCtrl.getCurrentPage ( )

Get the current page index.

Returns
Current page index.

◆ getDensityDpi()

int com.foxit.sdk.PDFViewCtrl.getDensityDpi ( )

Gets density dpi.

Returns
the density dpi

◆ getDisplayMatrix()

Matrix com.foxit.sdk.PDFViewCtrl.getDisplayMatrix ( int  pageIndex)

Get the display matrix of a specified page.

Parameters
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
The display matrix.

◆ getDisplayViewHeight()

int com.foxit.sdk.PDFViewCtrl.getDisplayViewHeight ( )

Get display view height.

Returns
Height of the display view.

◆ getDisplayViewWidth()

int com.foxit.sdk.PDFViewCtrl.getDisplayViewWidth ( )

Get display view width.

Returns
Width of the display view.

◆ getDoc()

PDFDoc com.foxit.sdk.PDFViewCtrl.getDoc ( )

Get current displayed PDF document from view control

Returns
A PDFDoc object which represents current PDF document.

◆ getFilePath()

String com.foxit.sdk.PDFViewCtrl.getFilePath ( )

Return the current file path.

Returns
The current file path.

◆ getHScrollPos()

int com.foxit.sdk.PDFViewCtrl.getHScrollPos ( )

Get the horizontal scroll position.

Returns
The scrolled left position.

◆ getHScrollRange()

int com.foxit.sdk.PDFViewCtrl.getHScrollRange ( )

Get the horizontal scroll range.

Returns
The horizontal scroll range.

◆ getMappingModeBackgroundColor()

int com.foxit.sdk.PDFViewCtrl.getMappingModeBackgroundColor ( )

Get the "background color" while in Renderer#e_ColorModeMapping color mode.

You can get the current color mode by using getColorMode()

Returns
the "background color"

◆ getMappingModeForegroundColor()

int com.foxit.sdk.PDFViewCtrl.getMappingModeForegroundColor ( )

Get the "foreground color" while in Renderer#e_ColorModeMapping color mode.

You can get the current color mode by using getColorMode()

Returns
the "foreground color"

◆ getMaxZoomLimit()

float com.foxit.sdk.PDFViewCtrl.getMaxZoomLimit ( )

Get the maximum zoom bound

Returns
the maximum zoom bound, default: 12.0f

◆ getMinZoomLimit()

float com.foxit.sdk.PDFViewCtrl.getMinZoomLimit ( )

Get the minimum zoom bound

Returns
the minimum zoom bound, default: 12.0f

◆ getPageCount()

int com.foxit.sdk.PDFViewCtrl.getPageCount ( )

Get the page count of PDF document.

Returns
The count of page.

◆ getPageIndex()

int com.foxit.sdk.PDFViewCtrl.getPageIndex ( PointF  displayViewPt)

Get the page index with device point.

Parameters
displayViewPtA PointF value which specifies the device point.
Returns
The page index, starting from 0.

◆ getPageLayoutMode()

int com.foxit.sdk.PDFViewCtrl.getPageLayoutMode ( )

Get page layout mode.

Returns
The page layout mode. It would be one of constant definitions
See also
com.foxit.sdk.PDFViewCtrl::PAGELAYOUTMODE_SINGLE PAGELAYOUTMODE_XXX.

◆ getPageViewHeight()

int com.foxit.sdk.PDFViewCtrl.getPageViewHeight ( int  pageIndex)

Get the height of a specified page view.

Parameters
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
Height of the page view.

◆ getPageViewRect()

Rect com.foxit.sdk.PDFViewCtrl.getPageViewRect ( int  pageIndex)

Get the size of a specified page view relative to its parent.

Parameters
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
The rect of the whole page view in the display view coordinate.

◆ getPageViewWidth()

int com.foxit.sdk.PDFViewCtrl.getPageViewWidth ( int  pageIndex)

Get the width of a specified page view.

Parameters
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
Width of the page view.

◆ getReflowMode()

int com.foxit.sdk.PDFViewCtrl.getReflowMode ( )

Get the reflow mode

Returns
The reflow mode.

◆ getThumbnailView()

ThumbListView com.foxit.sdk.PDFViewCtrl.getThumbnailView ( )

Get the thumbnail list view.

Returns
A ThumbListView object.

◆ getUIExtensionsManager()

UIExtensionsManager com.foxit.sdk.PDFViewCtrl.getUIExtensionsManager ( )

Get UI extensions manager.

Returns
An UIExtensionsManager object which represents the UI extensions manager.

◆ getUserPermission()

int com.foxit.sdk.PDFViewCtrl.getUserPermission ( )

Get user access permissions.

Returns
User access permission. Please refer to values starting from PDFDoc#e_PermPrint and this would be one of these values.

◆ getViewRotation()

int com.foxit.sdk.PDFViewCtrl.getViewRotation ( )
Returns
the rotation of the view. Please refer to Constants.e_rotationXXX values and this should be one of these values.

◆ getVisiblePages()

int [] com.foxit.sdk.PDFViewCtrl.getVisiblePages ( )

Get an integer array which specifies indexes of current visible pages.

Returns
The indexes array for current visible pages.

◆ getVScrollPos()

int com.foxit.sdk.PDFViewCtrl.getVScrollPos ( )

Get the vertical scroll position.

Returns
The scrolled top position.

◆ getVScrollRange()

int com.foxit.sdk.PDFViewCtrl.getVScrollRange ( )

Get the vertical scroll range.

Returns
The vertical scroll range.

◆ getXFADoc()

XFADoc com.foxit.sdk.PDFViewCtrl.getXFADoc ( )

Get the current XFA document.

Returns
A XFADoc object which represents current XFA document.

◆ getZoom()

float com.foxit.sdk.PDFViewCtrl.getZoom ( )

Get the zoom factor.

Returns
Zoom factor. Default valid range from 1.0f to 12.0f. 1.0f is the value of the fit page mode (the initial model).

◆ getZoomMode()

int com.foxit.sdk.PDFViewCtrl.getZoomMode ( )

Get the current zoom mode.

It should be one of constant definitions ZOOMMODE_XXX.

Returns
The current zoom mode.

◆ gotoFirstPage()

void com.foxit.sdk.PDFViewCtrl.gotoFirstPage ( )

Go to the first page.

◆ gotoLastPage()

void com.foxit.sdk.PDFViewCtrl.gotoLastPage ( )

Go to the last page.

◆ gotoNextPage()

void com.foxit.sdk.PDFViewCtrl.gotoNextPage ( )

Go to the next page.

◆ gotoNextView()

void com.foxit.sdk.PDFViewCtrl.gotoNextView ( )

Go to next view.

◆ gotoPage() [1/3]

void com.foxit.sdk.PDFViewCtrl.gotoPage ( int  pageIndex)

Go to a specified page.

Parameters
pageIndexPage index. Valid range: from 0 to (count-1). count is the page count.

◆ gotoPage() [2/3]

void com.foxit.sdk.PDFViewCtrl.gotoPage ( int  pageIndex,
PointF  pdfPt 
)

Go to a specified page, then move to a specified position in PDF coordinate.

Parameters
pageIndexPage index. Valid range: from 0 to (count-1). count is the page count.
pdfPtThe pdf point.

◆ gotoPage() [3/3]

void com.foxit.sdk.PDFViewCtrl.gotoPage ( int  pageIndex,
float  devOffsetX,
float  devOffsetY 
)

Go to a specified page, then move to a specified position in display view coordinate system.

The new position is specified by offset X and offset Y.
Here, the left-top corner of display view coordinate system is treated as the base point. Offset X and offset Y means the offset values from left-top corner of page view coordinate system to the base point in display view coordinate system.

Parameters
pageIndexPage index. Valid range: from 0 to (count-1). count is the page count.
devOffsetXOffset X value in display view coordinate system.
devOffsetYOffset Y value in display view coordinate system.

◆ gotoPrevPage()

void com.foxit.sdk.PDFViewCtrl.gotoPrevPage ( )

Go to the previous page.

◆ gotoPrevView()

void com.foxit.sdk.PDFViewCtrl.gotoPrevView ( )

Go to previous view.

◆ handleActivityResult()

void com.foxit.sdk.PDFViewCtrl.handleActivityResult ( int  requestCode,
int  resultCode,
Intent  data 
)

Receive and handle result from activity.

NOTE: Should call this function in Activity#onActivityResult(int, int, Intent) or android.app.Fragment#onActivityResult(int, int, Intent) when you open a rms file.

Parameters
requestCodethe request code
resultCodethe result code
datathe data

◆ hasNextView()

boolean com.foxit.sdk.PDFViewCtrl.hasNextView ( )

Check if current view control has a next view.

Returns
true means current view control has a next page view. false means current view control does not have a next page view.

◆ hasPrevView()

boolean com.foxit.sdk.PDFViewCtrl.hasPrevView ( )

Check if current view control has a previous view.

Returns
true means current view control has a previous page view. false means current view control does not have a previous page view.

◆ insertPages() [1/4]

boolean com.foxit.sdk.PDFViewCtrl.insertPages ( int  index,
float  width,
float  height,
int  style,
int  color,
int  rotation,
int  count 
)

Insert a new blank PDF page to document, by index.

Parameters
indexA page index in current PDF document. This is used to specify where the imported pages will be inserted.
If parameter index is less than 0, the new page will be inserted to the first.
If parameter index is equal to or larger than the count of pages, the new page will be inserted to the end.
widthWidth of new page (unit is 1/72 inch).
heightHeight of new page (unit is 1/72 inch).
styleStyle of new page.Please refer to values starting from PDFViewCtrl#PDF_PAGE_STYLE_TYPE_BLANKand this should be one of these values. Default value: PDFViewCtrl#PDF_PAGE_STYLE_TYPE_BLANK
colorColor of new page. Format: 0xAARRGGBB.
rotationRotation value of new page. Please refer to values starting from com.foxit.sdk.common.Constants#e_Rotation0 and this should be one of these values except com.foxit.sdk.common.Constants#e_RotationUnknown
countThe count of new pages to be inserted.
Returns
true means success, while false means failure.

◆ insertPages() [2/4]

boolean com.foxit.sdk.PDFViewCtrl.insertPages ( int  index,
int  size,
int  style,
int  color,
int  rotation,
int  count 
)

Insert a new blank PDF page to document, by index.

Parameters
indexA page index in current PDF document. This is used to specify where the imported pages will be inserted.
If parameter index is less than 0, the new page will be inserted to the first.
If parameter index is equal to or larger than the count of pages, the new page will be inserted to the end.
sizeSize type of new page. Please refer to values starting from PDFPage#e_SizeLetterand this should be one of these values. Default value: PDFPage#e_SizeLetter
styleStyle of new page.Please refer to values starting from PDFViewCtrl#PDF_PAGE_STYLE_TYPE_BLANKand this should be one of these values. Default value: PDFViewCtrl#PDF_PAGE_STYLE_TYPE_BLANK
colorColor of new page. Format: 0xAARRGGBB.
rotationRotation value of new page.Please refer to values starting from com.foxit.sdk.common.Constants#e_Rotation0 and this should be one of these values except com.foxit.sdk.common.Constants#e_RotationUnknown
countThe count of new pages to be inserted.
Returns
true means success, while false means failure.

◆ insertPages() [3/4]

boolean com.foxit.sdk.PDFViewCtrl.insertPages ( int  dstIndex,
int  flags,
String  layerName,
String  srcFilePath,
byte []  password,
int []  pageRanges 
)

Start to import pages from another PDF document (via file path). After all operations are ended, you need to call the PDFViewCtrl#updatePagesLayout() to update pages layout.

Note: Currently not support to import pages from a PDF which contains XFA form.

Parameters
dstIndexA page index in current PDF document. This is used to specify where the imported pages will be inserted. If parameter dstIndex is less than 0, the imported pages will be inserted to the first.
If parameter dstIndex is equal to or larger than current page count, the imported pages will be inserted to the end.
flagsOptions for importing pages. Please refer to macro definitions PDFDoc#e_importFlagXXX and this can be one or a combination of these macros.
layerNameThe name of non-selectable label or the prefix name of the non-selectable label to be shown in layer panel of application, in UTF-8 encoding. If parameter flags contains PDFDoc#e_ImportFlagWithLayers, this should not be empty and should be a valid string. If parameter flags does not contain PDFDoc#e_ImportFlagWithLayers, this string will be ignored.
  • If all the pages of source PDF document is to be imported to current document, all layers from source document will be grouped under a non-selectable label, and this string will be directly used as the label.
  • If only part of pages of source PDF document is to be imported to current document, layers in the same page will be grouped under a single non-selectable label, and this string will be used as the prefix name of the label. The label will be like "layerName_Page_X".
srcFilePathThe file path of source PDF document, from which some pages will be imported to current PDF document.
passwordThe password string for source PDF document. It should be in UTF-8 encoding. If source PDF document is not encrypted by password, just pass an empty string.
pageRangesAn integer array which contains the page ranges of source PDF document, to be imported.
In this array, 2 numbers are a pair: the first integer is the starting page index, and the second integer is the page count.
This parameter is not null, it should contains at least 2 numbers, and the count of elements should be a multiples of 2.
Returns
true means success, while false means failure.

◆ insertPages() [4/4]

boolean com.foxit.sdk.PDFViewCtrl.insertPages ( int  dstIndex,
int  flags,
String  layerName,
PDFDoc  srcDoc,
int []  pageRanges 
)

Start to import pages from another PDF document (via file path). After all operations are ended, you need to call the PDFViewCtrl#updatePagesLayout() to update pages layout.

Note: Currently not support to import pages from a PDF which contains XFA form.

Parameters
dstIndexA page index in current PDF document. This is used to specify where the imported pages will be inserted. If parameter dstIndex is less than 0, the imported pages will be inserted to the first.
If parameter dstIndex is equal to or larger than current page count, the imported pages will be inserted to the end.
flagsOptions for importing pages. Please refer to macro definitions PDFDoc#e_importFlagXXX and this can be one or a combination of these macros.
layerNameThe name of non-selectable label or the prefix name of the non-selectable label to be shown in layer panel of application, in UTF-8 encoding. If parameter flags contains PDFDoc#e_ImportFlagWithLayers, this should not be empty and should be a valid string. If parameter flags does not contain PDFDoc#e_ImportFlagWithLayers, this string will be ignored.
  • If all the pages of source PDF document is to be imported to current document, all layers from source document will be grouped under a non-selectable label, and this string will be directly used as the label.
  • If only part of pages of source PDF document is to be imported to current document, layers in the same page will be grouped under a single non-selectable label, and this string will be used as the prefix name of the label. The label will be like "layerName_Page_X".
srcDocA PDFDoc object
See also
com.foxit.sdk.pdf.PDFDoc that represents the source PDF document, whose pages will be imported to current PDF document. Please keep this source document valid until current document will not be saved any more.
Parameters
pageRangesAn integer array which contains the page ranges of source PDF document, to be imported.
In this array, 2 numbers are a pair: the first integer is the starting page index, and the second integer is the page count.
If this parameter is not null, it should contains at least 2 numbers, and the count of elements should be a multiples of 2.
Returns
true means success, while false means failure.

◆ isDynamicXFA()

boolean com.foxit.sdk.PDFViewCtrl.isDynamicXFA ( )

Check whether the current xfa document is Dynamic xfa.

Returns
true means the current xfa document is Dynamic xfa, while false means the current xfa document is not Dynamic xfa.

◆ isNightMode()

boolean com.foxit.sdk.PDFViewCtrl.isNightMode ( )

Check if it's night mode

Returns
true means is the night mode

◆ isOwner()

boolean com.foxit.sdk.PDFViewCtrl.isOwner ( )

Check whether current user is the owner.

Returns
true means current user is the owner, while false means current user is not the owner.

◆ isPageVisible()

boolean com.foxit.sdk.PDFViewCtrl.isPageVisible ( int  pageIndex)

Check whether a specified page is visible or not.

Parameters
pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
Returns
true means the specified page is visible. false means the specified page is invisible.

◆ lock()

static void com.foxit.sdk.PDFViewCtrl.lock ( )
static

Lock to sync with page rendering process in the view control. Usually caller should call this API before page content is modified or annotation is going to reset its appearance.

◆ movePage()

boolean com.foxit.sdk.PDFViewCtrl.movePage ( int  index,
int  dstIndex 
)

Move page to destination index. After all operations are ended, you need to call the PDFViewCtrl#updatePagesLayout() to update pages layout.

Parameters
indexThe index of page which will be moved.
dstIndexThe destination index.
Returns
true means success, while false means failure.

◆ onDoubleTap()

boolean com.foxit.sdk.PDFViewCtrl.onDoubleTap ( MotionEvent  e)

Notified when a double-tap occurs.

Parameters
eThe down motion event of the first tap of the double-tap.
Returns
true means the event is consumed, while false means not.

◆ onDoubleTapEvent()

boolean com.foxit.sdk.PDFViewCtrl.onDoubleTapEvent ( MotionEvent  e)

Notified when an event within a double-tap gesture occurs, including down, move, and up events.

Parameters
eThe motion event that occurred during the double-tap gesture.
Returns
true means the event is consumed, while false means not.

◆ onDown()

boolean com.foxit.sdk.PDFViewCtrl.onDown ( MotionEvent  e)

Notified when a tap occurs with the down MotionEvent that triggered it.

This will be triggered immediately for every down event. All other events should be preceded by this.

Parameters
eThe down motion event.
Returns
true means the event is consumed.
false means not.

◆ onFling()

boolean com.foxit.sdk.PDFViewCtrl.onFling ( MotionEvent  e1,
MotionEvent  e2,
float  velocityX,
float  velocityY 
)

Notified of a fling event when it occurs with the initial on down MotionEvent and the matching up MotionEvent. The calculated velocity is supplied along the x and y axis in pixels per second.

Parameters
e1The first down motion event that started the fling.
e2The move motion event that triggered the current onFling.
velocityXThe velocity of this fling measured in pixels per second along the x axis.
velocityYThe velocity of this fling measured in pixels per second along the y axis.
Returns
true means the event is consumed, while false means not.

◆ onLongPress()

void com.foxit.sdk.PDFViewCtrl.onLongPress ( MotionEvent  e)

Notified when a long press occurs with the initial on down MotionEvent that trigger it.

It will dispatch the long-press event to function

See also
com.foxit.sdk.PDFViewCtrl.UIExtensionsManager::onTouchEvent(MotionEvent) if interface UIExtensionsManager implemented has been set to current view control.
Parameters
eThe initial on down motion event that started the long-press.

◆ onScale()

boolean com.foxit.sdk.PDFViewCtrl.onScale ( ScaleGestureDetector  detector)

Respond to scaling events for a gesture in progress. Reported by pointer motion.

Parameters
detectorThe detector reporting the event - use this to retrieve extended info about event state.
Returns
true means the detector should consider this event as handled. false means the detector does not need to consider this event as handled. If an event was not handled, the detector will continue to accumulate movement until an event is handled. This can be useful if an application, for example, only wants to update scaling factors if the change is greater than 0.01.

◆ onScaleBegin()

boolean com.foxit.sdk.PDFViewCtrl.onScaleBegin ( ScaleGestureDetector  detector)

Responds to the beginning of a scaling gesture. Reported by new pointers going down.

Parameters
detectorThe detector reporting the event - use this to retrieve extended info about event state.
Returns
true means the detector should continue recognizing this gesture. false means the detector does not need to continue recognizing this gesture. For example, if a gesture is beginning with a focal point outside of a region where it makes sense, this function may return false to ignore the rest of the gesture.

◆ onScaleEnd()

void com.foxit.sdk.PDFViewCtrl.onScaleEnd ( ScaleGestureDetector  detector)

Responds to the end of a scale gesture. Reported by existing pointers going up.

Parameters
detectorThe detector reporting the event - use this to retrieve extended info about event state.

◆ onScroll()

boolean com.foxit.sdk.PDFViewCtrl.onScroll ( MotionEvent  e1,
MotionEvent  e2,
float  distanceX,
float  distanceY 
)

Notified when a scroll occurs with the initial on down MotionEvent and the current move MotionEvent. The distance in x and y is also supplied for convenience.

Parameters
e1The first down motion event that started the scrolling.
e2The move motion event that triggered the current onScroll.
distanceXThe distance along the X axis that has been scrolled since the last call to onScroll. This is NOT the distance between
e1
and
e2
.
distanceYThe distance along the Y axis that has been scrolled since the last call to onScroll. This is NOT the distance between
e1
and
e2
.
Returns
true means the event is consumed, while false means not.

◆ onShowPress()

void com.foxit.sdk.PDFViewCtrl.onShowPress ( MotionEvent  e)

The user has performed a down MotionEvent and not performed a move or up yet. This event is commonly used to provide visual feedback to the user to let them know that their action has been recognized i.e. highlight an element.

Parameters
eThe down motion event.

◆ onSingleTapConfirmed()

boolean com.foxit.sdk.PDFViewCtrl.onSingleTapConfirmed ( MotionEvent  e)

Notified when a single-tap occurs.

It will dispatch the single-tap event to UIExtensionsManager interface and all other touch event listeners that register by function registerDoubleTapEventListener(IDoubleTapEventListener).

Parameters
eThe down motion event of the single-tap.
Returns
true means the event is consumed, while false means not.

◆ onSingleTapUp()

boolean com.foxit.sdk.PDFViewCtrl.onSingleTapUp ( MotionEvent  e)

Notified when a tap occurs with the up MotionEvent that triggered it.

Parameters
eThe up motion event that completed the first tap
Returns
true means the event is consumed, while false means not.

◆ onTouchEvent()

boolean com.foxit.sdk.PDFViewCtrl.onTouchEvent ( MotionEvent  e)

The override implementation of android.view.onTouchEvent().

It will dispatch the touch event to UIExtensionsManager interface and all other touch event listeners that register by function registerTouchEventListener(ITouchEventListener).

Parameters
eThe motion event.
Returns
true means the event was handled, while false means not.

◆ openDoc() [1/2]

void com.foxit.sdk.PDFViewCtrl.openDoc ( final String  path,
final byte []  password 
)

Open PDF document from a specified PDF file path.

Parameters
pathA PDF file path.
passwordA byte array which specifies the password used to load the PDF document content. It can be either user password or owner password. If the PDF document is not encrypted by password, just pass an empty string.

◆ openDoc() [2/2]

void com.foxit.sdk.PDFViewCtrl.openDoc ( Uri  uri,
final byte []  password 
)

Open PDF document from a specified URL.

Note that it will create a temporary file as cache for downloading the PDF file. The cache will be removed after closing the document.

Parameters
uriA PDF url.
passwordA byte array which specifies the password used to load the PDF document content. It can be either user password or owner password. If the PDF document is not encrypted by password, just pass an empty string.

◆ openDocFromMemory()

void com.foxit.sdk.PDFViewCtrl.openDocFromMemory ( final byte []  buffer,
final byte []  password 
)

Open the PDF document from memory buffer.

Parameters
bufferA memory buffer, containing the serialized document.
passwordA byte array which specifies the password used to load the PDF document content. It can be either user password or owner password. If the PDF document is not encrypted by password, just pass an empty string.

◆ openDocFromUrl()

void com.foxit.sdk.PDFViewCtrl.openDocFromUrl ( String  url,
byte []  password,
CacheOption  cacheOption,
HttpRequestProperties  properties 
)

Open PDF document from a specified URL.

Note: In the first, maybe open document from cache if there is. You should clearCacheFile(String) to delete the cache file.

Parameters
urlThe url of the document to open. It supports HTTP and HTTPS.
passwordA byte array which specifies the password used to load the PDF document content. It can be either user password or owner password. If the PDF document is not encrypted by password, just pass an empty string.
cacheOptionThe cache option used to download the PDF file, may be
null
.
propertiesThe request properties that HTTP requires, may be
null
.

◆ recoverForOOM()

void com.foxit.sdk.PDFViewCtrl.recoverForOOM ( )

Do the recovering when Foxit PDF SDK runs out of memory.

Foxit PDF SDK will call this method automatically. This needs to be used carefully. Current reading status will be restored, but all the editing to document will be lost.

◆ refresh()

void com.foxit.sdk.PDFViewCtrl.refresh ( int  pageIndex,
Rect  rect 
)

Refresh a specified rectangle area in a specified page.

Parameters
pageIndexPage index. Valid range: from 0 to (count-1). count is the page count.
rectThe specified rectangle, in page view coordinate system.

◆ registerActivityResultListener()

void com.foxit.sdk.PDFViewCtrl.registerActivityResultListener ( IActivityResultListener  listener)

Register an activity result listener.

Parameters
listenerAn IActivityResultListener object to be registered.

◆ registerDocEventListener()

void com.foxit.sdk.PDFViewCtrl.registerDocEventListener ( IDocEventListener  listener)

Register a document event listener.

Parameters
listenerAn IDocEventListener object to be registered.

◆ registerDoubleTapEventListener()

void com.foxit.sdk.PDFViewCtrl.registerDoubleTapEventListener ( IDoubleTapEventListener  listener)

Register a double tap event listener.

Parameters
listenerAn IDoubleTapEventListener object to be registered.

◆ registerDrawEventListener()

void com.foxit.sdk.PDFViewCtrl.registerDrawEventListener ( IDrawEventListener  listener)

Register a draw event listener.

Parameters
listenerAn IDrawEventListener object to be registered.

◆ registerGestureEventListener()

void com.foxit.sdk.PDFViewCtrl.registerGestureEventListener ( IGestureEventListener  listener)

Register a gesture event listener.

Parameters
listenerAn IGestureEventListener object to be registered.

◆ registerLayoutEventListener()

void com.foxit.sdk.PDFViewCtrl.registerLayoutEventListener ( ILayoutEventListener  listener)

Register a layout mode event listener.

Parameters
listenerAn ILayoutEventListener object to be registered.

◆ registerPageEventListener()

void com.foxit.sdk.PDFViewCtrl.registerPageEventListener ( IPageEventListener  listener)

Register a page event listener.

Parameters
listenerAn IPageEventListener object to be registered.

◆ registerRecoveryEventListener()

void com.foxit.sdk.PDFViewCtrl.registerRecoveryEventListener ( IRecoveryEventListener  listener)

Register an event listener for recovery from running out of memory.

Parameters
listenerAn IRecoveryEventListener object to be registered.

◆ registerScaleGestureEventListener()

void com.foxit.sdk.PDFViewCtrl.registerScaleGestureEventListener ( IScaleGestureEventListener  listener)

Register a scale gesture event listener.

Parameters
listenerAn IScaleGestureEventListener object to be registered.

◆ registerTouchEventListener()

void com.foxit.sdk.PDFViewCtrl.registerTouchEventListener ( ITouchEventListener  listener)

Register a touch event listener.

Parameters
listenerAn ITouchEventListener object to be registered.

◆ removePages()

boolean com.foxit.sdk.PDFViewCtrl.removePages ( int []  pageIndexes)

Remove pages from pdf document.

After all operations are ended, you need to call the PDFViewCtrl#updatePagesLayout() to update pages layout.

Parameters
pageIndexesAn integer array specify which pages will be removed.
Returns
true means success, while false means failure.

◆ removeTask()

void com.foxit.sdk.PDFViewCtrl.removeTask ( Task  task)

Remove the task.

Parameters
taskThe task which would be removed.

◆ rotatePages()

boolean com.foxit.sdk.PDFViewCtrl.rotatePages ( int []  pageIndexes,
int  rotation 
)

Rotate pages with specified rotation. After all operations are ended, you need to call the PDFViewCtrl#updatePagesLayout() to update pages layout.

Parameters
pageIndexesAn integer array specify which pages will be rotated.
rotationNew page rotation value. Please refer to Constants.e_rotationXXX values and this should be one of these values.
Returns
true means success, while false means failure.

◆ rotateView()

void com.foxit.sdk.PDFViewCtrl.rotateView ( int  rotation)

Rotates all pages in the document by using the specified degrees clockwise.

Note: After calling this method you must also update the page layout. See updatePagesLayout() for more information.

Parameters
rotationThe rotation to be used. Please refer to Constants.e_rotationXXX values and this should be one of these values.

◆ saveDoc()

void com.foxit.sdk.PDFViewCtrl.saveDoc ( String  filePath,
int  flag 
)

Save the displayed document to a specified file path with saving flag.

Parameters
filePathFile path for the new saved PDF file.
flagDocument saving flags. It can be one or combination of constant definitions e_saveFlagXXX.

◆ scrollView()

void com.foxit.sdk.PDFViewCtrl.scrollView ( float  distanceX,
float  distanceY 
)

Scroll display view by the specified offset.

Parameters
distanceXThe distance along the X axis that has been scrolled.
distanceYThe distance along the Y axis that has been scrolled.

◆ setAppProvider()

void com.foxit.sdk.PDFViewCtrl.setAppProvider ( AppProviderCallback  callback)

Set a customized AppProviderCallback object.

User can call this function to set a customized app provider, and this function should be called first before processing XFA document.

If this function has not been called even once, it will use the default xfa provider.

Parameters
callbackAn AppProviderCallback object, which is implemented by user and based on callback class AppProviderCallback.

◆ setAttachedActivity()

void com.foxit.sdk.PDFViewCtrl.setAttachedActivity ( Activity  attachedActivity)

Set the attached activity.

If you want open a rms file; you must set the attached activity.

Parameters
attachedActivityThe attached activity.

◆ setBackgroundColor()

void com.foxit.sdk.PDFViewCtrl.setBackgroundColor ( int  color)

Sets the background color for current view.

Parameters
colorNew background color.

◆ setColorMode()

void com.foxit.sdk.PDFViewCtrl.setColorMode ( int  colorMode)

Set color mode.

If this function is not called, default value Renderer#e_ColorModeNormal will be used.

Parameters
colorModeColor mode value. It should be one of following values:

◆ setConnectedPDFEventListener()

void com.foxit.sdk.PDFViewCtrl.setConnectedPDFEventListener ( IConnectedPDFEventListener  listener)

Set a ConnectedPDF event listener.

Parameters
listenerAn IConnectedPDFEventListener object to be set.

◆ setCropMode()

boolean com.foxit.sdk.PDFViewCtrl.setCropMode ( int  mode)

Set the page crop mode. Each page will be cropped separately according to the crop mode.

Parameters
modeCrop mode. It should be one of following values:
See also
com.foxit.sdk.PDFViewCtrl::CROPMODE_NONE means exiting crop mode.
com.foxit.sdk.PDFViewCtrl::CROPMODE_CONTENTSBOX means cropping margin according to bounding box of all contents.
com.foxit.sdk.PDFViewCtrl::CROPMODE_DETECT means cropping margin by detecting paths or images.
com.foxit.sdk.PDFViewCtrl::CROPMODE_CUSTOMIZE means cropping margin with custom pages rect from com.foxit.sdk.PDFViewCtrl::setCropRect(int, RectF). Meaningful after com.foxit.sdk.PDFViewCtrl::setCropRect(int, RectF) is called.
Returns
true means success, while false means failure.

◆ setCropRect()

boolean com.foxit.sdk.PDFViewCtrl.setCropRect ( int  pageIndex,
RectF  cropRect 
)

Set crop rect of the specified page, others are original as default. It won't take effect until calling setCropMode(int).

Parameters
pageIndexPage index of the cropped page. Valid range: from 0 to (count-1). count is the page count. -1 means the same rect to all pages.
cropRectThe crop rectangle on the PDF page, in pdf coordinate.
Returns
true means success, while false means failure.

◆ setDoc()

void com.foxit.sdk.PDFViewCtrl.setDoc ( PDFDoc  pdfDocument)

Set the PDF document object to view control, then open the document.

Parameters
pdfDocumentA PDFDoc object which specifies the pdf document to be opened.

◆ setFilePath()

void com.foxit.sdk.PDFViewCtrl.setFilePath ( String  filePath)

Set the file path of the current document.

Parameters
filePaththe path of the current document.

◆ setHScrollPos()

void com.foxit.sdk.PDFViewCtrl.setHScrollPos ( int  pos)

Set the horizontal scroll position.

Parameters
posNew horizontal scroll position. If this value is out of range of current view, it will only be displayed within the last view region.

◆ setMappingModeBackgroundColor()

void com.foxit.sdk.PDFViewCtrl.setMappingModeBackgroundColor ( int  mappingModeBackgroundColor)

Set the "background color" will be work in Renderer#e_ColorModeMapping color mode.

please call the function setColorMode(int) after setting the new "background color".

Parameters
mappingModeBackgroundColorthe "background color"

◆ setMappingModeForegroundColor()

void com.foxit.sdk.PDFViewCtrl.setMappingModeForegroundColor ( int  mappingModeForegroundColor)

set the "foreground color" will be work in Renderer#e_ColorModeMapping color mode.

please call the function setColorMode(int) after setting the new "foreground color".

Parameters
mappingModeForegroundColorthe "foreground color".

◆ setMaxZoomLimit()

void com.foxit.sdk.PDFViewCtrl.setMaxZoomLimit ( float  maxZoomLimit)

Set the maximum zoom bound

Parameters
maxZoomLimitthe maximum zoom bound, default: 12.0f

◆ setMinZoomLimit()

void com.foxit.sdk.PDFViewCtrl.setMinZoomLimit ( float  minZoomLimit)

Set the minimum zoom bound

Parameters
minZoomLimitthe minimum zoom bound, default: 1.0f

◆ setNightMode()

void com.foxit.sdk.PDFViewCtrl.setNightMode ( boolean  bNightMode)

Set night mode.

Parameters
bNightModetrue means to use night mode. false means not to use night mode.

◆ setPageLayoutMode()

void com.foxit.sdk.PDFViewCtrl.setPageLayoutMode ( @PageMode int  lMode)

Set page layout mode.

Parameters
lModePage layout mode. It should be one of constant definitions
See also
com.foxit.sdk.PDFViewCtrl::PAGELAYOUTMODE_SINGLE PAGELAYOUTMODE_XXX.

◆ setPageSpacing() [1/2]

void com.foxit.sdk.PDFViewCtrl.setPageSpacing ( int  space)

Set spacing(in pixels) between adjacent pages in the view.

Note: Currently, It supports in PDFViewCtrl#PAGELAYOUTMODE_FACING and PDFViewCtrl#PAGELAYOUTMODE_COVER mode.

Parameters
spacespacing between adjacent pages in the view. default: 2. Valid range: from 0 to 10.

◆ setPageSpacing() [2/2]

void com.foxit.sdk.PDFViewCtrl.setPageSpacing ( int  space,
int  direction 
)

Sets the vertical and horizontal spacing between adjacent pages in the view.

Note: Currently, It supports in PDFViewCtrl#PAGELAYOUTMODE_CONTINUOUS, PDFViewCtrl#PAGELAYOUTMODE_FACING and PDFViewCtrl#PAGELAYOUTMODE_COVER mode.

Parameters
spacespacing(in pixels) between adjacent pages in the view. Valid range: from 0 to 10. Note: The default value of the horizontal spacing is 2, and the default value of the vertical spacing is 10.
directionUsed to decide which kind of direction spacing will be set. Please refer to values starting from PDFViewCtrl#PAGESPACING_HORIZONTAL and this can be one or a combination of these values.

◆ setReflowMode()

void com.foxit.sdk.PDFViewCtrl.setReflowMode ( int  reflowMode)

Set the reflow mode

Parameters
reflowModeRe-flow mode. It should be one or a combination of the following enumeration definitions. Default value: ReflowPage#e_Normal|ReflowPage#e_WithImage. Please refer to ReflowPage.e_reflowXXXX values and this should be one or a combination of these values.

◆ setUIExtensionsManager()

void com.foxit.sdk.PDFViewCtrl.setUIExtensionsManager ( UIExtensionsManager  manager)

Set UI extensions manager.

Parameters
managerAn UIExtensionsManager object to be set.

◆ setVScrollPos()

void com.foxit.sdk.PDFViewCtrl.setVScrollPos ( int  pos)

Set the vertical scroll position.

Parameters
posNew vertical scroll position. If this value is out of range of current view, it will only be displayed within the last view region.

◆ setZoom() [1/2]

void com.foxit.sdk.PDFViewCtrl.setZoom ( Point  devicePt,
float  factor 
)

Set the zoom factor and re-render by using the given point as the zoom center.

You can call setMinZoomLimit(float) and setMaxZoomLimit(float) to change the limitation.

Parameters
devicePtThe device point
factorNew zoom factor. Default valid range from 1.0f to 12.0f. 1.0f is the value of the fit page mode (the initial model).

◆ setZoom() [2/2]

void com.foxit.sdk.PDFViewCtrl.setZoom ( float  factor)

Set the zoom factor and re-render.

You can call setMinZoomLimit(float) and setMaxZoomLimit(float) to change the limitation.

Parameters
factorNew zoom factor. Default valid range from 1.0f to 12.0f. 1.0f is the value of the fit page mode (the initial model).

◆ setZoomMode()

void com.foxit.sdk.PDFViewCtrl.setZoomMode ( int  zMode)

Set zoom mode.

Parameters
zModeNew zoom mode. It should be one of constant definitions ZOOMMODE_XXX.

◆ unlock()

static void com.foxit.sdk.PDFViewCtrl.unlock ( )
static

Unlock for the page rendering process.

◆ unregisterActivityResultListener()

void com.foxit.sdk.PDFViewCtrl.unregisterActivityResultListener ( IActivityResultListener  listener)

Unregister an activity result listener.

Parameters
listenerAn IActivityResultListener object to be unregistered.

◆ unregisterDocEventListener()

void com.foxit.sdk.PDFViewCtrl.unregisterDocEventListener ( IDocEventListener  listener)

Unregister a document event listener.

Parameters
listenerAn IDocEventListener object to be unregistered.

◆ unregisterDoubleTapEventListener()

void com.foxit.sdk.PDFViewCtrl.unregisterDoubleTapEventListener ( IDoubleTapEventListener  listener)

Unregister a double tap event listener.

Parameters
listenerAn IDoubleTapEventListener object to be unregistered.

◆ unregisterDrawEventListener()

void com.foxit.sdk.PDFViewCtrl.unregisterDrawEventListener ( IDrawEventListener  listener)

Unregister a draw event listener.

Parameters
listenerAn IDrawEventListener object to be unregistered.

◆ unregisterGestureEventListener()

void com.foxit.sdk.PDFViewCtrl.unregisterGestureEventListener ( IGestureEventListener  listener)

Unregister a gesture event listener.

Parameters
listenerAn IGestureEventListener object to be unregistered.

◆ unregisterLayoutEventListener()

void com.foxit.sdk.PDFViewCtrl.unregisterLayoutEventListener ( ILayoutEventListener  listener)

Unregister a layout mode event listener.

Parameters
listenerAn ILayoutEventListener object to be unregistered.

◆ unregisterPageEventListener()

void com.foxit.sdk.PDFViewCtrl.unregisterPageEventListener ( IPageEventListener  listener)

Unregister a page event listener.

Parameters
listenerAn IPageEventListener object to be unregistered.

◆ unregisterRecoveryEventListener()

void com.foxit.sdk.PDFViewCtrl.unregisterRecoveryEventListener ( IRecoveryEventListener  listener)

Unregister an event listener for recovery from running out of memory.

Parameters
listenerAn IRecoveryEventListener object to be unregistered.

◆ unregisterScaleGestureEventListener()

void com.foxit.sdk.PDFViewCtrl.unregisterScaleGestureEventListener ( IScaleGestureEventListener  listener)

Unregister a scale gesture event listener.

Parameters
listenerAn IScaleGestureEventListener object to be unregistered.

◆ unregisterTouchEventListener()

void com.foxit.sdk.PDFViewCtrl.unregisterTouchEventListener ( ITouchEventListener  listener)

Unregister a touch event listener.

Parameters
listenerAn ITouchEventListener object to be unregistered.

◆ updatePagesLayout()

void com.foxit.sdk.PDFViewCtrl.updatePagesLayout ( )

Update pages layout, you should call this function to update pages layout when some pages be removed, inserted, moved or rotates all pages.

See also
removePages(int[])
insertPages(int, int, String, PDFDoc, int[])
insertPages(int, int, String, String, byte[], int[])
movePage(int, int)
rotatePages(int[], int)
rotateView(int)

Member Data Documentation

◆ PAGESPACING_HORIZONTAL

final int com.foxit.sdk.PDFViewCtrl.PAGESPACING_HORIZONTAL = 0x0001
static

Horizontal page spacing.

◆ PAGESPACING_VERTICAL

final int com.foxit.sdk.PDFViewCtrl.PAGESPACING_VERTICAL = 0x0002
static

Vertical page spacing.

◆ shouldRecover

boolean com.foxit.sdk.PDFViewCtrl.shouldRecover = true

Used to check whether it should recover from out of memory or not. Default is true.

◆ ZOOMMODE_CUSTOMIZE

final int com.foxit.sdk.PDFViewCtrl.ZOOMMODE_CUSTOMIZE = 0
static

Zoom mode: customized mode.

◆ ZOOMMODE_FITHEIGHT

final int com.foxit.sdk.PDFViewCtrl.ZOOMMODE_FITHEIGHT = 2
static

Zoom mode: fit page height.

◆ ZOOMMODE_FITPAGE

final int com.foxit.sdk.PDFViewCtrl.ZOOMMODE_FITPAGE = 3
static

Zoom mode: fit page.

◆ ZOOMMODE_FITWIDTH

final int com.foxit.sdk.PDFViewCtrl.ZOOMMODE_FITWIDTH = 1
static

Zoom mode: fit page width.