Foxit PDF SDK  9.1
FSPDFViewCtrl Class Reference

Foxit PDF view control for viewing/editing/saving the PDF file. More...

Inheritance diagram for FSPDFViewCtrl:
<IRotationEventListener> <FSPageOrganizerDelegate>

Instance Methods

(void) - addPageJumpedNode:index:animated:
 Add the page jumped node to page navigation stack. More...
 
(BOOL) - appendPageView:
 Append a customized UI view to pdf page views. More...
 
(void) - clearAllCacheFile
 Clear all files cached by SDK. More...
 
(void) - clearCacheFile:
 Clear the cache file. More...
 
(void) - clearPrevNextStack
 Clear prev and next stack. More...
 
(void) - clearRenderCache
 Clear the render cache. More...
 
(void) - closeDoc:
 Close the document. More...
 
(CGPoint) - convertDisplayViewPtToPageViewPt:pageIndex:
 Convert the display view point to page view point. More...
 
(CGRect) - convertDisplayViewRectToPageViewRect:pageIndex:
 Convert the display view rectangle to page view coordination. More...
 
(CGPoint) - convertPageViewPtToDisplayViewPt:pageIndex:
 Convert the page view point to display view point. More...
 
(FSPointF *) - convertPageViewPtToPdfPt:pageIndex:
 Convert the page view point to PDF page point. More...
 
(FSPointF *) - convertPageViewPtToReflowPagePt:reflowPage:pageIndex:
 Convert the page view point to ReflowPage point. More...
 
(CGRect) - convertPageViewRectToDisplayViewRect:pageIndex:
 Convert the page view rectangle to display view coordination. More...
 
(FSRectF *) - convertPageViewRectToPdfRect:pageIndex:
 Convert the page view rectangle to PDF rectangle. More...
 
(FSRectF *) - convertPageViewRectToReflowPageRect:reflowPage:pageIndex:
 Convert the page view rectangle to ReflowPage rectangle. More...
 
(CGPoint) - convertPdfPtToPageViewPt:pageIndex:
 Convert the PDF page point to page view point. More...
 
(CGRect) - convertPdfRectToPageViewRect:pageIndex:
 Convert the PDF rectangle to page view rectangle. More...
 
(CGPoint) - convertReflowPagePtToPageViewPt:reflowPage:pageIndex:
 Convert the ReflowPage page point to page view point. More...
 
(CGRect) - convertReflowPageRectToPageViewRect:reflowPage:pageIndex:
 Convert the ReflowPage rectangle to page view rectangle. More...
 
(UIEdgeInsets) - getCropInsets:
 Get crop mode inset. More...
 
