Foxit PDF RDK

Public Member Functions | Public Attributes | List of all members
FoxitPDFViewCtrl.PDFViewCtrlModel Class Reference

PDFViewCtrlModel class. More...

## Public Member Functions
| addNodePage (pageIndex)
| clearAllCacheFiles ()
| clearCacheFile (url)
| closeDoc ()
| constructor (context) refreshLock(lockHandle()
| convertDisplayViewPtToPageViewPt (displayViewPt, pageIndex)
| convertDisplayViewRectToPageViewRect (displayViewRectF, pageIndex)
| convertPageViewPtToDisplayViewPt (pageViewPt, pageIndex)
| convertPageViewPtToPdfPt (pageViewPt, pageIndex)
| convertPageViewRectToDisplayViewRect (pageViewRectF, pageIndex)
| convertPageViewRectToPdfRect (pageViewRectF, pageIndex)
| convertPdfPtToPageViewPt (pdfPt, pageIndex)
| convertPdfRectToPageViewRect (pdfRectF, pageIndex)
| getBackgroundColor ()
| getCachePages ()
| getColorMode ()
| getCurrentPage ()
| getDisplayMatrix (pageIndex, isVP=true, fromOrigin=GeometryUtil.FGPointMake(0, 0))
| getDisplayViewHeight ()
| getDisplayViewWidth ()
| getHScrollPos ()
| getHScrollRange ()
| getMappingModeBackgroundColor ()
| getMappingModeForegroundColor ()
| getPageIndex (displayViewPt)
| getPageLayoutMode ()
| getPageViewHeight (pageIndex)
| getPageViewRect (pageIndex)
| getPageViewWidth (pageIndex)
| getReflowBackgroundColor ()
| getReflowMode ()
| getUIExtensionsManager ()
| getVisiblePages ()
| getVScrollPos ()
| getVScrollRange ()
| getZoom ()
| getZoomMode ()
| gotoFirstPage ()
| gotoLastPage ()
| gotoNextPage ()
| gotoNextView ()
| gotoPage (pageIndex, devOffsetX, devOffsetY)
| gotoPageByPoint (pageIndex, pdfPt)
| gotoPrevPage ()
| gotoPrevView ()
| hasNextView ()
| hasPrevView ()
| isContinuous ()
| isKeepZoomRatio ()
| isNightMode ()
| isTouchPageView (point)
| openDoc (filePath, password, cb(errorCode);) openDocFromMemory(buffer
| openDocFromUrl (url, password, cacheOption, requestOptions< string, string >, cb(errorCode);)
| openDocumentWithReader (fileReader, password, cb(errorCode);)
| refresh (pageIndex, rect=GeometryUtil.FGRectMakeZero())
| saveDoc (filePath, flag)
| saveDocWithWriter (fileWriter, flag)
| setColorMode (colorMode)
| setContinuous (isContinuous)
| setHScrollPos (pos)
| setKeepZoomRatio (keep)
| setKeepZoomRatioWhenOpenDoc (keep)
| setMappingModeBackgroundColor (mappingModeBackgroundColor)
| setMappingModeForegroundColor (mappingModeForegroundColor) setBackgroundColor(color)
| setNightMode (bNightMode)
| setPageLayoutMode (lMode)
| setReflowBackgroundColor (color)
| setReflowMode (reflowMode)
| setUIExtensionsManager (manager)
| setVScrollPos (pos)
| setZoom (factor, devicePt)
| setZoomMode (zMode)
| slideToNextScreen ()
| slideToPreviousScreen ()
| zoomToRect (pageIndex, pageViewRect, fitMode)

## Public Attributes
readonly | lock = new VersionDiffUtils.AsyncLock()
| The next view stack.
| minimumPressDuration = 300
| translateX = 0
| translateY = 0

## Detailed Description

PDFViewCtrlModel class.

## Member Function Documentation

## ◆ addNodePage()

FoxitPDFViewCtrl.PDFViewCtrlModel.addNodePage | ( | pageIndex |  | ) |

Add the task node page of the previous operation

Parameters

  pageIndex | Page index. Valid range: from 0 to (`count`-1). `count` is the page count.

## ◆ clearAllCacheFiles()

FoxitPDFViewCtrl.PDFViewCtrlModel.clearAllCacheFiles | ( |  | ) |

Clear all the cache files.

See also
  openDocFromUrl(string, string, CacheOption, Record<string, string>, (errorCode: FoxitRDKNative.common);)

## ◆ clearCacheFile()

FoxitPDFViewCtrl.PDFViewCtrlModel.clearCacheFile | ( | url |  | ) |

Clear the cache file by the specified url.

Parameters

  url | The url of the document that used in PDFViewCtrlModel.openDocFromUrl

See also
  openDocFromUrl(string, string, CacheOption, Record<string, string>, (errorCode: FoxitRDKNative.common);)

## ◆ closeDoc()

FoxitPDFViewCtrl.PDFViewCtrlModel.closeDoc | ( |  | ) |

Close the displayed document.

## ◆ constructor()

FoxitPDFViewCtrl.PDFViewCtrlModel.constructor | ( | context |  | ) |

If page content is currently being edited or annotation is reseting the appearance, caller should lock refreshing before editting is done.

Parameters

  lockHandle | Need to handle the locking transaction.
  completed | Call back after the current processing is complete.

## ◆ convertDisplayViewPtToPageViewPt()

FoxitPDFViewCtrl.PDFViewCtrlModel.convertDisplayViewPtToPageViewPt | ( | displayViewPt | ,
|  | pageIndex |
| ) |  |

Convert display view point to page view point.

Parameters

  displayViewPt | The display view point.
  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  The page view point as result.

## ◆ convertDisplayViewRectToPageViewRect()

FoxitPDFViewCtrl.PDFViewCtrlModel.convertDisplayViewRectToPageViewRect | ( | displayViewRectF | ,
|  | pageIndex |
| ) |  |

Convert display view rectangle to page view rectangle.

Parameters

  displayViewRectF | The display view rectangle.
  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  The page view rectangle as result.

## ◆ convertPageViewPtToDisplayViewPt()

FoxitPDFViewCtrl.PDFViewCtrlModel.convertPageViewPtToDisplayViewPt | ( | pageViewPt | ,
|  | pageIndex |
| ) |  |

Convert page view point to display view point.

Parameters

  pageViewPt | The page view point.
  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  The display view point as result

## ◆ convertPageViewPtToPdfPt()

FoxitPDFViewCtrl.PDFViewCtrlModel.convertPageViewPtToPdfPt | ( | pageViewPt | ,
|  | pageIndex |
| ) |  |

Convert page view point to PDF point.

Parameters

  pageViewPt | The point on the page view.
  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  The PDF point as result.

## ◆ convertPageViewRectToDisplayViewRect()

FoxitPDFViewCtrl.PDFViewCtrlModel.convertPageViewRectToDisplayViewRect | ( | pageViewRectF | ,
|  | pageIndex |
| ) |  |

Convert page view rectangle to display view rectangle.

Parameters

  pageViewRectF | The page view rectangle.
  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  The display view rectangle as result.

## ◆ convertPageViewRectToPdfRect()

FoxitPDFViewCtrl.PDFViewCtrlModel.convertPageViewRectToPdfRect | ( | pageViewRectF | ,
|  | pageIndex |
| ) |  |

Convert page view rectangle to pdf rectangle.

Parameters

  pageViewRectF | The page view rectangle.
  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  The pdf rectangle as result

## ◆ convertPdfPtToPageViewPt()

FoxitPDFViewCtrl.PDFViewCtrlModel.convertPdfPtToPageViewPt | ( | pdfPt | ,
|  | pageIndex |
| ) |  |

Convert pdf point to page view point coordination.

Parameters

  pdfPt | The PDF point.
  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  The page view point as result

## ◆ convertPdfRectToPageViewRect()

FoxitPDFViewCtrl.PDFViewCtrlModel.convertPdfRectToPageViewRect | ( | pdfRectF | ,
|  | pageIndex |
| ) |  |

Convert pdf rectangle to page view rectangle.

Parameters

  pdfRectF | The PDF rectangle.
  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  The page view rectangle as result.

## ◆ getBackgroundColor()

FoxitPDFViewCtrl.PDFViewCtrlModel.getBackgroundColor | ( |  | ) |

Gets the background color

Returns
  background color

## ◆ getCachePages()

FoxitPDFViewCtrl.PDFViewCtrlModel.getCachePages | ( |  | ) |

Get cached pages.

Returns
  cached pages.

## ◆ getColorMode()

FoxitPDFViewCtrl.PDFViewCtrlModel.getColorMode | ( |  | ) |

Get the colorMode

- FoxitRDKNative.common.Renderer.e_ColorModeNormal means normal color mode.
- FoxitRDKNative.common.Renderer.e_ColorModeMappingGraymeans to Map white/black color value to background/foreground, other unchanged. If this mode is used, please call function PDFViewCtrlModel.setMappingModeBackgroundColor to set "background color" and PDFViewCtrlModel.setMappingModeForegroundColor to set "foreground color".
- FoxitRDKNative.common.Renderer.e_ColorModeMapping means map a color value to the color range defined by a background color and a foreground color. If this mode is used, please call function PDFViewCtrlModel.setMappingModeBackgroundColor to set "background color" and PDFViewCtrlModel.setMappingModeForegroundColor to set "foreground color".

Returns
  colorMode

## ◆ getCurrentPage()

FoxitPDFViewCtrl.PDFViewCtrlModel.getCurrentPage | ( |  | ) |

Get the current page index.

Returns
  Current page index.

## ◆ getDisplayMatrix()

FoxitPDFViewCtrl.PDFViewCtrlModel.getDisplayMatrix | ( | pageIndex | ,
|  | isVP | = `true`,
|  | fromOrigin | = `GeometryUtil.FGPointMake(0, 0)`
| ) |  |

Get the display matrix of a specified page.

Parameters

  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  The display matrix.

## ◆ getDisplayViewHeight()

FoxitPDFViewCtrl.PDFViewCtrlModel.getDisplayViewHeight | ( |  | ) |

Get display view height.

Returns
  Height of the display view.

## ◆ getDisplayViewWidth()

FoxitPDFViewCtrl.PDFViewCtrlModel.getDisplayViewWidth | ( |  | ) |

Get display view width.

Returns
  Width of the display view.

## ◆ getHScrollPos()

FoxitPDFViewCtrl.PDFViewCtrlModel.getHScrollPos | ( |  | ) |

Get the horizontal scroll position.

Returns
  The scrolled left position.

## ◆ getHScrollRange()

FoxitPDFViewCtrl.PDFViewCtrlModel.getHScrollRange | ( |  | ) |

Get the horizontal scroll range.

Returns
  The horizontal scroll range.

## ◆ getMappingModeBackgroundColor()

FoxitPDFViewCtrl.PDFViewCtrlModel.getMappingModeBackgroundColor | ( |  | ) |

Get the "background color" while in FoxitRDKNative.common.Renderer.e_ColorModeMapping or FoxitRDKNative.common.Renderer.e_ColorModeMappingGray color mode.

You can get the current color mode by using PDFViewCtrlModel.getColorMode

Returns
  the "background color"

## ◆ getMappingModeForegroundColor()

FoxitPDFViewCtrl.PDFViewCtrlModel.getMappingModeForegroundColor | ( |  | ) |

Get the "foreground color" while in FoxitRDKNative.common.Renderer.e_ColorModeMapping or FoxitRDKNative.common.Renderer.e_ColorModeMappingGray color mode.

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

Returns
  the "foreground color"

## ◆ getPageIndex()

FoxitPDFViewCtrl.PDFViewCtrlModel.getPageIndex | ( | displayViewPt |  | ) |

Get the page index with device point.

Parameters

  displayViewPt | A `GeometryUtil.FGPoint` value which specifies the device point.

Returns
  The page index, starting from 0.

## ◆ getPageLayoutMode()

FoxitPDFViewCtrl.PDFViewCtrlModel.getPageLayoutMode | ( |  | ) |

Get page layout mode.

Returns
  The page layout mode.

## ◆ getPageViewHeight()

FoxitPDFViewCtrl.PDFViewCtrlModel.getPageViewHeight | ( | pageIndex |  | ) |

Get the height of a specified page view.

Parameters

  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  Height of the page view.

## ◆ getPageViewRect()

FoxitPDFViewCtrl.PDFViewCtrlModel.getPageViewRect | ( | pageIndex |  | ) |

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

Parameters

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

FoxitPDFViewCtrl.PDFViewCtrlModel.getPageViewWidth | ( | pageIndex |  | ) |

Get the width of a specified page view.

Parameters

  pageIndex | Page index.Valid range: from 0 to (`count`-1). `count` is the page count.

Returns
  Width of the page view.

## ◆ getReflowBackgroundColor()

FoxitPDFViewCtrl.PDFViewCtrlModel.getReflowBackgroundColor | ( |  | ) |

Gets the background color in reflow mode

Returns
  The background color in reflow mode

## ◆ getReflowMode()

FoxitPDFViewCtrl.PDFViewCtrlModel.getReflowMode | ( |  | ) |

Get the reflow mode

Returns
  The reflow mode. Please refer to values starting from FoxitRDKNative.pdf.ReflowPage.e_Normal and this can be one or combination of these values. Default value: `FoxitRDKNative.pdf.ReflowPage.e_Normal|FoxitRDKNative.pdf.ReflowPage.e_WithImage`.

## ◆ getUIExtensionsManager()

FoxitPDFViewCtrl.PDFViewCtrlModel.getUIExtensionsManager | ( |  | ) |

Get UI extensions manager.

Returns
  An `UIExtensionsManager` object which represents the UI extensions manager.

## ◆ getVisiblePages()

FoxitPDFViewCtrl.PDFViewCtrlModel.getVisiblePages | ( |  | ) |

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

Returns
  The indexes array for current visible pages.

## ◆ getVScrollPos()

FoxitPDFViewCtrl.PDFViewCtrlModel.getVScrollPos | ( |  | ) |

Get the vertical scroll position.

Returns
  The scrolled top position.

## ◆ getVScrollRange()

FoxitPDFViewCtrl.PDFViewCtrlModel.getVScrollRange | ( |  | ) |

Get the vertical scroll range.

Returns
  The vertical scroll range.

## ◆ getZoom()

FoxitPDFViewCtrl.PDFViewCtrlModel.getZoom | ( |  | ) |

Get the zoom factor.

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

## ◆ getZoomMode()

FoxitPDFViewCtrl.PDFViewCtrlModel.getZoomMode | ( |  | ) |

Get the current zoom mode.

It should be one of constant definitions PDF_ZOOM_MODE.

Returns
  The current zoom mode.

## ◆ gotoFirstPage()

FoxitPDFViewCtrl.PDFViewCtrlModel.gotoFirstPage | ( |  | ) |

Go to the first page.

## ◆ gotoLastPage()

FoxitPDFViewCtrl.PDFViewCtrlModel.gotoLastPage | ( |  | ) |

Go to the last page.

## ◆ gotoNextPage()

FoxitPDFViewCtrl.PDFViewCtrlModel.gotoNextPage | ( |  | ) |

Go to the next page.

## ◆ gotoNextView()

FoxitPDFViewCtrl.PDFViewCtrlModel.gotoNextView | ( |  | ) |

Go to next view.

## ◆ gotoPage()

FoxitPDFViewCtrl.PDFViewCtrlModel.gotoPage | ( | pageIndex | ,
|  | devOffsetX | ,
|  | 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

  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.

## ◆ gotoPageByPoint()

FoxitPDFViewCtrl.PDFViewCtrlModel.gotoPageByPoint | ( | pageIndex | ,
|  | pdfPt |
| ) |  |

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

Parameters

  pageIndex | Page index. Valid range: from 0 to (`count`-1). `count` is the page count.
  pdfPt | The pdf point.

## ◆ gotoPrevPage()

FoxitPDFViewCtrl.PDFViewCtrlModel.gotoPrevPage | ( |  | ) |

Go to the previous page.

## ◆ gotoPrevView()

FoxitPDFViewCtrl.PDFViewCtrlModel.gotoPrevView | ( |  | ) |

Go to previous view.

## ◆ hasNextView()

FoxitPDFViewCtrl.PDFViewCtrlModel.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()

FoxitPDFViewCtrl.PDFViewCtrlModel.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.

## ◆ isContinuous()

FoxitPDFViewCtrl.PDFViewCtrlModel.isContinuous | ( |  | ) |

Whether the page layout mode is continuous. Note: It's invalid for PAGE_LAYOUT_MODE.REFLOW mode.

Returns
  `true` means page layout mode is continuous.

## ◆ isKeepZoomRatio()

FoxitPDFViewCtrl.PDFViewCtrlModel.isKeepZoomRatio | ( |  | ) |

Get whether to keep the zoom ratio when turning pages in non-continuous page mode.

Returns
  `true` means to keep the zoom ratio when turning pages in non-continuous page mode.

## ◆ isNightMode()

FoxitPDFViewCtrl.PDFViewCtrlModel.isNightMode | ( |  | ) |

Check if it's night mode

Returns
  true means is the night mode

## ◆ isTouchPageView()

FoxitPDFViewCtrl.PDFViewCtrlModel.isTouchPageView | ( | point |  | ) |

Whether to click page view

Parameters

  point | A `GeometryUtil.FGPoint` value which specifies the device point.

Returns
  The Whether to click page view

## ◆ openDoc()

FoxitPDFViewCtrl.PDFViewCtrlModel.openDoc | ( |  | filePath,
|  |  | password,
|  |  | cb(errorCode);
| ) |  |

Open PDF document from a specified PDF file path.

Parameters

  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.
  cb | The callback will be called when current document object becomes available or the view control fail to open the document FoxitRDKNative.common. Open the PDF document from memory buffer.
  buffer | A memory buffer, containing the serialized document.
  size | The size of memory buffer. It should be above 0.
  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.
  cb | The callback will be called when current document object becomes available or the view control fail to open the document FoxitRDKNative.common.

## ◆ openDocFromUrl()

FoxitPDFViewCtrl.PDFViewCtrlModel.openDocFromUrl | ( | url | ,
|  | password | ,
|  | cacheOption | ,
|  | requestOptions< string, string > | ,
|  | cb(errorCode); |
| ) |  |

Open PDF document from a specified URL.

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

Parameters

  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 .
  requestOptions | The request properties that HTTP requires, may be null .
  cb | The callback will be called when current document object becomes available or the view control fail to open the document FoxitRDKNative.common.

## ◆ openDocumentWithReader()

FoxitPDFViewCtrl.PDFViewCtrlModel.openDocumentWithReader | ( | fileReader | ,
|  | password | ,
|  | cb(errorCode); |
| ) |  |

Open PDF document from a specified FoxitRDKNative.common.file.ReaderCallback.

Parameters

  FileReader | A ReaderCallback 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.
  cb | The callback will be called when current document object becomes available or the view control fail to open the document FoxitRDKNative.common.

## ◆ refresh()

FoxitPDFViewCtrl.PDFViewCtrlModel.refresh | ( | pageIndex | ,
|  | rect | = `GeometryUtil.FGRectMakeZero()`
| ) |  |

Refresh a specified rectangle area in a specified page.

Parameters

  pageIndex | Page index. Valid range: from 0 to (`count`-1). `count` is the page count.
  rect | The specified rectangle, in page view coordinate system.

## ◆ saveDoc()

FoxitPDFViewCtrl.PDFViewCtrlModel.saveDoc | ( | filePath | ,
|  | flag |
| ) |  |

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

Parameters

  filePath | File path for the new saved PDF file.
  flag | Document saving flags. It can be one or combination of constant definitions e_saveFlagXXX.

## ◆ saveDocWithWriter()

FoxitPDFViewCtrl.PDFViewCtrlModel.saveDocWithWriter | ( | fileWriter | ,
|  | flag |
| ) |  |

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

Parameters

  fileWriter | File writer callback for the new saved PDF file.
  flag | Document saving flags. It can be one or combination of constant definitions e_saveFlagXXX.

## ◆ setColorMode()

FoxitPDFViewCtrl.PDFViewCtrlModel.setColorMode | ( | colorMode |  | ) |

Set color mode.

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

Parameters

  colorMode | Color mode value. It should be one of following values: FoxitRDKNative.common.Renderer.e_ColorModeNormal means normal color mode. FoxitRDKNative.common.Renderer.e_ColorModeMappingGraymeans to Map white/black color value to background/foreground, other unchanged. If this mode is used, please call function PDFViewCtrlModel.setMappingModeBackgroundColor to set "background color" and PDFViewCtrlModel.setMappingModeForegroundColor to set "foreground color". FoxitRDKNative.common.Renderer.e_ColorModeMapping means map a color value to the color range defined by a background color and a foreground color. If this mode is used, please call function PDFViewCtrlModel.setMappingModeBackgroundColor to set "background color" and PDFViewCtrlModel.setMappingModeForegroundColor to set "foreground color".

## ◆ setContinuous()

FoxitPDFViewCtrl.PDFViewCtrlModel.setContinuous | ( | isContinuous |  | ) |

set page layout mode to continuous. Note: It's invalid for PAGE_LAYOUT_MODE.REFLOW mode.

Parameters

  isContinuous | `true` means page layout mode use continuous.

See also
  PAGE_LAYOUT_MODE

## ◆ setHScrollPos()

FoxitPDFViewCtrl.PDFViewCtrlModel.setHScrollPos | ( | pos |  | ) |

Set the horizontal scroll position.

Parameters

  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.

## ◆ setKeepZoomRatio()

FoxitPDFViewCtrl.PDFViewCtrlModel.setKeepZoomRatio | ( | keep |  | ) |

Set whether to keep the zoom ratio when turning pages in non-continuous page mode. Default is true.

Parameters

  keep | `true` means to keep the zoom ratio when turning pages in non-continuous page mode.

## ◆ setKeepZoomRatioWhenOpenDoc()

FoxitPDFViewCtrl.PDFViewCtrlModel.setKeepZoomRatioWhenOpenDoc | ( | keep |  | ) |

Sets whether the last zoom ratio should be maintained when a document is opened.

Parameters

  keep | - A boolean value indicating whether to keep the same zoom ratio when opening a document. If true, the current zoom level will be preserved; otherwise, it will reset to the default zoom level.

## ◆ setMappingModeBackgroundColor()

FoxitPDFViewCtrl.PDFViewCtrlModel.setMappingModeBackgroundColor | ( | mappingModeBackgroundColor |  | ) |

Set the "background color" will be work in FoxitRDKNative.common.Renderer.e_ColorModeMapping or FoxitRDKNative.common.Renderer.e_ColorModeMappingGray color mode.

Please call the function PDFViewCtrlModel.setColorMode after setting the new "background color".

Parameters

  mappingModeBackgroundColor | The "background color". Format: 0xAARRGGBB.

## ◆ setMappingModeForegroundColor()

FoxitPDFViewCtrl.PDFViewCtrlModel.setMappingModeForegroundColor | ( | mappingModeForegroundColor |  | ) |

Set the "foreground color" will be work in FoxitRDKNative.common.Renderer.e_ColorModeMapping or FoxitRDKNative.common.Renderer.e_ColorModeMappingGray color mode.

Please call the function PDFViewCtrlModel.setColorMode after setting the new "foreground color".

Parameters

  mappingModeForegroundColor | The "foreground color". Format: 0xAARRGGBB. Set the background color for current view.
  color | New background color. Format: 0xRRGGBB.

## ◆ setNightMode()

FoxitPDFViewCtrl.PDFViewCtrlModel.setNightMode | ( | bNightMode |  | ) |

Set night mode.

Parameters

  bNightMode | `true` means to use night mode. `false` means not to use night mode.

## ◆ setPageLayoutMode()

FoxitPDFViewCtrl.PDFViewCtrlModel.setPageLayoutMode | ( | lMode |  | ) |

Set page layout mode.

Parameters

  lMode | Page layout mode. It should be one of constant definitions

See also
  PAGE_LAYOUT_MODE.

## ◆ setReflowBackgroundColor()

FoxitPDFViewCtrl.PDFViewCtrlModel.setReflowBackgroundColor | ( | color |  | ) |

Sets the page background color in reflow mode. Should called before PDFViewCtrlModel.setPageLayoutMode

Parameters

  color | the background color to be used.

## ◆ setReflowMode()

FoxitPDFViewCtrl.PDFViewCtrlModel.setReflowMode | ( | reflowMode |  | ) |

Set the reflow mode

Parameters

  reflowMode | Re-flow mode. It should be one or a combination of the following enumeration definitions. Default value: `FoxitRDKNative.pdf.ReflowPage.e_Normal|FoxitRDKNative.pdf.ReflowPage.e_WithImage`. Please refer to values starting from FoxitRDKNative.pdf.ReflowPage.e_Normal and this can be one or combination of these values.

## ◆ setUIExtensionsManager()

FoxitPDFViewCtrl.PDFViewCtrlModel.setUIExtensionsManager | ( | manager |  | ) |

Set UI extensions manager.

Parameters

  manager | An `UIExtensionsManager` object to be set.

## ◆ setVScrollPos()

FoxitPDFViewCtrl.PDFViewCtrlModel.setVScrollPos | ( | pos |  | ) |

Set the vertical scroll position.

Parameters

  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.

## ◆ setZoom()

FoxitPDFViewCtrl.PDFViewCtrlModel.setZoom | ( | factor | ,
|  | devicePt |
| ) |  |

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

You can call PDFViewCtrlModel.setMinZoomLimit and PDFViewCtrlModel.setMaxZoomLimit to change the limitation.

Parameters

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

## ◆ setZoomMode()

FoxitPDFViewCtrl.PDFViewCtrlModel.setZoomMode | ( | zMode |  | ) |

Set zoom mode.The default value of PDF_ZOOM_MODE.FIT_WIDTH.

Note: When you set zoom mode to custom, it indicates that the page is in a custom state and will not cause any changes to the page.

Parameters

  zMode | New zoom mode. It should be one of constant definitions PDF_ZOOM_MODE.

## ◆ slideToNextScreen()

FoxitPDFViewCtrl.PDFViewCtrlModel.slideToNextScreen | ( |  | ) |

Slide to next screen

## ◆ slideToPreviousScreen()

FoxitPDFViewCtrl.PDFViewCtrlModel.slideToPreviousScreen | ( |  | ) |

Slide to pre screen

## ◆ zoomToRect()

FoxitPDFViewCtrl.PDFViewCtrlModel.zoomToRect | ( | pageIndex | ,
|  | pageViewRect | ,
|  | fitMode |
| ) |  |

Zoom to a specific area of the page content so that it is visible on the screen. if you want to exit zoom, you can call setZoomMode.

You can call PDFViewCtrlModel.setMinZoomLimit and PDFViewCtrlModel.setMaxZoomLimit to change the limitation.

Parameters

  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. PDF_ZOOM_FIT_RECT_MODE.

## Member Data Documentation

## ◆ minimumPressDuration

FoxitPDFViewCtrl.PDFViewCtrlModel.minimumPressDuration = 300

Minimum long press interval(ms).

## ◆ translateX

FoxitPDFViewCtrl.PDFViewCtrlModel.translateX = 0

Set component translateX.

## ◆ translateY

FoxitPDFViewCtrl.PDFViewCtrlModel.translateY = 0

Set component translateX.