Foxit PDF SDK
9.1
|
Inherits ViewGroup, OnGestureListener, OnScaleGestureListener, and OnDoubleTapListener.
Classes | |
class | CacheOption |
class | HttpRequestProperties |
interface | IActivityResultListener |
interface | IDocEventListener |
interface | IDoubleTapEventListener |
interface | IDrawEventListener |
interface | IExceptionLogger |
interface | IGestureEventListener |
interface | ILayoutEventListener |
interface | IPageAutoEventListener |
interface | IPageEventListener |
interface | IRecoveryEventListener |
interface | IReflowEventListener |
interface | IRenderEventListener |
interface | IScaleGestureEventListener |
interface | ITouchEventListener |
interface | PageAutoEventType |
interface | PageBinding |
interface | UIExtensionsManager |
Public Member Functions | |
void | registerDocEventListener (IDocEventListener listener) |
void | unregisterDocEventListener (IDocEventListener listener) |
void | registerPageEventListener (IPageEventListener listener) |
void | unregisterPageEventListener (IPageEventListener listener) |
void | registerLayoutEventListener (ILayoutEventListener listener) |
void | unregisterLayoutEventListener (ILayoutEventListener listener) |
boolean | rotatePages (int[] pageIndexes, int rotation) |
boolean | removePages (int[] pageIndexes) |
boolean | movePage (int index, int dstIndex) |
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 | addImagePage (final int dstIndex, String imagePath) |
void | registerRecoveryEventListener (IRecoveryEventListener listener) |
void | unregisterRecoveryEventListener (IRecoveryEventListener listener) |
void | registerDrawEventListener (IDrawEventListener listener) |
void | unregisterDrawEventListener (IDrawEventListener listener) |
void | registerRenderEventListener (IRenderEventListener listener) |
void | unregisterRenderEventListener (IRenderEventListener listener) |
void | registerReflowEventListener (IReflowEventListener listener) |
void | unregisterReflowEventListener (IReflowEventListener listener) |
void | registerTouchEventListener (ITouchEventListener listener) |
void | unregisterTouchEventListener (ITouchEventListener listener) |
void | registerGestureEventListener (IGestureEventListener listener) |
void | unregisterGestureEventListener (IGestureEventListener listener) |
void | registerScaleGestureEventListener (IScaleGestureEventListener listener) |
void | unregisterScaleGestureEventListener (IScaleGestureEventListener listener) |
void | registerDoubleTapEventListener (IDoubleTapEventListener listener) |
void | unregisterDoubleTapEventListener (IDoubleTapEventListener listener) |
void | setUIExtensionsManager (UIExtensionsManager manager) |
UIExtensionsManager | getUIExtensionsManager () |
PDFViewCtrl (Context context, AttributeSet attrs) | |
PDFViewCtrl (Context context) | |
void | recoverForOOM () |
void | setDoc (PDFDoc pdfDocument) |
PDFDoc | getDoc () |
int | getPageCount () |
void | openDoc (final String path, final byte[] password) |
void | openDocFromMemory (final byte[] buffer, final byte[] password) |
void | openDoc (Uri uri, final byte[] password) |
void | openDocFromUrl (String url, byte[] password, CacheOption cacheOption, HttpRequestProperties properties) |
void | clearCacheFile (String url) |
void | clearAllCacheFiles () |
void | openDoc (final FileReaderCallback FileReader, final byte[] password) |
void | closeDoc () |
void | saveDoc (String filePath, int flag) |
void | saveDoc (FileWriterCallback fileWriter, int flag) |
void | setHScrollPos (int pos) |
void | setVScrollPos (int pos) |
int | getHScrollPos () |
int | getVScrollPos () |
int | getVScrollRange () |
int | getHScrollRange () |
int | getCurrentPage () |
int[] | getVisiblePages () |
int[] | getCachePages () |
int | getPageIndex (PointF displayViewPt) |
int | getPageViewWidth (int pageIndex) |
int | getPageViewHeight (int pageIndex) |
Rect | getPageViewRect (int pageIndex) |
boolean | isTouchPageView (Point point) |
int | getDisplayViewWidth () |
int | getDisplayViewHeight () |
void | gotoPage (int pageIndex) |
void | gotoFirstPage () |
void | gotoLastPage () |
void | gotoPrevPage () |
void | gotoNextPage () |
void | setPageLayoutMode (@PageMode int lMode) |
int | getPageLayoutMode () |
void | setContinuous (boolean isContinuous) |
boolean | isContinuous () |
int | getReflowMode () |
void | setReflowMode (int reflowMode) |
void | setZoomMode (int zMode) |
int | getZoomMode () |
void | setZoom (Point devicePt, float factor) |
void | zoomToRect (int pageIndex, RectF pageViewRect, int fitMode) |
void | setZoom (float factor) |
float | getZoom () |
void | setKeepZoomRatio (boolean keep) |
boolean | isKeepZoomRatio () |
boolean | isNightMode () |
void | setNightMode (boolean bNightMode) |
void | setColorMode (int colorMode) |
int | getColorMode () |
int | getMappingModeBackgroundColor () |
void | setMappingModeBackgroundColor (int mappingModeBackgroundColor) |
int | getMappingModeForegroundColor () |
void | setMappingModeForegroundColor (int mappingModeForegroundColor) |
void | setBackgroundColor (int color) |
Matrix | getDisplayMatrix (int pageIndex) |
boolean | convertPageViewPtToPdfPt (PointF pageViewPt, PointF pdfPt, int pageIndex) |
boolean | convertPdfPtToPageViewPt (PointF pdfPt, PointF pageViewPt, int pageIndex) |
boolean | convertPdfRectToPageViewRect (RectF pdfRectF, RectF pageViewRectF, int pageIndex) |
boolean | convertPageViewRectToPdfRect (RectF pageViewRectF, RectF pdfRectF, int pageIndex) |
boolean | convertPageViewRectToDisplayViewRect (RectF pageViewRectF, RectF displayViewRectF, int pageIndex) |
boolean | convertDisplayViewRectToPageViewRect (RectF displayViewRectF, RectF pageViewRectF, int pageIndex) |
boolean | convertPageViewPtToDisplayViewPt (PointF pageViewPt, PointF displayViewPt, int pageIndex) |
boolean | convertDisplayViewPtToPageViewPt (PointF displayViewPt, PointF pageViewPt, int pageIndex) |
void | refresh (int pageIndex, Rect rect) |
boolean | hasPrevView () |
boolean | hasNextView () |
void | gotoPrevView () |
void | gotoNextView () |
void | slideToPreviousScreen () |
void | slideToNextScreen () |
void | gotoPage (int pageIndex, PointF pdfPt) |
void | gotoPage (int pageIndex, float devOffsetX, float devOffsetY) |
void | addNodePage (int pageIndex) |
void | updatePagesLayout () |
boolean | isPageVisible (int pageIndex) |
ThumbListView | getThumbnailView () |
boolean | onSingleTapConfirmed (MotionEvent e) |
boolean | onDoubleTap (MotionEvent e) |
boolean | onDoubleTapEvent (MotionEvent e) |
boolean | onScale (ScaleGestureDetector detector) |
boolean | onScaleBegin (ScaleGestureDetector detector) |
void | onScaleEnd (ScaleGestureDetector detector) |
boolean | onTouchEvent (MotionEvent e) |
boolean | onDown (MotionEvent e) |
void | onShowPress (MotionEvent e) |
boolean | onSingleTapUp (MotionEvent e) |
boolean | onScroll (MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) |
void | onLongPress (MotionEvent e) |
boolean | onFling (MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) |
void | addTask (Task task) |
void | removeTask (Task task) |
int | getDensityDpi () |
boolean | setCropMode (int mode) |
boolean | setCropRect (int pageIndex, RectF cropRect) |
RectF | getCropRect (int pageIndex) |
void | setFilePath (String filePath) |
String | getFilePath () |
void | enableTilingRefresh (boolean isTilingRefresh) |
void | enableTurnPageBySliding (boolean isTurnPageBySliding) |
void | appendPageView (View view) |
void | scrollView (float distanceX, float distanceY) |
void | setMaxZoomLimit (float maxZoomLimit) |
float | getMaxZoomLimit () |
void | setMinZoomLimit (float minZoomLimit) |
float | getMinZoomLimit () |
boolean | isOwner () |
int | getUserPermission () |
void | setPageSpacing (int space) |
void | setPageSpacing (int space, int direction) |
XFADoc | getXFADoc () |
boolean | isDynamicXFA () |
void | setAppProvider (AppProviderCallback callback) |
AppProviderCallback | getAppProvider () |
Activity | getAttachedActivity () |
void | setAttachedActivity (Activity attachedActivity) |
void | registerActivityResultListener (IActivityResultListener listener) |
void | unregisterActivityResultListener (IActivityResultListener listener) |
void | handleActivityResult (int requestCode, int resultCode, Intent data) |
void | rotateView (int rotation) |
int | getViewRotation () |
void | setReflowBackgroundColor (int color) |
int | getReflowBackgroundColor () |
void | enablePageFlippingByTouchBorder (boolean pageFlipping) |
boolean | isPageFlippingByTouchBorder () |
void | renderRmsWatermark (PDFPage page, Renderer renderer, Matrix2D displayMatrix) |
void | saveAsWrapperFile (String path, int flag) |
void | setPageBinding (@PageBinding int pageBinding) |
int | getPageBinding () |
void | registerPageAutoEventListener (IPageAutoEventListener listener) |
void | unregisterPageAutoEventListener (IPageAutoEventListener listener) |
void | setGestureLockFlags (int lockFlags) |
boolean | removeSecurity (PDFDoc doc) |
Static Public Member Functions | |
static void | lock () |
static void | unlock () |
static void | setExceptionLogger (Context context, String foldPath, final IExceptionLogger logger) |
Public Attributes | |
boolean | shouldRecover = true |
Static Public Attributes | |
static final int | PAGELAYOUTMODE_SINGLE = 1 |
static final int | PAGELAYOUTMODE_REFLOW = 2 |
static final int | PAGELAYOUTMODE_FACING = 3 |
static final int | PAGELAYOUTMODE_COVER = 4 |
static final int | PDF_PAGE_STYLE_TYPE_BLANK = 1 |
static final int | PDF_PAGE_STYLE_TYPE_LINED = 2 |
static final int | PDF_PAGE_STYLE_TYPE_GRID = 3 |
static final int | PDF_PAGE_STYLE_TYPE_GRAPH = 4 |
static final int | PDF_PAGE_STYLE_TYPE_MUSIC = 5 |
static final int | GESTURE_LOCK_NONE = 0 |
static final int | GESTURE_LOCK_SINGLE_TAP = 1 |
static final int | GESTURE_LOCK_DOUBLE_TAP = 1 << 1 |
static final int | GESTURE_LOCK_PINCH = 1 << 2 |
static final int | GESTURE_LOCK_PAN = 1 << 3 |
static final int | LEFT_EDGE = 0 |
static final int | RIGHT_EDGE = 1 |
static final int | AUTO_NONE = 0 |
static final int | AUTO_SCROLL_CORRECTION = 1 |
static final int | AUTO_FLING = 2 |
static final int | AUTO_SCROLL_TURNPAGE = 3 |
static final int | AUTO_ZOOMIN = 4 |
static final int | AUTO_ZOOMOUT = 5 |
static final int | AUTO_ZOOM_RECT = 6 |
static final int | ZOOMMODE_CUSTOMIZE = 0 |
static final int | ZOOMMODE_FITWIDTH = 1 |
static final int | ZOOMMODE_FITHEIGHT = 2 |
static final int | ZOOMMODE_FITPAGE = 3 |
static final int | PAGESPACING_HORIZONTAL = 0x0001 |
static final int | PAGESPACING_VERTICAL = 0x0002 |
static final int | ZOOM_FITRECT_RECT = 0 |
static final int | ZOOM_FITRECT_WIDTH = 1 |
static final int | ZOOM_FITRECT_HEIGHT = 2 |
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:
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.
com.foxit.sdk.PDFViewCtrl.PDFViewCtrl | ( | Context | context, |
AttributeSet | attrs | ||
) |
Construct a new PDF viewer control.
context | A Context object which species the context. |
attrs | An AttributeSet object which species the attribute set. |
com.foxit.sdk.PDFViewCtrl.PDFViewCtrl | ( | Context | context | ) |
Construct a new PDF viewer control.
context | A Context object which species the context. |
boolean com.foxit.sdk.PDFViewCtrl.addImagePage | ( | final int | dstIndex, |
String | imagePath | ||
) |
Add image as a page for the current document.
dstIndex | A 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. |
imagePath | The image path. The format of the picture needs to be in line with Android's official requirements(.jpg,.png,.gif,.bmp,.webp) |
true
means success, while false
means failure. void com.foxit.sdk.PDFViewCtrl.addNodePage | ( | int | pageIndex | ) |
Add the task node page of the previous operation
pageIndex | Page index. Valid range: from 0 to (count -1). count is the page count. |
void com.foxit.sdk.PDFViewCtrl.addTask | ( | Task | task | ) |
Add task to view control.
task | The task which would be added. |
void com.foxit.sdk.PDFViewCtrl.appendPageView | ( | View | view | ) |
Append a customized view after pdf page views.
view | The 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. |
void com.foxit.sdk.PDFViewCtrl.clearAllCacheFiles | ( | ) |
Clear all the cache files.
openDocFromUrl(String, byte[], CacheOption, HttpRequestProperties)
void com.foxit.sdk.PDFViewCtrl.clearCacheFile | ( | String | url | ) |
Clear the cache file by the specified url.
url | The url of the document that used in openDocFromUrl(String, byte[], CacheOption, HttpRequestProperties) openDocFromUrl(String, byte[], CacheOption, HttpRequestProperties) |
void com.foxit.sdk.PDFViewCtrl.closeDoc | ( | ) |
Close the displayed document.
boolean com.foxit.sdk.PDFViewCtrl.convertDisplayViewPtToPageViewPt | ( | PointF | displayViewPt, |
PointF | pageViewPt, | ||
int | pageIndex | ||
) |
Convert display view point to page view point.
displayViewPt | The display view point. |
pageViewPt | Output parameter that receives the page view point as result. |
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
true
means success.false
means failure. boolean com.foxit.sdk.PDFViewCtrl.convertDisplayViewRectToPageViewRect | ( | RectF | displayViewRectF, |
RectF | pageViewRectF, | ||
int | pageIndex | ||
) |
Convert display view rectangle to page view rectangle.
displayViewRectF | The display view rectangle. |
pageViewRectF | Output parameter that receives the page view rectangle as result. |
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
true
means success.false
means failure. boolean com.foxit.sdk.PDFViewCtrl.convertPageViewPtToDisplayViewPt | ( | PointF | pageViewPt, |
PointF | displayViewPt, | ||
int | pageIndex | ||
) |
Convert page view point to display view point.
pageViewPt | The page view point. |
displayViewPt | Output parameter that receives the display view point as result. |
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
true
means success.false
means failure. boolean com.foxit.sdk.PDFViewCtrl.convertPageViewPtToPdfPt | ( | PointF | pageViewPt, |
PointF | pdfPt, | ||
int | pageIndex | ||
) |
Convert page view point to PDF point.
pageViewPt | The point on the page view. |
pdfPt | Output parameter that receives the PDF point as result. |
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
true
means success.false
means failure. boolean com.foxit.sdk.PDFViewCtrl.convertPageViewRectToDisplayViewRect | ( | RectF | pageViewRectF, |
RectF | displayViewRectF, | ||
int | pageIndex | ||
) |
Convert page view rectangle to display view rectangle.
pageViewRectF | The page view rectangle. |
displayViewRectF | Output parameter that receives the display view rectangle as result. |
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
true
means success.false
means failure. boolean com.foxit.sdk.PDFViewCtrl.convertPageViewRectToPdfRect | ( | RectF | pageViewRectF, |
RectF | pdfRectF, | ||
int | pageIndex | ||
) |
Convert page view rectangle to pdf rectangle.
pageViewRectF | The page view rectangle. |
pdfRectF | Output parameter that receives the pdf rectangle as result |
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
true
means success.false
means failure. boolean com.foxit.sdk.PDFViewCtrl.convertPdfPtToPageViewPt | ( | PointF | pdfPt, |
PointF | pageViewPt, | ||
int | pageIndex | ||
) |
Convert pdf point to page view point coordination.
pdfPt | The PDF point. |
pageViewPt | Output parameter that receives the page view point as result |
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
true
means success.false
means failure. boolean com.foxit.sdk.PDFViewCtrl.convertPdfRectToPageViewRect | ( | RectF | pdfRectF, |
RectF | pageViewRectF, | ||
int | pageIndex | ||
) |
Convert pdf rectangle to page view rectangle.
pdfRectF | The PDF rectangle. |
pageViewRectF | Output parameter that receives the page view rectangle as result. |
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
true
means success.false
means failure. void com.foxit.sdk.PDFViewCtrl.enablePageFlippingByTouchBorder | ( | boolean | pageFlipping | ) |
Whether to flip the page by touching border.
pageFlipping | true means to flip page by touching border. |
void com.foxit.sdk.PDFViewCtrl.enableTilingRefresh | ( | boolean | isTilingRefresh | ) |
Whether to refresh page view by using tiling or not.
isTilingRefresh | true means using tiling refresh. or refresh the whole page view. |
void com.foxit.sdk.PDFViewCtrl.enableTurnPageBySliding | ( | boolean | isTurnPageBySliding | ) |
Whether to turn the page by sliding.
NOTE: 1: if turn the page by sliding is disabled, then you should turn pages byPDFViewCtrl#gotoPage(int) yourself. 2: This will only take effect when PDFViewCtrl#isContinuous() is false.
isTurnPageBySliding | true means turn page by sliding, or turn page without sliding |
AppProviderCallback com.foxit.sdk.PDFViewCtrl.getAppProvider | ( | ) |
Get the AppProviderCallback
object.
AppProviderCallback
object. Activity com.foxit.sdk.PDFViewCtrl.getAttachedActivity | ( | ) |
Get the attached activity
int [] com.foxit.sdk.PDFViewCtrl.getCachePages | ( | ) |
Get cached pages.
int com.foxit.sdk.PDFViewCtrl.getColorMode | ( | ) |
Get the colorMode
RectF com.foxit.sdk.PDFViewCtrl.getCropRect | ( | int | pageIndex | ) |
Return the crop rect of the specified page.
pageIndex | Page index of the cropped page. |
int com.foxit.sdk.PDFViewCtrl.getCurrentPage | ( | ) |
Get the current page index.
int com.foxit.sdk.PDFViewCtrl.getDensityDpi | ( | ) |
Gets density dpi.
Matrix com.foxit.sdk.PDFViewCtrl.getDisplayMatrix | ( | int | pageIndex | ) |
Get the display matrix of a specified page.
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
int com.foxit.sdk.PDFViewCtrl.getDisplayViewHeight | ( | ) |
Get display view height.
int com.foxit.sdk.PDFViewCtrl.getDisplayViewWidth | ( | ) |
Get display view width.
PDFDoc com.foxit.sdk.PDFViewCtrl.getDoc | ( | ) |
Get current displayed PDF document from view control
PDFDoc
object which represents current PDF document.String com.foxit.sdk.PDFViewCtrl.getFilePath | ( | ) |
Return the current file path.
int com.foxit.sdk.PDFViewCtrl.getHScrollPos | ( | ) |
Get the horizontal scroll position.
int com.foxit.sdk.PDFViewCtrl.getHScrollRange | ( | ) |
Get the horizontal scroll range.
int com.foxit.sdk.PDFViewCtrl.getMappingModeBackgroundColor | ( | ) |
Get the "background color" while in Renderer#e_ColorModeMapping or Renderer#e_ColorModeMappingGray color mode.
You can get the current color mode by using getColorMode()
int com.foxit.sdk.PDFViewCtrl.getMappingModeForegroundColor | ( | ) |
Get the "foreground color" while in Renderer#e_ColorModeMapping or Renderer#e_ColorModeMappingGray color mode.
You can get the current color mode by using getColorMode()
float com.foxit.sdk.PDFViewCtrl.getMaxZoomLimit | ( | ) |
Get the maximum zoom bound
float com.foxit.sdk.PDFViewCtrl.getMinZoomLimit | ( | ) |
Get the minimum zoom bound
int com.foxit.sdk.PDFViewCtrl.getPageBinding | ( | ) |
Get the current document's PageBinding.
int com.foxit.sdk.PDFViewCtrl.getPageCount | ( | ) |
Get the page count of PDF document.
int com.foxit.sdk.PDFViewCtrl.getPageIndex | ( | PointF | displayViewPt | ) |
Get the page index with device point.
displayViewPt | A PointF value which specifies the device point. |
int com.foxit.sdk.PDFViewCtrl.getPageLayoutMode | ( | ) |
Get page layout mode.
int com.foxit.sdk.PDFViewCtrl.getPageViewHeight | ( | int | pageIndex | ) |
Get the height of a specified page view.
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
Rect com.foxit.sdk.PDFViewCtrl.getPageViewRect | ( | int | pageIndex | ) |
Get the size of a specified page view relative to its parent.
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
int com.foxit.sdk.PDFViewCtrl.getPageViewWidth | ( | int | pageIndex | ) |
Get the width of a specified page view.
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
int com.foxit.sdk.PDFViewCtrl.getReflowBackgroundColor | ( | ) |
Gets the background color in reflow mode
int com.foxit.sdk.PDFViewCtrl.getReflowMode | ( | ) |
Get the reflow mode
ReflowPage#e_Normal|ReflowPage#e_WithImage
. ThumbListView com.foxit.sdk.PDFViewCtrl.getThumbnailView | ( | ) |
Get the thumbnail list view.
UIExtensionsManager com.foxit.sdk.PDFViewCtrl.getUIExtensionsManager | ( | ) |
Get UI extensions manager.
UIExtensionsManager
object which represents the UI extensions manager. int com.foxit.sdk.PDFViewCtrl.getUserPermission | ( | ) |
Get user access permissions.
int com.foxit.sdk.PDFViewCtrl.getViewRotation | ( | ) |
int [] com.foxit.sdk.PDFViewCtrl.getVisiblePages | ( | ) |
Get an integer array which specifies indexes of current visible pages.
int com.foxit.sdk.PDFViewCtrl.getVScrollPos | ( | ) |
Get the vertical scroll position.
int com.foxit.sdk.PDFViewCtrl.getVScrollRange | ( | ) |
Get the vertical scroll range.
XFADoc com.foxit.sdk.PDFViewCtrl.getXFADoc | ( | ) |
Get the current XFA document.
XFADoc
object which represents current XFA document.float com.foxit.sdk.PDFViewCtrl.getZoom | ( | ) |
Get the zoom factor.
int com.foxit.sdk.PDFViewCtrl.getZoomMode | ( | ) |
Get the current zoom mode.
void com.foxit.sdk.PDFViewCtrl.gotoFirstPage | ( | ) |
Go to the first page.
void com.foxit.sdk.PDFViewCtrl.gotoLastPage | ( | ) |
Go to the last page.
void com.foxit.sdk.PDFViewCtrl.gotoNextPage | ( | ) |
Go to the next page.
void com.foxit.sdk.PDFViewCtrl.gotoNextView | ( | ) |
Go to next view.
void com.foxit.sdk.PDFViewCtrl.gotoPage | ( | int | pageIndex | ) |
Go to a specified page.
pageIndex | Page index. Valid range: from 0 to (count -1). count is the page count. |
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.
pageIndex | Page index. Valid range: from 0 to (count -1). count is the page count. |
devOffsetX | Offset X value in display view coordinate system. |
devOffsetY | Offset Y value in display view coordinate system. |
void com.foxit.sdk.PDFViewCtrl.gotoPage | ( | int | pageIndex, |
PointF | pdfPt | ||
) |
Go to a specified page, then move to a specified position in PDF coordinate.
pageIndex | Page index. Valid range: from 0 to (count -1). count is the page count. |
pdfPt | The pdf point. |
void com.foxit.sdk.PDFViewCtrl.gotoPrevPage | ( | ) |
Go to the previous page.
void com.foxit.sdk.PDFViewCtrl.gotoPrevView | ( | ) |
Go to previous view.
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.
requestCode | the request code |
resultCode | the result code |
data | the data |
boolean com.foxit.sdk.PDFViewCtrl.hasNextView | ( | ) |
Check if current view control has a next view.
true
means current view control has a next page view. false
means current view control does not have a next page view. boolean com.foxit.sdk.PDFViewCtrl.hasPrevView | ( | ) |
Check if current view control has a previous view.
true
means current view control has a previous page view. false
means current view control does not have a previous page view. 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.
dstIndex | A 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. |
flags | Options for importing pages. Please refer to values starting from PDFDoc#e_ImportFlagNormal and this can be one or combination of these values. |
layerName | The 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.
|
srcDoc | A PDFDoc object 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. |
pageRanges | An 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. |
true
means success, while false
means failure. 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.
dstIndex | A 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. |
flags | Options for importing pages. Please refer to values starting from PDFDoc#e_ImportFlagNormal and this can be one or combination of these values. |
layerName | The 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.
|
srcFilePath | The file path of source PDF document, from which some pages will be imported to current PDF document. |
password | The 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. |
pageRanges | An 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. |
true
means success, while false
means failure. 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.
index | A 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. |
width | Width of new page (unit is 1/72 inch). |
height | Height of new page (unit is 1/72 inch). |
style | Style 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 |
color | Color of new page. Format: 0xAARRGGBB. |
rotation | Rotation 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 |
count | The count of new pages to be inserted. |
true
means success, while false
means failure. 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.
index | A 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. |
size | Size 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 |
style | Style 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 |
color | Color of new page. Format: 0xAARRGGBB. |
rotation | Rotation 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 |
count | The count of new pages to be inserted. |
true
means success, while false
means failure. boolean com.foxit.sdk.PDFViewCtrl.isContinuous | ( | ) |
Whether the page layout mode is continuous. Note: It's invalid for PDFViewCtrl#PAGELAYOUTMODE_REFLOW mode.
true
means page layout mode is continuous. boolean com.foxit.sdk.PDFViewCtrl.isDynamicXFA | ( | ) |
Check whether the current xfa document is Dynamic xfa.
true
means the current xfa document is Dynamic xfa, while false
means the current xfa document is not Dynamic xfa. boolean com.foxit.sdk.PDFViewCtrl.isKeepZoomRatio | ( | ) |
Get whether to keep the zoom ratio when turning pages in non-continuous page mode.
true
means to keep the zoom ratio when turning pages in non-continuous page mode. boolean com.foxit.sdk.PDFViewCtrl.isNightMode | ( | ) |
boolean com.foxit.sdk.PDFViewCtrl.isOwner | ( | ) |
Check whether current user is the owner.
true
means current user is the owner, while false
means current user is not the owner. boolean com.foxit.sdk.PDFViewCtrl.isPageFlippingByTouchBorder | ( | ) |
Check whether to flip the page by touching border.
true
means current user is the owner, while false
means current user is not the owner. boolean com.foxit.sdk.PDFViewCtrl.isPageVisible | ( | int | pageIndex | ) |
Check whether a specified page is visible or not.
pageIndex | Page index.Valid range: from 0 to (count -1). count is the page count. |
true
means the specified page is visible. false
means the specified page is invisible. boolean com.foxit.sdk.PDFViewCtrl.isTouchPageView | ( | Point | point | ) |
Whether to click page view
point | Press the position |
|
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.
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.
index | The index of page which will be moved. |
dstIndex | The destination index. |
true
means success, while false
means failure. boolean com.foxit.sdk.PDFViewCtrl.onDoubleTap | ( | MotionEvent | e | ) |
Notified when a double-tap occurs.
e | The down motion event of the first tap of the double-tap. |
true
means the event is consumed, while false
means not. boolean com.foxit.sdk.PDFViewCtrl.onDoubleTapEvent | ( | MotionEvent | e | ) |
Notified when an event within a double-tap gesture occurs, including down, move, and up events.
e | The motion event that occurred during the double-tap gesture. |
true
means the event is consumed, while false
means not. 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.
e | The down motion event. |
true
means the event is consumed.false
means not. 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.
e1 | The first down motion event that started the fling. |
e2 | The move motion event that triggered the current onFling. |
velocityX | The velocity of this fling measured in pixels per second along the x axis. |
velocityY | The velocity of this fling measured in pixels per second along the y axis. |
true
means the event is consumed, while false
means not. 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
e | The initial on down motion event that started the long-press. com.foxit.sdk.PDFViewCtrl.UIExtensionsManager#onTouchEvent(MotionEvent) if interface UIExtensionsManager implemented has been set to current view control. |
boolean com.foxit.sdk.PDFViewCtrl.onScale | ( | ScaleGestureDetector | detector | ) |
Respond to scaling events for a gesture in progress. Reported by pointer motion.
detector | The detector reporting the event - use this to retrieve extended info about event state. |
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. boolean com.foxit.sdk.PDFViewCtrl.onScaleBegin | ( | ScaleGestureDetector | detector | ) |
Responds to the beginning of a scaling gesture. Reported by new pointers going down.
detector | The detector reporting the event - use this to retrieve extended info about event state. |
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. void com.foxit.sdk.PDFViewCtrl.onScaleEnd | ( | ScaleGestureDetector | detector | ) |
Responds to the end of a scale gesture. Reported by existing pointers going up.
detector | The detector reporting the event - use this to retrieve extended info about event state. |
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.
e1 | The first down motion event that started the scrolling. |
e2 | The move motion event that triggered the current onScroll. |
distanceX | The distance along the X axis that has been scrolled since the last call to onScroll. This is NOT the distance between e1
e2
|
distanceY | The distance along the Y axis that has been scrolled since the last call to onScroll. This is NOT the distance between e1
e2
|
true
means the event is consumed, while false
means not. 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.
e | The down motion event. |
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).
e | The down motion event of the single-tap. |
true
means the event is consumed, while false
means not. boolean com.foxit.sdk.PDFViewCtrl.onSingleTapUp | ( | MotionEvent | e | ) |
Notified when a tap occurs with the up MotionEvent that triggered it.
e | The up motion event that completed the first tap |
true
means the event is consumed, while false
means not. 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).
e | The motion event. |
true
means the event was handled, while false
means not. void com.foxit.sdk.PDFViewCtrl.openDoc | ( | final FileReaderCallback | FileReader, |
final byte[] | password | ||
) |
Open PDF document from a specified FileReaderCallback.
FileReader | A FileReaderCallback used to be open the PDF file. |
password | A 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. |
void com.foxit.sdk.PDFViewCtrl.openDoc | ( | final String | path, |
final byte[] | password | ||
) |
Open PDF document from a specified PDF file path.
path | A PDF file path. |
password | A 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. |
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.
uri | A PDF url. |
password | A 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. |
void com.foxit.sdk.PDFViewCtrl.openDocFromMemory | ( | final byte[] | buffer, |
final byte[] | password | ||
) |
Open the PDF document from memory buffer.
buffer | A memory buffer, containing the serialized document. |
password | A 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. |
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.
url | The url of the document to open. It supports HTTP and HTTPS. |
password | A 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. |
cacheOption | The cache option used to download the PDF file, may be null
|
properties | The request properties that HTTP requires, may be null
|
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.
void com.foxit.sdk.PDFViewCtrl.refresh | ( | int | pageIndex, |
Rect | rect | ||
) |
Refresh a specified rectangle area in a specified page.
pageIndex | Page index. Valid range: from 0 to (count -1). count is the page count. |
rect | The specified rectangle, in page view coordinate system. |
void com.foxit.sdk.PDFViewCtrl.registerActivityResultListener | ( | IActivityResultListener | listener | ) |
Register an activity result listener.
listener | An IActivityResultListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerDocEventListener | ( | IDocEventListener | listener | ) |
Register a document event listener.
listener | An IDocEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerDoubleTapEventListener | ( | IDoubleTapEventListener | listener | ) |
Register a double tap event listener.
listener | An IDoubleTapEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerDrawEventListener | ( | IDrawEventListener | listener | ) |
Register a draw event listener.
listener | An IDrawEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerGestureEventListener | ( | IGestureEventListener | listener | ) |
Register a gesture event listener.
listener | An IGestureEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerLayoutEventListener | ( | ILayoutEventListener | listener | ) |
Register a layout mode event listener.
listener | An ILayoutEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerPageAutoEventListener | ( | IPageAutoEventListener | listener | ) |
Register a page auto event listener.
listener | An IPageAutoEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerPageEventListener | ( | IPageEventListener | listener | ) |
Register a page event listener.
listener | An IPageEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerRecoveryEventListener | ( | IRecoveryEventListener | listener | ) |
Register an event listener for recovery from running out of memory.
listener | An IRecoveryEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerReflowEventListener | ( | IReflowEventListener | listener | ) |
Register a reflow event listener.
listener | An IReflowEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerRenderEventListener | ( | IRenderEventListener | listener | ) |
Register a render event listener.
listener | An IRenderEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerScaleGestureEventListener | ( | IScaleGestureEventListener | listener | ) |
Register a scale gesture event listener.
listener | An IScaleGestureEventListener object to be registered. |
void com.foxit.sdk.PDFViewCtrl.registerTouchEventListener | ( | ITouchEventListener | listener | ) |
Register a touch event listener.
listener | An ITouchEventListener object to be registered. |
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.
pageIndexes | An integer array specify which pages will be removed. |
true
means success, while false
means failure. boolean com.foxit.sdk.PDFViewCtrl.removeSecurity | ( | PDFDoc | doc | ) |
Remove the security handler from document, so that the later saved document will be unencrypted. The result is same as calling doc.removeSecurity();
doc | The PDF document object. |
true
means the security handler is removed.false
means not. void com.foxit.sdk.PDFViewCtrl.removeTask | ( | Task | task | ) |
Remove the task.
task | The task which would be removed. |
void com.foxit.sdk.PDFViewCtrl.renderRmsWatermark | ( | PDFPage | page, |
Renderer | renderer, | ||
Matrix2D | displayMatrix | ||
) |
Render RMS Watermark while the document is RMS file and has watermark.
NOTE: if the specified page is not in the range. Foxit PDF SDK will do not render the watermark.
page | A valid PDFPage object. |
renderer | A valid Renderer object. |
displayMatrix | The transformation matrix used for rendering, which is usually returned by function PDFPage#getDisplayMatrix(int, int, int, int, int). |
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.
pageIndexes | An integer array specify which pages will be rotated. |
rotation | New page rotation value. Please refer to values starting from com.foxit.sdk.common.Constants#e_Rotation0 and this should be one of these values. |
true
means success, while false
means failure. 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.
rotation | The rotation to be used. Please refer to values starting from com.foxit.sdk.common.Constants#e_Rotation0 and this should be one of these values. |
void com.foxit.sdk.PDFViewCtrl.saveAsWrapperFile | ( | String | path, |
int | flag | ||
) |
Save the current document as a wrapper file
NOTE: Now. Just call this function if the current PDF document is an RMS PDF file.
path | A full path of a PDF file. Current PDF document will be saved into this PDF file as a wrapper file. |
flag | Document saving flags. Please refer to values starting from PDFDoc#e_SaveFlagNormal and this can be one or combination of these values. |
void com.foxit.sdk.PDFViewCtrl.saveDoc | ( | FileWriterCallback | fileWriter, |
int | flag | ||
) |
Save the displayed document to a specified file writer callback with saving flag.
fileWriter | File writer callback for the new saved PDF file. |
flag | Document saving flags. Please refer to values starting from PDFDoc#e_SaveFlagNormal and this can be one or combination of these values. |
void com.foxit.sdk.PDFViewCtrl.saveDoc | ( | String | filePath, |
int | flag | ||
) |
Save the displayed document to a specified file path with saving flag.
filePath | File path for the new saved PDF file. |
flag | Document saving flags. Please refer to values starting from PDFDoc#e_SaveFlagNormal and this can be one or combination of these values. |
void com.foxit.sdk.PDFViewCtrl.scrollView | ( | float | distanceX, |
float | distanceY | ||
) |
Scroll display view by the specified offset.
distanceX | The distance along the X axis that has been scrolled. |
distanceY | The distance along the Y axis that has been scrolled. |
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.
callback | An AppProviderCallback object, which is implemented by user and based on callback class AppProviderCallback . |
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.
attachedActivity | The attached activity. |
void com.foxit.sdk.PDFViewCtrl.setBackgroundColor | ( | int | color | ) |
Set the background color for current view.
color | New background color. Format: 0xRRGGBB. |
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.
colorMode | Color mode value. It should be one of following values:
|
void com.foxit.sdk.PDFViewCtrl.setContinuous | ( | boolean | isContinuous | ) |
set page layout mode to continuous. Note: It's invalid for PDFViewCtrl#PAGELAYOUTMODE_REFLOW mode.
isContinuous | true means page layout mode use continuous. |
boolean com.foxit.sdk.PDFViewCtrl.setCropMode | ( | int | mode | ) |
Set the page crop mode. Each page will be cropped separately according to the crop mode.
mode | Crop mode. It should be one of following values: 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 setCropRect(int, RectF). Meaningful after setCropRect(int, RectF) is called. |
true
means success, while false
means failure. 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)
.
pageIndex | Page 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. |
cropRect | The crop rectangle on the PDF page, in pdf coordinate, make sure left <= right, and bottom <= top. |
true
means success, while false
means failure. void com.foxit.sdk.PDFViewCtrl.setDoc | ( | PDFDoc | pdfDocument | ) |
Set the PDF document object to view control, then open the document.
pdfDocument | A PDFDoc object which specifies the pdf document to be opened. |
|
static |
The exception logger is for collecting info of exceptions or crashes. It will catch the unhandled Exception and application-wide signals.
context | The context of the application object of the current process. |
foldPath | The directory to save crash log files. If it is set to null, then SDK will save the log files to the default directory. (Default: android.content.Context#getFilesDir() + "/tombstones") |
logger | A protocal to be implemented for getting the exception info. If it is set to null, then SDK will not catch the exceptions. |
void com.foxit.sdk.PDFViewCtrl.setFilePath | ( | String | filePath | ) |
Set the file path of the current document.
filePath | the path of the current document. |
void com.foxit.sdk.PDFViewCtrl.setGestureLockFlags | ( | int | lockFlags | ) |
Set the gesture lock flags.
The gesture lock flags are used to control the gesture lock behavior. Please refer to values starting from PDFViewCtrl#GESTURE_LOCK_NONE and this can be one or combination of these values.
lockFlags | The gesture lock flags to be set. |
void com.foxit.sdk.PDFViewCtrl.setHScrollPos | ( | int | pos | ) |
Set the horizontal scroll position.
pos | New horizontal scroll position. If this value is out of range of current view, it will only be displayed within the last view region. |
void com.foxit.sdk.PDFViewCtrl.setKeepZoomRatio | ( | boolean | keep | ) |
Set whether to keep the zoom ratio when turning pages in non-continuous page mode
keep | true means to keep the zoom ratio when turning pages in non-continuous page mode. |
void com.foxit.sdk.PDFViewCtrl.setMappingModeBackgroundColor | ( | int | mappingModeBackgroundColor | ) |
Set the "background color" will be work in Renderer#e_ColorModeMapping or Renderer#e_ColorModeMappingGray color mode.
Please call the function setColorMode(int) after setting the new "background color".
mappingModeBackgroundColor | The "background color". Format: 0xAARRGGBB. |
void com.foxit.sdk.PDFViewCtrl.setMappingModeForegroundColor | ( | int | mappingModeForegroundColor | ) |
Set the "foreground color" will be work in Renderer#e_ColorModeMapping or Renderer#e_ColorModeMappingGray color mode.
Please call the function setColorMode(int) after setting the new "foreground color".
mappingModeForegroundColor | The "foreground color". Format: 0xAARRGGBB. |
void com.foxit.sdk.PDFViewCtrl.setMaxZoomLimit | ( | float | maxZoomLimit | ) |
Set the maximum zoom bound.
This method sets the upper limit for zooming in. The maximum zoom limit cannot be less than 1. If a value less than 1 is provided, it will be ignored and the default value will remain in effect.
maxZoomLimit | the maximum zoom bound, default: 8.0f |
void com.foxit.sdk.PDFViewCtrl.setMinZoomLimit | ( | float | minZoomLimit | ) |
Set the minimum zoom bound
This method sets the lower limit for zooming out. The minimum zoom limit must be greater than 0 and cannot exceed 1. If a value outside this range is provided, it will be ignored, and the default value will remain in effect.
minZoomLimit | the minimum zoom bound, default: 1.0f |
void com.foxit.sdk.PDFViewCtrl.setNightMode | ( | boolean | bNightMode | ) |
Set night mode.
bNightMode | true means to use night mode. false means not to use night mode. |
void com.foxit.sdk.PDFViewCtrl.setPageBinding | ( | @PageBinding int | pageBinding | ) |
Set the PageBinding controlling in which direction pages of documents are laid out, either left to right (page indexed 0 will be to the left),or right to left (page indexed 0 will be on the right), default pagebinding is PDFViewCtrl#LEFT_EDGE.
pageBinding | One LEFT_EDGE or RIGHT_EDGE to set on the document. |
void com.foxit.sdk.PDFViewCtrl.setPageLayoutMode | ( | @PageMode int | lMode | ) |
Set page layout mode.
lMode | Page layout mode. Please refer to values starting from PAGELAYOUTMODE_SINGLE and this would be one of these values. |
void com.foxit.sdk.PDFViewCtrl.setPageSpacing | ( | int | space | ) |
Set spacing(in pixels) between adjacent pages in the view. If the layout has already been loaded, you need to call updatePagesLayout() for the changes to take effect.
Note: Currently, It supports in PDFViewCtrl#PAGELAYOUTMODE_FACING and PDFViewCtrl#PAGELAYOUTMODE_COVER mode.
space | spacing between adjacent pages in the view. default: 2. Valid range: from 0 to 10. |
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_FACING, PDFViewCtrl#PAGELAYOUTMODE_COVER mode and PDFViewCtrl#PAGELAYOUTMODE_SINGLE mode is continuous.
space | spacing(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. |
direction | Used 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. |
void com.foxit.sdk.PDFViewCtrl.setReflowBackgroundColor | ( | int | color | ) |
Sets the page background color in reflow mode and the color mode is Renderer#e_ColorModeNormal. Should called before setPageLayoutMode(int)
color | the background color to be used. |
void com.foxit.sdk.PDFViewCtrl.setReflowMode | ( | int | reflowMode | ) |
Set the reflow mode
reflowMode | Re-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 values starting from ReflowPage#e_Normal and this can be one or combination of these values. |
void com.foxit.sdk.PDFViewCtrl.setUIExtensionsManager | ( | UIExtensionsManager | manager | ) |
Set UI extensions manager.
manager | An UIExtensionsManager object to be set. |
void com.foxit.sdk.PDFViewCtrl.setVScrollPos | ( | int | pos | ) |
Set the vertical scroll position.
pos | New vertical scroll position. If this value is out of range of current view, it will only be displayed within the last view region. |
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.
factor | New zoom factor. Default valid range from 1.0f to 8.0f. 1.0f is the value of the fit page mode (the initial model). |
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.
devicePt | The device point |
factor | New zoom factor. Default valid range from 1.0f to 8.0f. 1.0f is the value of the fit page mode (the initial model). |
void com.foxit.sdk.PDFViewCtrl.setZoomMode | ( | int | zMode | ) |
Set zoom mode.
zMode | New zoom mode. Please refer to values starting from ZOOMMODE_CUSTOMIZE and this would be one of these values. |
void com.foxit.sdk.PDFViewCtrl.slideToNextScreen | ( | ) |
Slide to next screen
void com.foxit.sdk.PDFViewCtrl.slideToPreviousScreen | ( | ) |
Slide to pre screen
|
static |
Unlock for the page rendering process.
void com.foxit.sdk.PDFViewCtrl.unregisterActivityResultListener | ( | IActivityResultListener | listener | ) |
Unregister an activity result listener.
listener | An IActivityResultListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterDocEventListener | ( | IDocEventListener | listener | ) |
Unregister a document event listener.
listener | An IDocEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterDoubleTapEventListener | ( | IDoubleTapEventListener | listener | ) |
Unregister a double tap event listener.
listener | An IDoubleTapEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterDrawEventListener | ( | IDrawEventListener | listener | ) |
Unregister a draw event listener.
listener | An IDrawEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterGestureEventListener | ( | IGestureEventListener | listener | ) |
Unregister a gesture event listener.
listener | An IGestureEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterLayoutEventListener | ( | ILayoutEventListener | listener | ) |
Unregister a layout mode event listener.
listener | An ILayoutEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterPageAutoEventListener | ( | IPageAutoEventListener | listener | ) |
Unregister a page auto event listener.
listener | An IPageAutoEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterPageEventListener | ( | IPageEventListener | listener | ) |
Unregister a page event listener.
listener | An IPageEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterRecoveryEventListener | ( | IRecoveryEventListener | listener | ) |
Unregister an event listener for recovery from running out of memory.
listener | An IRecoveryEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterReflowEventListener | ( | IReflowEventListener | listener | ) |
Unregister a reflow event listener.
listener | An IReflowEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterRenderEventListener | ( | IRenderEventListener | listener | ) |
Unregister a render event listener.
listener | An IRenderEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterScaleGestureEventListener | ( | IScaleGestureEventListener | listener | ) |
Unregister a scale gesture event listener.
listener | An IScaleGestureEventListener object to be unregistered. |
void com.foxit.sdk.PDFViewCtrl.unregisterTouchEventListener | ( | ITouchEventListener | listener | ) |
Unregister a touch event listener.
listener | An ITouchEventListener object to be unregistered. |
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.
removePages(int[]) insertPages(int, int, String, PDFDoc, int[]) insertPages(int, int, String, String, byte[], int[]) movePage(int, int) rotatePages(int[], int) rotateView(int)
void com.foxit.sdk.PDFViewCtrl.zoomToRect | ( | int | pageIndex, |
RectF | pageViewRect, | ||
int | fitMode | ||
) |
Zoom to a specific area of the page content so that it is visible on the screen.
You can call setMinZoomLimit(float) and setMaxZoomLimit(float) to change the limitation.
pageIndex | The page index which page the rectangle is on. |
pageViewRect | A rectangle defining an area of the page content view. The rectangle should be in the coordinate space of the page view. |
fitMode | The fit mode that used to calculate the zoom ratio. One of ZOOM_FITRECT_RECT, ZOOM_FITRECT_WIDTH, ZOOM_FITRECT_HEIGHT |
|
static |
The page auto fling event
|
static |
The defaule auto state
|
static |
The page auto scroll correction event
|
static |
The page auto scroll turn page event
|
static |
The page auto zoom rect event
|
static |
The page auto zoom in event
|
static |
The page auto zoom out event
|
static |
Lock double-tap gesture
|
static |
No gesture lock
|
static |
Lock pan gesture
|
static |
Lock pinch-to-zoom gesture
|
static |
Lock single-tap gesture
|
static |
The document flows from left to right.
|
static |
Cover page mode
|
static |
Facing page mode
|
static |
Reflow page mode
|
static |
Single page mode
|
static |
Horizontal page spacing.
|
static |
Vertical page spacing.
|
static |
Insert new page style – blank
|
static |
Insert new page style – graph
|
static |
Insert new page style – grid
|
static |
Insert new page style – line
|
static |
Insert new page style – music
|
static |
The document flows from right to left.
boolean com.foxit.sdk.PDFViewCtrl.shouldRecover = true |
Used to check whether it should recover from out of memory or not. Default is true
.
|
static |
Automatically scale the page to fit the height of the specified rectangle.
|
static |
Automatically scale the page to fit the specified rectangle.
|
static |
Automatically scale the page to fit the width of the specified rectangle.
|
static |
Zoom mode: customized mode.
|
static |
Zoom mode: fit page height.
|
static |
Zoom mode: fit page.
|
static |
Zoom mode: fit page width.