(PDF_CROP_MODE- getCropMode
 Get crop mode. More...
 
(int) - getCurrentPage
 Get current page index. More...
 
(float) - getDefaultPageScale
 Get the default page scale. More...
 
(FSMatrix2D *) - getDisplayMatrix:
 Get the display matrix of a specified page, which transforms from PDF coordinate to page view coordinate. More...
 
(FSMatrix2D *) - getDisplayMatrix:fromOrigin:
 Get the display matrix of a specified page from the origin point on page view, which transforms from PDF coordinate to page view coordinate. More...
 
(UIView *) - getDisplayView
 Get the display view. PDF pages and page transition effects are displayed on the display view. More...
 
(float) - getDisplayViewHeight
 Get the height of the display view. More...
 
(float) - getDisplayViewWidth
 Get the width of the display view. More...
 
(FSPDFDoc *) - getDoc
 Get the current PDF document object from view control. More...
 
(FSPDFDocUserPermissions- getDocPermissions
 Get the permissions of the current PDF document. More...
 
(double) - getHScrollPos
 Get the horizontal scroll position. More...
 
(double) - getHScrollRange
 Get the maximum horizontal scroll range. More...
 
(FSGestureLockOptions- getLockedOptions
 Retrieves the currently locked options. More...
 
(UIView *) - getOverlayView:
 Get the overlay view on the page, specified by page index. More...
 
(UIScrollView *) - getPageContainer
 Get the page container. More...
 
(int) - getPageCount
 Get the page count of PDF document. More...
 
(int) - getPageIndex:
 Get the page index at the specified point, in display view space. More...
 
(PDF_LAYOUT_MODE- getPageLayoutMode
 Get the page layout mode. More...
 
(UIView *) - getPageView:
 Get the page view by page index. More...
 
(UITapGestureRecognizer *) - getPageViewDoubleTapGesture:
 Get the double tap gesture recognizer of page view by page index. More...
 
(float) - getPageViewHeight:
 Get the height of a specified page view. More...
 
(float) - getPageViewWidth:
 Get the width of a specified page view. More...
 
(PDF_REFLOW_REFLOWMODE- getReflowMode
 Get reflow mode. More...
 
(float) - getReflowPageScale
 Gets the scale at which the reflowpage was generated. More...
 
(float) - getScale
 Get the page scale. More...
 
(float) - getUIDevicePPI
 Get the ppi of the current device. More...
 
(int) - getViewRotation
 
(NSMutableArray *) - getVisiblePages
 Get the visible pages in current view control. More...
 
(double) - getVScrollPos
 Get the vertical scroll position. More...
 
(double) - getVScrollRange
 Get the maximum vertical scroll range. More...
 
(FSXFADoc *) - getXFADoc
 Return XFA document object if the current document is XFA, else return nil. More...
 
(float) - getZoom
 Get the zoom level. Valid range: from 1.0 to 20.0 for reflow mode, others 1.0 to 10.0. More...
 
(PDF_DISPLAY_ZOOMMODE- getZoomMode
 get the zoom mode. More...
 
(BOOL) - gotoFirstPage:
 Go to the first page. More...
 
(BOOL) - gotoLastPage:
 Go to the last page. More...
 
(BOOL) - gotoNextPage:
 Go to the next page. More...
 
(void) - gotoNextView:
 Go to the next view. More...
 
(BOOL) - gotoPage:animated:
 Go to a specified page. More...
 
(BOOL) - gotoPage:animated:needJumpedNode:
 Go to a specified page. More...
 
(BOOL) - gotoPage:withDocPoint:animated:
 Go to a specified page, then move to a specified position in page. More...
 
(BOOL) - gotoPage:zoomToDocRect:animated:
 Go to a specified page, then move to a specified rect in page. If called continuously, the second jump will be called -[FSPDFViewCtrl gotoPage:withDocPoint: animated:], which may be slightly different from the first. More...
 
(BOOL) - gotoPrevPage:
 Go to the previous page. More...
 
(void) - gotoPrevView:
 Go to the previous view. More...
 
(BOOL) - hasNextView
 Check if there it is a page view next to the current page view on the page navigation stack. More...
 
(BOOL) - hasPrevView
 Check if there it is a page view in the preceding of current page view on the page navigation stack. More...
 
(instancetype) - initWithFrame:
 Initialize the view control. More...
 
(BOOL) - isContinuous
 Get the page layout mode wether is continuous. More...
 
(BOOL) - isDynamicXFA
 Whether the current document is dynamic XFA. More...
 
(bool) - isOwner
 Check if the current document is opened with the owner access. More...
 
(BOOL) - isPageVisible:
 Check whether a specified page is visible or not. More...
 
(bool) - isPPDF
 Check if the current document is PPDF format, which is Microsoft Rights Management PDF protected document. Usually with the .ppdf file extension. More...
 
(BOOL) - isRMSProtected
 Check whether the current document is protected by RMS(Right Management Services). More...
 
(BOOL) - isViewSignedDocument
 Get the value wether is view sign history document. More...
 
(void) - lockGesturesForRequires:
 Lock specific gestures on the current view to fulfill the corresponding requirement. More...
 
(void) - lockRefresh
 If page content is currently being edited or annotation is reseting the appearance, caller should lock refreshing before editting is done. More...
 
(void) - openDoc:password:completion:
 Open PDF document from a specified PDF file path. More...
 
(void) - openDocAtURL:password:completion:
 Open PDF document from a specified URL. This function is deprecated, it will be removed in future. More...
 
(void) - openDocFromFileReader:password:completion:
 Open PDF document from a memory buffer. More...
 
(void) - openDocFromMemory:password:completion:
 Open PDF document from a memory buffer. More...
 
(void) - openDocFromURL:password:cacheOption:httpRequestProperties:completion:
 Open PDF document from a specified URL. More...
 
(void) - refresh
 Refresh the display view. More...
 
(void) - refresh:
 Refresh a specified page view. More...
 
(void) - refresh:needRender:
 Refresh a specified page view. More...
 
(void) - refresh:needRender:clearCache:
 Refresh a specified rectangle area on page, in page view coordinate. More...
 
(void) - refresh:pageIndex:
 Refresh a specified rectangle area on page, in page view coordinate. More...
 
(void) - refresh:pageIndex:needRender:
 Refresh a specified rectangle area on page, in page view coordinate. More...
 
(void) - refresh:pageIndex:needRender:clearCache:
 Refresh a specified rectangle area on page, in page view coordinate. More...
 
(void) - refreshOverlay
 Refresh the overlay view. More...
 
(void) - registerDocEventListener:
 Register a document event listener. More...
 
(void) - registerDrawEventListener:
 Register an event listener for drawing page. More...
 
(void) - registerGestureEventListener:
 Register an event listener for gesture. More...
 
(void) - registerLayoutEventListener:
 Register an event listener for page layout. More...
 
(void) - registerPageEventListener:
 Register a page event listener. More...
 
(void) - registerRecoveryEventListener:
 Register an event listener for recovery from running out of memory. More...
 
(void) - registerReflowEventListener:
 Register an event listener for reflow page. More...
 
(void) - registerRenderEventListener:
 Register an event listener for rendering page. More...
 
(void) - registerScrollViewEventListener:
 Register an event listener for scrolling page views. More...
 
(void) - registerViewAppleEventListener:
 Register an event listener for view from apple. More...
 
(BOOL) - reloadXFADoc:page_index:
 Reload the XFA document when pages are added or deleted from the XFA document. More...
 
(void) - rotateView:
 
(BOOL) - saveDoc:flag:
 Save the document to a specified file path with saving flag. More...
 
(BOOL) - saveDoc:flag:complete:
 
(BOOL) - saveDocToFileWriter:flag:
 Save the document to a specified file writer with saving flag. More...
 
(void) - scrollDisplayView:distanceY:
 Scroll display view by the specified offset. More...
 
(void) - setBackgroundColor:
 Set background color of viewer. More...
 
(void) - setContinuous:
 Set the page layout mode wether is continuous. More...
 
(BOOL) - setCropMode:
 Set the page crop mode. More...
 
(BOOL) - setCropPageRect:pdfRect:
 Set crop rect of the specified page, others are original as default. More...
 
(void) - setDefaultPageWhenDocumentOpened:
 Set the default page number when the document is opened, calls before opening the document. More...
 
(void) - setDoc:
 Set the PDF document object to view control, then open the document. More...
 
(void) - setHScrollPos:animated:
 Set the horizontal scroll position. More...
 
(void) - setPageLayoutMode:
 Set the page layout mode. More...
 
(void) - setPageSpacing:
 Set page space between adjacent pages in view , Only valid for PDF_LAYOUT_MODE_TWO and PDF_LAYOUT_MODE_TWO_XXX mode. More...
 
(void) - setPageSpacing: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. More...
 
(void) - setPageViewEdgeInsets:moveOffset:
 Sets the edge insets of pdf page view. More...
 
(void) - setPDFDoc:XFADoc:
 Set the PDF document object and XFA document object to view control, then open the document. More...
 
(void) - setReflowMode:
 Set reflow mode. More...
 
(void) - setRMSAppClientId:redirectURI:
 Set the app client id and server URL for encryption or decryption of RMS protected PDF file. More...
 
(void) - setViewSignedDocument:
 Set the value wether is view sign history document. More...
 
(void) - setVScrollPos:animated:
 Set the vertical scroll position. More...
 
(void) - setZoom:
 Set the zoom level. More...
 
(void) - setZoom:origin:
 Zoom page from the specified position. More...
 
(void) - setZoom:withSlider:
 Set the zoom level. More...
 
(void) - setZoomMode:
 Set the zoom mode. More...
 
(void) - stopCurrentGestureRecognizerShouldBegin
 Stop the current gesture recognizer immediately. More...
 
(void) - unlockRefresh
 Unlock refreshing. More...
 
(void) - unregisterDocEventListener:
 Unregister a document event listener. More...
 
(void) - unregisterDrawEventListener:
 Unregister an event listener for drawing page. More...
 
(void) - unregisteRecoveryEventListener:
 Unregister an event listener for recovery from running out of memory. More...
 
(void) - unregisterGestureEventListener:
 Unregister an event listener for gesture. More...
 
(void) - unregisterLayoutEventListener:
 Unregister an event listener for page layout. More...
 
(void) - unregisterPageEventListener:
 Unregister a page event listener. More...
 
(void) - unregisterReflowEventListener:
 Unregister an event listener for reflow page. More...
 
(void) - unregisterRenderEventListener:
 Unregister an event listener for rendering page. More...
 
(void) - unregisterScrollViewEventListener:
 Unregister an event listener for scrolling page views. More...
 
(void) - unregisterViewAppleEventListener:
 Unregister an event listener for view from apple. More...
 
- Instance Methods inherited from <IRotationEventListener>
(void) - didRotateFromInterfaceOrientation:
 Triggered after rotation is done. More...
 
(void) - willAnimateRotationToInterfaceOrientation:duration:
 Triggered when animated rotation begins. More...
 
(void) - willRotateToInterfaceOrientation:duration:
 Triggered when rotation begins. More...
 
- Instance Methods inherited from <FSPageOrganizerDelegate>
(BOOL) - deletePagesAtIndexes:
 Delete the specifed pages. More...
 
(BOOL) - flattenPageAtIndex:display:options:
 Flatten the specifed page. More...
 
(NSString *) - getDocumentFilePath
 get file path to use in thumbnail More...
 
(BOOL) - insertPageFromImage:atIndex:
 Insert a new page from a specified image, the image will be converted to the new page. More...
 
(BOOL) - insertPages:pageSize:style:color:rotation:count:
 
(BOOL) - insertPages:width:height:style:color:rotation:count:
 
(void) - insertPagesFromDocument:withSourceIndexes:flags:layerName:atIndex:success:error:
 Insert multiple new pages to the current document with the pdf pages copied from the source pdf document. More...
 
(BOOL) - movePagesFromIndexes:toIndex:
 Move the specifed pages to the destination page, the moved pages will be inserted after the destination page. More...
 
(BOOL) - rotatePagesAtIndexes:clockwise:
 Rotate the specifed pages by 90 degree or -90 degree. More...
 

Class Methods

(BOOL) + fipsMode
 Check that whether the view control works on the FIPS mode (Federal Information Processing Standard). FIPS mode support requires a special build from Foxit.
More...
 
(BOOL) + handleMSALResponse:sourceApplication:
 
(void) + recoverForOOM
 Do the recovering when Foxit PDF SDK runs out of memory. More...
 
(void) + setExceptionLogger:
 The exception logger is for collecting info of exceptions or crashes. It will catch the unhandled NSException and applciation-wide signals. More...
 

Properties

int bottomOffset
 Get or set position of display view from the bottom of control. More...
 
FSRendererColorMode colorMode
 Color mode. More...
 
FSPDFDoccurrentDoc
 The current PDF document. More...
 
BOOL enablePageFlippingByTouchBorder
 Whether enable page flipping by touch border. Defaults is YES. More...
 
id< FSPDFUIExtensionsManagerextensionsManager
 The UI extensions manager. UI extensions manager will implement the UI related features such as annotation, outline. More...
 
NSString * filePath
 The file path of current document, which is from openDoc. More...
 
BOOL IsChangeLayoutMode
 is change layout mode. More...
 
BOOL isNightMode
 Night mode. A convenient way to set FSPDFViewControl::colorMode to FSRendererColorMode::FSRendererColorModeMapping and set corresponding colors. More...
 
BOOL keepZoomRatio
 Whether keep same page zoom when turning pages. Defaults is YES. More...
 
UIColor * mappingModeBackgroundColor
 Background color for FSRendererColorMode::FSRendererColorModeMapping or FSRendererColorMode::FSRendererColorModeMappingGray color mode. More...
 
UIColor * mappingModeForegroundColor
 Foreground color for FSRendererColorMode::FSRendererColorModeMapping or FSRendererColorMode::FSRendererColorModeMappingGray color mode. More...
 
CGFloat maxZoomLimit
 The maximum zoom scale. More...
 
NSTimeInterval minimumPressDuration
 Minimum long press interval. More...
 
CGFloat minZoomLimit
 The minimum zoom scale. More...
 
FSNightColorMode nightColorMode
 The night color mode. More...
 
PDF_PAGE_BINDING_EDGE pageBindingEdge
 Set or get the Page Binding. More...
 
UIColor * reflowBackgroundColor
 Get or set the background color for reflow mode. Format: 0.0~1.0, 0.0~1.0, 0.0~1.0, 1.0 RGBA. More...
 
BOOL refreshReflowAnnot
 
BOOL shouldRecover
 Whether or not should view control recover itself when runs out of memory. Default is YES. More...
 
BOOL supportsMultipleScenes
 A Boolean value that indicates whether the FSPDFViewCtrl may display multiple scenes simultaneously. More...
 

Detailed Description

Foxit PDF view control for viewing/editing/saving the PDF file.

There are three coordinate systems for PDF viewer control:

  • Display View CoordiNate System: Which is the displaying area of view control, all the pages will be displayed on the display view. Basically it is same frame as the PDF viewer control itself.
  • Page View Coordinate System: Each PDF page is displayed on a UIView, so that it is same as UIView coordinate system.
  • PDF Coordinate System: The PDF page coordinate system.

Method Documentation

◆ addPageJumpedNode:index:animated:

- (void) addPageJumpedNode: (int)  indexOld
index: (int)  indexNew
animated: (BOOL)  animated 

Add the page jumped node to page navigation stack.

Parameters
[in]indexOldThe old page index for before the jump. Valid range: from 0 to (count-1). count is the page count.
[in]indexNewThe new page index for after the jump. Valid range: from 0 to (count-1). count is the page count.
[in]animatedYES means to use animation effects. NO means not to use animation effects.

◆ appendPageView:

- (BOOL) appendPageView: (UIView *)  pageView

Append a customized UI view to pdf page views.

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

Parameters
[in]pageViewUser-defined view to be appended as the last page view. Note that it should NOT be a subview of FSPDFViewControl, that is, it's invalid to append a view returned by FSPDFViewControl::getPageView: FSPDFViewControl::getOverlayView: or FSPDFViewControl::getDisplayView:.
Returns
YES means success, while NO means failure.

◆ clearAllCacheFile

- (void) clearAllCacheFile

Clear all files cached by SDK.

Provided by category FSPDFViewCtrl(async).

◆ clearCacheFile:

- (void) clearCacheFile: (NSString *)  url

Clear the cache file.

Parameters
urlIt should be a remote path.

Provided by category FSPDFViewCtrl(async).

◆ clearPrevNextStack

- (void) clearPrevNextStack

Clear prev and next stack.

◆ clearRenderCache

- (void) clearRenderCache

Clear the render cache.

◆ closeDoc:

- (void) closeDoc: (void(^)(void))  cleanup

Close the document.

Parameters
[in]cleanupA callback function to clean up caller managed resources.

◆ convertDisplayViewPtToPageViewPt:pageIndex:

- (CGPoint) convertDisplayViewPtToPageViewPt: (CGPoint)  point
pageIndex: (int)  pageIndex 

Convert the display view point to page view point.

Parameters
[in]pointThe point on the display view, in display view coordinate.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Point on page view.

◆ convertDisplayViewRectToPageViewRect:pageIndex:

- (CGRect) convertDisplayViewRectToPageViewRect: (CGRect)  rect
pageIndex: (int)  pageIndex 

Convert the display view rectangle to page view coordination.

Parameters
[in]rectThe rectangle on display view, in display view coordinate.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Rectangle on page view.

◆ convertPageViewPtToDisplayViewPt:pageIndex:

- (CGPoint) convertPageViewPtToDisplayViewPt: (CGPoint)  point
pageIndex: (int)  pageIndex 

Convert the page view point to display view point.

Parameters
[in]pointThe point on the page view, in page view coordinate.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Point on display page view.

◆ convertPageViewPtToPdfPt:pageIndex:

- (FSPointF *) convertPageViewPtToPdfPt: (CGPoint)  point
pageIndex: (int)  pageIndex 

Convert the page view point to PDF page point.

Parameters
[in]pointThe point on the page view, in page view coordinate.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Point on PDF page.

◆ convertPageViewPtToReflowPagePt:reflowPage:pageIndex:

- (FSPointF *) convertPageViewPtToReflowPagePt: (CGPoint)  point
reflowPage: (FSReflowPage *)  reflowPage
pageIndex: (int)  pageIndex 

Convert the page view point to ReflowPage point.

Parameters
[in]pointThe point on the page view, in page view coordinate.
[in]reflowPageThe ReflowPage object.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Point on Reflow Page.

◆ convertPageViewRectToDisplayViewRect:pageIndex:

- (CGRect) convertPageViewRectToDisplayViewRect: (CGRect)  rect
pageIndex: (int)  pageIndex 

Convert the page view rectangle to display view coordination.

Parameters
[in]rectThe rectangle on page view, in page view coordinate.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Rectangle on display page view.

◆ convertPageViewRectToPdfRect:pageIndex:

- (FSRectF *) convertPageViewRectToPdfRect: (CGRect)  rect
pageIndex: (int)  pageIndex 

Convert the page view rectangle to PDF rectangle.

Parameters
[in]rectThe rectangle on page view, in page view coordinate.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
PDF rectangle.

◆ convertPageViewRectToReflowPageRect:reflowPage:pageIndex:

- (FSRectF *) convertPageViewRectToReflowPageRect: (CGRect)  rect
reflowPage: (FSReflowPage *)  reflowPage
pageIndex: (int)  pageIndex 

Convert the page view rectangle to ReflowPage rectangle.

Parameters
[in]rectThe rectangle on page view, in page view coordinate.
[in]reflowPageThe ReflowPage object.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
PDF rectangle.

◆ convertPdfPtToPageViewPt:pageIndex:

- (CGPoint) convertPdfPtToPageViewPt: (FSPointF *)  point
pageIndex: (int)  pageIndex 

Convert the PDF page point to page view point.

Parameters
[in]pointThe point on the PDF Page, in PDF coordinate.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Point on page view.

◆ convertPdfRectToPageViewRect:pageIndex:

- (CGRect) convertPdfRectToPageViewRect: (FSRectF *)  rect
pageIndex: (int)  pageIndex 

Convert the PDF rectangle to page view rectangle.

Parameters
[in]rectThe rectangle on the PDF page, in pdf coordinate.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Page view rectangle.

◆ convertReflowPagePtToPageViewPt:reflowPage:pageIndex:

- (CGPoint) convertReflowPagePtToPageViewPt: (FSPointF *)  point
reflowPage: (FSReflowPage *)  reflowPage
pageIndex: (int)  pageIndex 

Convert the ReflowPage page point to page view point.

Parameters
[in]pointThe point on the PDF Page, in PDF coordinate.
[in]reflowPageThe ReflowPage object.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Point on page view.

◆ convertReflowPageRectToPageViewRect:reflowPage:pageIndex:

- (CGRect) convertReflowPageRectToPageViewRect: (FSRectF *)  rect
reflowPage: (FSReflowPage *)  reflowPage
pageIndex: (int)  pageIndex 

Convert the ReflowPage rectangle to page view rectangle.

Parameters
[in]rectThe rectangle on the ReflowPage, in pdf coordinate.
[in]reflowPageThe ReflowPage object.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Page view rectangle.

◆ fipsMode

+ (BOOL) fipsMode

Check that whether the view control works on the FIPS mode (Federal Information Processing Standard). FIPS mode support requires a special build from Foxit.

Provided by category FSPDFViewCtrl(fips).

◆ getCropInsets:

- (UIEdgeInsets) getCropInsets: (int)  pageIndex

Get crop mode inset.

Parameters
[in]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.
Returns
crop mode inset.

◆ getCropMode

- (PDF_CROP_MODE) getCropMode

Get crop mode.

Returns
crop mode. PDF_CROP_MODE_NONE if the current view mode is not crop.

◆ getCurrentPage

- (int) getCurrentPage

Get current page index.

Returns
Index of current page, starting from 0.

◆ getDefaultPageScale

- (float) getDefaultPageScale

Get the default page scale.

Returns
default page scale.

◆ getDisplayMatrix:

- (FSMatrix2D *) getDisplayMatrix: (int)  pageIndex

Get the display matrix of a specified page, which transforms from PDF coordinate to page view coordinate.

Parameters
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
Returns
Display matrix.

◆ getDisplayMatrix:fromOrigin:

- (FSMatrix2D *) getDisplayMatrix: (int)  pageIndex
fromOrigin: (CGPoint)  originPoint 

Get the display matrix of a specified page from the origin point on page view, which transforms from PDF coordinate to page view coordinate.

Parameters
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The specified page should be visible.
[in]originPointThe origin point on the page view, in page view coordinate.
Returns
Display matrix.

◆ getDisplayView

- (UIView *) getDisplayView

Get the display view. PDF pages and page transition effects are displayed on the display view.

Returns
Display view.

◆ getDisplayViewHeight

- (float) getDisplayViewHeight

Get the height of the display view.

Returns
Height of the display view.

◆ getDisplayViewWidth

- (float) getDisplayViewWidth

Get the width of the display view.

Returns
Width of the display view.

◆ getDoc

- (FSPDFDoc *) getDoc

Get the current PDF document object from view control.

Returns
Current PDF document object.

◆ getDocPermissions

- (FSPDFDocUserPermissions) getDocPermissions

Get the permissions of the current PDF document.

Returns
Permissions of the current PDF document, which is combined of one or more enumeration type FSPDFDocUserPermissions.

◆ getHScrollPos

- (double) getHScrollPos

Get the horizontal scroll position.

Returns
Horizontal scroll position.

◆ getHScrollRange

- (double) getHScrollRange

Get the maximum horizontal scroll range.

Returns
Horizontal scroll range.

◆ getLockedOptions

- (FSGestureLockOptions) getLockedOptions

Retrieves the currently locked options.

Returns
A bitmask of currently locked options, represented by FSGestureLockOptions.

◆ getOverlayView:

- (UIView *) getOverlayView: (int)  pageIndex

Get the overlay view on the page, specified by page index.

Overlay view is on top of the page view,visual effects such as the highlight on text, will be drawn on it. To draw onto the overlay view, IDrawEventListener should be registered first.

Parameters
[in]pageIndexPage index. Valid range: from 0 to (count-1). count is the page count.
The page specified by this index should be visible.
Returns
The overlay UI view.

◆ getPageContainer

- (UIScrollView *) getPageContainer

Get the page container.

Returns
Page container.

◆ getPageCount

- (int) getPageCount

Get the page count of PDF document.

Returns
The count of page.

◆ getPageIndex:

- (int) getPageIndex: (CGPoint)  displayViewPt

Get the page index at the specified point, in display view space.

Parameters
[in]displayViewPtPoint in display view space.
Returns
Page index, starting from 0.

◆ getPageLayoutMode

- (PDF_LAYOUT_MODE) getPageLayoutMode

Get the page layout mode.

Returns
Page layout mode. Please refer to PDF_LAYOUT_MODE::PDF_LAYOUT_MODE_XXX values and it would be one of these values.

◆ getPageView:

- (UIView *) getPageView: (int)  pageIndex

Get the page view by page index.

Page view is used to draw PDF page content and annotations.

Parameters
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
The page specified by this index should be visible.
Returns
The page UI view.

◆ getPageViewDoubleTapGesture:

- (UITapGestureRecognizer *) getPageViewDoubleTapGesture: (int)  pageIndex

Get the double tap gesture recognizer of page view by page index.

the double tap gesture recognizer of page view.

Parameters
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
The page specified by this index should be visible.
Returns
the double tap gesture recognizer of page view.

◆ getPageViewHeight:

- (float) getPageViewHeight: (int)  pageIndex

Get the height of a specified page view.

Parameters
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The page specified by this index should be visible.
Returns
Height of the specified page view.

◆ getPageViewWidth:

- (float) getPageViewWidth: (int)  pageIndex

Get the width of a specified page view.

Parameters
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count. The page specified by this index should be visible.
Returns
Width of the specified page view.

◆ getReflowMode

- (PDF_REFLOW_REFLOWMODE) getReflowMode

Get reflow mode.

Returns
Reflow mode. PDF_REFLOW_NONE if the current view mode is not reflow.

◆ getReflowPageScale

- (float) getReflowPageScale

Gets the scale at which the reflowpage was generated.

Returns
The scale at which reflowpage is currently generated

◆ getScale

- (float) getScale

Get the page scale.

Returns
page scale.

◆ getUIDevicePPI

- (float) getUIDevicePPI

Get the ppi of the current device.

Returns
Current equipment ppi

◆ getViewRotation

- (int) getViewRotation

Returns the rotation of the view. Please refer to FSRotation values and this should be one of these values.

◆ getVisiblePages

- (NSMutableArray *) getVisiblePages

Get the visible pages in current view control.

This method works with layout mode PDF_LAYOUT_MODE::PDF_LAYOUT_MODE_SINGLE and get continuous is true.

Returns
NSNumber array of visible pages' indexes.

◆ getVScrollPos

- (double) getVScrollPos

Get the vertical scroll position.

Returns
Vertical scroll position.

◆ getVScrollRange

- (double) getVScrollRange

Get the maximum vertical scroll range.

Returns
Vertical scroll range.

◆ getXFADoc

- (FSXFADoc *) getXFADoc

Return XFA document object if the current document is XFA, else return nil.

Provided by category FSPDFViewCtrl(xfa).

◆ getZoom

- (float) getZoom

Get the zoom level. Valid range: from 1.0 to 20.0 for reflow mode, others 1.0 to 10.0.

For the layout mode except reflow, 1.0 represents that the pdf pages would fit to the width of the view control.

Returns
Zoom level.

◆ getZoomMode

- (PDF_DISPLAY_ZOOMMODE) getZoomMode

get the zoom mode.

◆ gotoFirstPage:

- (BOOL) gotoFirstPage: (BOOL)  animated

Go to the first page.

Parameters
[in]animatedYES means to use animation effects. NO means not to use animation effects.
Returns
YES means succeed. NO means failed.

◆ gotoLastPage:

- (BOOL) gotoLastPage: (BOOL)  animated

Go to the last page.

Parameters
[in]animatedYES means to use animation effects. NO means not to use animation effects.
Returns
YES means succeed. NO means failed.

◆ gotoNextPage:

- (BOOL) gotoNextPage: (BOOL)  animated

Go to the next page.

Parameters
[in]animatedYES means to use animation effects. NO means not to use animation effects.
Returns
YES means succeed. NO means failed.

◆ gotoNextView:

- (void) gotoNextView: (BOOL)  animated

Go to the next view.

Parameters
[in]animatedYES means to use animation effects. NO means not to use animation effects.

◆ gotoPage:animated:

- (BOOL) gotoPage: (int)  index
animated: (BOOL)  animated 

Go to a specified page.

Parameters
[in]indexPage index. Valid range: from 0 to (count-1). count is the page count.
[in]animatedYES means to use animation effects. NO means not to use animation effects.
Returns
YES means succeed. NO means failed.

◆ gotoPage:animated:needJumpedNode:

- (BOOL) gotoPage: (int)  index
animated: (BOOL)  animated
needJumpedNode: (BOOL)  needJumpedNode 

Go to a specified page.

Parameters
[in]indexPage index. Valid range: from 0 to (count-1). count is the page count.
[in]animatedYES means to use animation effects. NO means not to use animation effects.
[in]needJumpedNodeYES means to add the jumped node to page navigation stack. NO means not to add the jumped node to page navigation stack.
Returns
YES means succeed. NO means failed.

◆ gotoPage:withDocPoint:animated:

- (BOOL) gotoPage: (int)  index
withDocPoint: (FSPointF *)  point
animated: (BOOL)  animated 

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

Parameters
[in]indexPage index. Valid range: from 0 to (count-1). count is the page count.
[in]pointSpecified position.
[in]animatedYES means to use animation effects. NO means not to use animation effects.
Returns
YES means succeed. NO means failed.

◆ gotoPage:zoomToDocRect:animated:

- (BOOL) gotoPage: (int)  index
zoomToDocRect: (FSRectF *)  rect
animated: (BOOL)  animated 

Go to a specified page, then move to a specified rect in page. If called continuously, the second jump will be called -[FSPDFViewCtrl gotoPage:withDocPoint: animated:], which may be slightly different from the first.

Parameters
[in]indexPage index. Valid range: from 0 to (count-1). count is the page count.
[in]rectSpecified rect.
[in]animatedYES means to use animation effects. NO means not to use animation effects.
Returns
YES means succeed. NO means failed.

◆ gotoPrevPage:

- (BOOL) gotoPrevPage: (BOOL)  animated

Go to the previous page.

Parameters
[in]animatedYES means to use animation effects. NO means not to use animation effects.
Returns
YES means succeed. NO means failed.

◆ gotoPrevView:

- (void) gotoPrevView: (BOOL)  animated

Go to the previous view.

Parameters
[in]animatedYES means to use animation effects. NO means not to use animation effects.

◆ handleMSALResponse:sourceApplication:

+ (BOOL) handleMSALResponse: (nonnull NSURL *)  response
sourceApplication: (nullable NSString *)  sourceApplication 

Ask MSAL to handle URL response. You MUST implement this API in following cases:

  1. Your application handler for MSAL web or brokered authentication sessions, AND
  2. You're using iOS 13 multiple window feature and your code implements UISceneDelegate instead of UIApplicationDelegate

You should call this API from your UISceneDelegate implementation, for example:

  • (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts { UIOpenURLContext *context = URLContexts.anyObject; NSURL *url = context.URL; NSString *sourceApplication = context.options.sourceApplication;

    [FSPDFViewCtrl handleMSALResponse:url sourceApplication:sourceApplication]; }

Calling this API ensures that MSAL can receive tokens from the Microsoft Authenticator application.

Returns
YES if it is MSAL response and it was handled NO if it is not MSAL response or there was a failure in handling.

Provided by category FSPDFViewCtrl(rms).

◆ hasNextView

- (BOOL) hasNextView

Check if there it is a page view next to the current page view on the page navigation stack.

PDF view control keeps a stack to track navigation on all pages.

Returns
YES means there is a next page view. NO means there is no next page view.

◆ hasPrevView

- (BOOL) hasPrevView

Check if there it is a page view in the preceding of current page view on the page navigation stack.

PDF view control keeps a stack to track navigation on all pages.

Returns
YES means there is a previous page view. NO means there is no previous page view.

◆ initWithFrame:

- (instancetype) initWithFrame: (CGRect)  frame

Initialize the view control.

Parameters
[in]frame.
Returns
The view control instance.

◆ isContinuous

- (BOOL) isContinuous

Get the page layout mode wether is continuous.

Returns
YES means continuous mode, while NO means not continuous mode .

◆ isDynamicXFA

- (BOOL) isDynamicXFA

Whether the current document is dynamic XFA.

Provided by category FSPDFViewCtrl(xfa).

◆ isOwner

- (bool) isOwner

Check if the current document is opened with the owner access.

◆ isPageVisible:

- (BOOL) isPageVisible: (int)  pageIndex

Check whether a specified page is visible or not.

This method works with layout mode PDF_LAYOUT_MODE::PDF_LAYOUT_MODE_SINGLE and get continuous is true.

Parameters
[in]pageIndexIndex of the specified page. Valid range: from 0 to (count-1). count is the page count.
Returns
YES means the specified page is visible. NO means the specified page is invisible.

◆ isPPDF

- (bool) isPPDF

Check if the current document is PPDF format, which is Microsoft Rights Management PDF protected document. Usually with the .ppdf file extension.

◆ isRMSProtected

- (BOOL) isRMSProtected

Check whether the current document is protected by RMS(Right Management Services).

Provided by category FSPDFViewCtrl(rms).

◆ isViewSignedDocument

- (BOOL) isViewSignedDocument

Get the value wether is view sign history document.

Returns
YES means view sign history document, while NO means not view sign history document .

◆ lockGesturesForRequires:

- (void) lockGesturesForRequires: (FSGestureLockOptions options

Lock specific gestures on the current view to fulfill the corresponding requirement.

Parameters
optionsA bitmask specifying the gestures to lock. Use FSGestureLockOptions to combine multiple gesture options. For example: FSGestureLockOptionSingleTap | FSGestureLockOptionPinch locks single-tap and pinch gestures.

◆ lockRefresh

- (void) lockRefresh

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

◆ openDoc:password:completion:

- (void) openDoc: (NSString *)  filePath
password: (NSString *_Nullable)  password
completion: (void(^)(FSErrorCode error))  completion 

Open PDF document from a specified PDF file path.

Parameters
[in]filePathA PDF file full path.
[in]passwordThe password string, used to load the PDF document content. It can be either user password or owner password. Set it to nil if the password is unknown.
[in]completionThe callback will be called when current document object becomes available or the view control fail to open the document.

◆ openDocAtURL:password:completion:

- (void) openDocAtURL: (NSURL *)  url
password: (NSString *)  password
completion: (void(^)(FSErrorCode error))  completion 

Open PDF document from a specified URL. This function is deprecated, it will be removed in future.

Parameters
[in]urlPDF URL.
[in]passwordThe password string, used to load the PDF document content. It can be either user password or owner password. Set it to nil if the password is unknown.
[in]completionThe callback will be called when current document object becomes available or the view control fail to open the document.

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

Provided by category FSPDFViewCtrl(async).

◆ openDocFromFileReader:password:completion:

- (void) openDocFromFileReader: (id< FSFileReaderCallback >)  fileReader
password: (NSString *_Nullable)  password
completion: (void(^)(FSErrorCode error))  completion 

Open PDF document from a memory buffer.

Parameters
[in]fileReaderA file reader callback, used to open the PDF fie..
[in]passwordThe password string, used to load the PDF document content. It can be either user password or owner password. Set it to nil if the password is unknown.
[in]completionThe callback will be called when document becomes available or fail to open the document.

◆ openDocFromMemory:password:completion:

- (void) openDocFromMemory: (NSData *)  buffer
password: (NSString *_Nullable)  password
completion: (void(^)(FSErrorCode error))  completion 

Open PDF document from a memory buffer.

Parameters
[in]bufferA memory buffer, containing the whole PDF file data.
[in]passwordThe password string, used to load the PDF document content. It can be either user password or owner password. Set it to nil if the password is unknown.
[in]completionThe callback will be called when document becomes available or fail to open the document.

◆ openDocFromURL:password:cacheOption:httpRequestProperties:completion:

- (void) openDocFromURL: (NSURL *)  url
password: (NSString *)  password
cacheOption: (nullable CacheFileOption *)  cacheOption
httpRequestProperties: (nullable HttpRequestProperties *)  properties
completion: (void(^)(FSErrorCode error))  completion 

Open PDF document from a specified URL.

Parameters
[in]urlPDF URL.
[in]passwordThe password string, used to load the PDF document content. It can be either user password or owner password. Set it to nil if the password is unknown.
[in]cacheOptionThe cache option. Please refer to FSCacheFileOption.
[in]completionThe callback will be called when current document object becomes available or the view control fail to open the document.

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

Provided by category FSPDFViewCtrl(async).

◆ recoverForOOM

+ (void) recoverForOOM

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

Foxit PDF SDK will call this method automatically. Caller should use it carefully, current reading status will be restored, but all the editing to document won't be restored.

◆ refresh

- (void) refresh

Refresh the display view.

◆ refresh:

- (void) refresh: (int)  pageIndex

Refresh a specified page view.

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

◆ refresh:needRender:

- (void) refresh: (int)  pageIndex
needRender: (BOOL)  needRender 

Refresh a specified page view.

Parameters
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
[in]needRenderIf YES, will render the specified PDF page, then refresh the overlay view; if NO, will refresh the overlay view only.

◆ refresh:needRender:clearCache:

- (void) refresh: (int)  pageIndex
needRender: (BOOL)  needRender
clearCache: (BOOL)  clearCache 

Refresh a specified rectangle area on page, in page view coordinate.

Parameters
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
[in]needRenderIf YES, will render the specified PDF page, then refresh the overlay view; if NO, will refresh the overlay view only.
[in]clearCacheIf YES, will clear page content cache.

◆ refresh:pageIndex:

- (void) refresh: (CGRect)  rect
pageIndex: (int)  pageIndex 

Refresh a specified rectangle area on page, in page view coordinate.

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

◆ refresh:pageIndex:needRender:

- (void) refresh: (CGRect)  rect
pageIndex: (int)  pageIndex
needRender: (BOOL)  needRender 

Refresh a specified rectangle area on page, in page view coordinate.

Parameters
[in]rectThe rectangle are on page, in page view coordinate.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
[in]needRenderIf YES, will render the specified PDF page, then refresh the overlay view; if NO, will refresh the overlay view only.

◆ refresh:pageIndex:needRender:clearCache:

- (void) refresh: (CGRect)  rect
pageIndex: (int)  pageIndex
needRender: (BOOL)  needRender
clearCache: (BOOL)  clearCache 

Refresh a specified rectangle area on page, in page view coordinate.

Parameters
[in]rectThe rectangle are on page, in page view coordinate.
[in]pageIndexPage index.Valid range: from 0 to (count-1). count is the page count.
[in]needRenderIf YES, will render the specified PDF page, then refresh the overlay view; if NO, will refresh the overlay view only.
[in]clearCacheIf YES, will clear page content cache.

◆ refreshOverlay

- (void) refreshOverlay

Refresh the overlay view.

◆ registerDocEventListener:

- (void) registerDocEventListener: (id< IDocEventListener >)  listener

Register a document event listener.

Parameters
[in]listenerA document event listener to be registered.

◆ registerDrawEventListener:

- (void) registerDrawEventListener: (id< IDrawEventListener >)  listener

Register an event listener for drawing page.

Parameters
[in]listenerAn event listener for drawing page to be registered.

◆ registerGestureEventListener:

- (void) registerGestureEventListener: (id< IGestureEventListener >)  listener

Register an event listener for gesture.

If method implementation of protocol returns YES, then the next listener will not receive the method call.

Parameters
[in]listenerAn event listener for gesture to be registered.

◆ registerLayoutEventListener:

- (void) registerLayoutEventListener: (id< ILayoutEventListener >)  listener

Register an event listener for page layout.

Parameters
[in]listenerAn event listener for page layout to be registered.

◆ registerPageEventListener:

- (void) registerPageEventListener: (id< IPageEventListener >)  listener

Register a page event listener.

Parameters
[in]listenerA page event listener to be registered.

◆ registerRecoveryEventListener:

- (void) registerRecoveryEventListener: (id< IRecoveryEventListener >)  listener

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

Parameters
[in]listenerAn event listener for recovery from running out of memory to be registered.

◆ registerReflowEventListener:

- (void) registerReflowEventListener: (id< IReflowEventListener >)  listener

Register an event listener for reflow page.

Parameters
[in]listenerAn event listener for reflowing page to be registered.

◆ registerRenderEventListener:

- (void) registerRenderEventListener: (id< IRenderEventListener >)  listener

Register an event listener for rendering page.

Parameters
[in]listenerAn event listener for rendering page to be registered.

◆ registerScrollViewEventListener:

- (void) registerScrollViewEventListener: (id< IScrollViewEventListener >)  listener

Register an event listener for scrolling page views.

Parameters
[in]listenerAn event listener for scrolling page views to be registered.

◆ registerViewAppleEventListener:

- (void) registerViewAppleEventListener: (id< IViewAppleEventListener >)  listener

Register an event listener for view from apple.

Parameters
[in]listenerAn event listener to receive apple's interface.

◆ reloadXFADoc:page_index:

- (BOOL) reloadXFADoc: (FSDocProviderCallbackPageViewEventType)  page_view_event_type
page_index: (NSArray< NSNumber * > *)  pageIndexes 

Reload the XFA document when pages are added or deleted from the XFA document.

Parameters
[in]page_view_event_typeThe event such as adding/deleting pages.
[in]pageIndexesThe related page indexes associate with event.

Provided by category FSPDFViewCtrl(xfa).

◆ rotateView:

- (void) rotateView: (int)  rotation

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

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

◆ saveDoc:flag:

- (BOOL) saveDoc: (NSString *)  filePath
flag: (FSPDFDocSaveFlags flag 

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

Parameters
[in]filePathFile path for the new saved PDF file.
[in]flagDocument saving flags.
Returns
YES means the saving is successfully finished, while NO means failure.

◆ saveDoc:flag:complete:

- (BOOL) saveDoc: (NSString *)  filePath
flag: (FSPDFDocSaveFlags flag
complete: (void(^)(FSErrorCode errorCode))  complete 

◆ saveDocToFileWriter:flag:

- (BOOL) saveDocToFileWriter: (id< FSFileWriterCallback >)  fileWriter
flag: (FSPDFDocSaveFlags flag 

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

Parameters
[in]fileWriterFile writer callback for the new saved PDF file.
[in]flagDocument saving flags.
Returns
YES means the saving is successfully finished, while NO means failure.

◆ scrollDisplayView:distanceY:

- (void) scrollDisplayView: (float)  distanceX
distanceY: (float)  distanceY 

Scroll display view by the specified offset.

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

◆ setBackgroundColor:

- (void) setBackgroundColor: (UIColor *_Nullable)  color

Set background color of viewer.

Parameters
[in]colorNew background color.

◆ setContinuous:

- (void) setContinuous: (BOOL)  isContinuous

Set the page layout mode wether is continuous.

Parameters
[in]isContinuousYES means continuous mode, while NO means not continuous mode.

◆ setCropMode:

- (BOOL) setCropMode: (PDF_CROP_MODE mode

Set the page crop mode.

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

Parameters
[in]modeCrop mode. It should be one of following values:
  • PDF_CROP_MODE::PDF_CROP_MODE_NONE means exiting crop mode.
  • PDF_CROP_MODE::PDF_CROP_MODE_CONTENTSBOX means cropping margin according to bounding box of all contents.
  • PDF_CROP_MODE::PDF_CROP_MODE_DETECTION means cropping margin by detecting paths or images.
  • PDF_CROP_MODE::PDF_CROP_MODE_CUSTOMIZED means cropping margin with custom pages & rects from addCropPageRect:pdfRect:. Meaningful after addCropPageRect:pdfRect: is called.
Returns
YES means success, while NO means failure.

◆ setCropPageRect:pdfRect:

- (BOOL) setCropPageRect: (int)  pageIndex
pdfRect: (FSRectF *_Nullable)  pdfRect 

Set crop rect of the specified page, others are original as default.

It won't take effert until calling setCropMode:PDF_CROP_MODE::PDF_CROP_MODE_CUSTOMIZED.

Parameters
[in]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.
[in]pdfRectThe crop rectangle on the PDF page, in pdf coordinate.
Returns
YES means success, while NO means failure.

◆ setDefaultPageWhenDocumentOpened:

- (void) setDefaultPageWhenDocumentOpened: (int)  index

Set the default page number when the document is opened, calls before opening the document.

Parameters
[in]indexPage index. Valid range: from 0 to (count-1). count is the page count.

◆ setDoc:

- (void) setDoc: (FSPDFDoc *)  doc

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

Parameters
[in]docA PDF document object.

◆ setExceptionLogger:

+ (void) setExceptionLogger: (nullable id< FSExceptionLoggerDelegate >)  logger

The exception logger is for collecting info of exceptions or crashes. It will catch the unhandled NSException and applciation-wide signals.

Parameters
[in]loggerA protocal to be implemented for getting the exception info. If it is set to nil, then SDK will not catch the exceptions.

◆ setHScrollPos:animated:

- (void) setHScrollPos: (double)  pos
animated: (BOOL)  animated 

Set the horizontal scroll position.

Parameters
[in]posNew horizontal scroll position.
[in]animatedYES means to use animation effects. NO means not to use animation effects.

◆ setPageLayoutMode:

- (void) setPageLayoutMode: (PDF_LAYOUT_MODE mode

Set the page layout mode.

Parameters
[in]modePage layout mode. Please refer to PDF_LAYOUT_MODE::PDF_LAYOUT_MODE_XXX values and it should be one of these values. PDF_LAYOUT_MODE::PDF_LAYOUT_MODE_UNKNOWN will not work.

◆ setPageSpacing:

- (void) setPageSpacing: (int)  pageSpace

Set page space between adjacent pages in view , Only valid for PDF_LAYOUT_MODE_TWO and PDF_LAYOUT_MODE_TWO_XXX mode.

Parameters
[in]pageSpaceSpace of adjacent pages in view. default: 1. valid range: from 0 to 100;

◆ setPageSpacing:direction:

- (void) setPageSpacing: (int)  pageSpace
direction: (FS_PAGESPACING_DIRECTION 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
[in]pageSpaceSpace of adjacent pages in view. valid range: from 0 to 10; Note: The default value of the vertical spacing is 2,and the default value of the horizontal spacing is 1.
[in]directionUsed to decide which kind of direction spacing will be set. Please refer to values starting from PDFViewCtrl#FS_PAGESPACING_DIRECTION and this can be one or a combination of these values.

◆ setPageViewEdgeInsets:moveOffset:

- (void) setPageViewEdgeInsets: (UIEdgeInsets)  pageViewEdgeInsets
moveOffset: (BOOL)  moveOffset 

Sets the edge insets of pdf page view.

Parameters
[in]pageViewEdgeInsetsEdge insets value of pdf page view.
[in]moveOffsetWhether to offset after setting page margins.

◆ setPDFDoc:XFADoc:

- (void) setPDFDoc: (FSPDFDoc *)  doc
XFADoc: (FSXFADoc *)  xfadoc 

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

Parameters
[in]docA PDF document object.
[in]xfadocA XFA document object.

◆ setReflowMode:

- (void) setReflowMode: (PDF_REFLOW_REFLOWMODE reflowMode

Set reflow mode.

Parameters
[in]reflowModereflow mode.

◆ setRMSAppClientId:redirectURI:

- (void) setRMSAppClientId: (nonnull NSString *)  appClientId
redirectURI: (nonnull NSString *)  redirectURI 

Set the app client id and server URL for encryption or decryption of RMS protected PDF file.

Provided by category FSPDFViewCtrl(rms).

◆ setViewSignedDocument:

- (void) setViewSignedDocument: (BOOL)  isViewSignedDocument

Set the value wether is view sign history document.

Parameters
[in]isViewSignedDocumentYES means sign history document, while NO means not sign history document.

◆ setVScrollPos:animated:

- (void) setVScrollPos: (double)  pos
animated: (BOOL)  animated 

Set the vertical scroll position.

Parameters
[in]posNew vertical scroll position.
[in]animatedYES means to use animation effects. NO means not to use animation effects.

◆ setZoom:

- (void) setZoom: (float)  zoom

Set the zoom level.

For the layout mode except reflow, 1.0 represents that the pdf pages would fit to the width of the view control.

Parameters
[in]zoomNew zoom level.Valid range: from 1.0 to 20.0 for reflow mode, others 1.0 to 10.0.

◆ setZoom:origin:

- (void) setZoom: (float)  zoom
origin: (CGPoint)  origin 

Zoom page from the specified position.

For the layout mode except reflow, 1.0 represents that the pdf pages would fit to the width of the view control.

Parameters
[in]zoomNew zoom level.Valid range: from 1.0 to 20.0 for reflow mode, others 1.0 to 10.0.
[in]originA specified position, in display view space.

◆ setZoom:withSlider:

- (void) setZoom: (float)  zoom
withSlider: (BOOL)  isWithSlider 

Set the zoom level.

For the layout mode except reflow, 1.0 represents that the pdf pages would fit to the width of the view control.

Parameters
[in]zoomNew zoom level.Valid range: from 1.0 to 20.0 for reflow mode, others 1.0 to 10.0.
[in]isWithSliderWhether to use the slider tool directly.

◆ setZoomMode:

- (void) setZoomMode: (PDF_DISPLAY_ZOOMMODE zoomMode

Set the zoom mode.

Parameters
[in]zoomModeNew zoom mode.

◆ stopCurrentGestureRecognizerShouldBegin

- (void) stopCurrentGestureRecognizerShouldBegin

Stop the current gesture recognizer immediately.

◆ unlockRefresh

- (void) unlockRefresh

Unlock refreshing.

◆ unregisterDocEventListener:

- (void) unregisterDocEventListener: (id< IDocEventListener >)  listener

Unregister a document event listener.

Parameters
[in]listenerA document event listener to be unregistered.

◆ unregisterDrawEventListener:

- (void) unregisterDrawEventListener: (id< IDrawEventListener >)  listener

Unregister an event listener for drawing page.

Parameters
[in]listenerAn event listener for drawing page to be unregistered.

◆ unregisteRecoveryEventListener:

- (void) unregisteRecoveryEventListener: (id< IRecoveryEventListener >)  listener

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

Parameters
[in]listenerAn event listener for recovery from running out of memory to be unregistered.

◆ unregisterGestureEventListener:

- (void) unregisterGestureEventListener: (id< IGestureEventListener >)  listener

Unregister an event listener for gesture.

Parameters
[in]listenerAn event listener for gesture to be unregistered.

◆ unregisterLayoutEventListener:

- (void) unregisterLayoutEventListener: (id< ILayoutEventListener >)  listener

Unregister an event listener for page layout.

Parameters
[in]listenerAn event listener for page layout to be unregistered.

◆ unregisterPageEventListener:

- (void) unregisterPageEventListener: (id< IPageEventListener >)  listener

Unregister a page event listener.

Parameters
[in]listenerA page event listener to be unregistered.

◆ unregisterReflowEventListener:

- (void) unregisterReflowEventListener: (id< IReflowEventListener >)  listener

Unregister an event listener for reflow page.

Parameters
[in]listenerAn event listener for reflowing page to be unregistered.

◆ unregisterRenderEventListener:

- (void) unregisterRenderEventListener: (id< IRenderEventListener >)  listener

Unregister an event listener for rendering page.

Parameters
[in]listenerAn event listener for rendering page to be unregistered.

◆ unregisterScrollViewEventListener:

- (void) unregisterScrollViewEventListener: (id< IScrollViewEventListener >)  listener

Unregister an event listener for scrolling page views.

Parameters
[in]listenerAn event listener for scrolling page views to be unregistered.

◆ unregisterViewAppleEventListener:

- (void) unregisterViewAppleEventListener: (id< IViewAppleEventListener >)  listener

Unregister an event listener for view from apple.

Parameters
[in]listenerAn event listener to receive apple's interface.

Property Documentation

◆ bottomOffset

- (int) bottomOffset
readwritenonatomicassign

Get or set position of display view from the bottom of control.

◆ colorMode

◆ currentDoc

- (FSPDFDoc*) currentDoc
readwritenonatomicstrong

The current PDF document.

◆ enablePageFlippingByTouchBorder

- (BOOL) enablePageFlippingByTouchBorder
readwritenonatomicassign

Whether enable page flipping by touch border. Defaults is YES.

◆ extensionsManager

- (id<FSPDFUIExtensionsManager>) extensionsManager
readwritenonatomicweak

The UI extensions manager. UI extensions manager will implement the UI related features such as annotation, outline.

◆ filePath

- (NSString*) filePath
readnonatomicstrong

The file path of current document, which is from openDoc.

◆ IsChangeLayoutMode

- (BOOL) IsChangeLayoutMode
readwritenonatomicassign

is change layout mode.

◆ isNightMode

- (BOOL) isNightMode
readwritenonatomicassign

Night mode. A convenient way to set FSPDFViewControl::colorMode to FSRendererColorMode::FSRendererColorModeMapping and set corresponding colors.

◆ keepZoomRatio

- (BOOL) keepZoomRatio
readwritenonatomicassign

Whether keep same page zoom when turning pages. Defaults is YES.

◆ mappingModeBackgroundColor

- (UIColor*) mappingModeBackgroundColor
readwritenonatomicstrong

◆ mappingModeForegroundColor

- (UIColor*) mappingModeForegroundColor
readwritenonatomicstrong

◆ maxZoomLimit

- (CGFloat) maxZoomLimit
readwritenonatomicassign

The maximum zoom scale.

◆ minimumPressDuration

- (NSTimeInterval) minimumPressDuration
readwritenonatomicassign

Minimum long press interval.

◆ minZoomLimit

- (CGFloat) minZoomLimit
readwritenonatomicassign

The minimum zoom scale.

◆ nightColorMode

- (FSNightColorMode) nightColorMode
readwritenonatomicassign

The night color mode.

◆ pageBindingEdge

- (PDF_PAGE_BINDING_EDGE) pageBindingEdge
readwritenonatomicassign

Set or get the Page Binding.

Set the PDF_PAGE_BINDING_EDGE 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 PDF_PAGE_BINDING_LEFT_EDGE.

◆ reflowBackgroundColor

- (UIColor*) reflowBackgroundColor
readwritenonatomicstrong

Get or set the background color for reflow mode. Format: 0.0~1.0, 0.0~1.0, 0.0~1.0, 1.0 RGBA.

◆ refreshReflowAnnot

- (BOOL) refreshReflowAnnot
readwritenonatomicassign

◆ shouldRecover

- (BOOL) shouldRecover
readwritenonatomicassign

Whether or not should view control recover itself when runs out of memory. Default is YES.

◆ supportsMultipleScenes

- (BOOL) supportsMultipleScenes
readnonatomicassign

A Boolean value that indicates whether the FSPDFViewCtrl may display multiple scenes simultaneously.