CPDFReaderWidgetController class

PDF Reader Widget Controller

Examples:

Scaffold(
        resizeToAvoidBottomInset: false,
        appBar: AppBar(title: const Text('CPDFReaderWidget Example')),
        body: CPDFReaderWidget(
          document: widget.documentPath,
          configuration: CPDFConfiguration(),
          onCreated: (controller) {
            setState(() {
              _controller = controller;
            });
          },
        ));

Constructors

CPDFReaderWidgetController(int id, {CPDFPageChangedCallback? onPageChanged, CPDFDocumentSaveCallback? saveCallback, CPDFPageEditDialogBackPressCallback? onPageEditBackPress, CPDFFillScreenChangedCallback? onFillScreenChanged, CPDFIOSClickBackPressedCallback? onIOSClickBackPressed, CPDFOnTapMainDocAreaCallback? onTapMainDocArea})

Properties

annotationHistoryManager CPDFAnnotationHistoryManager
Get the annotation history manager This manager is used to handle annotation history operations such as undo and redo. Example:
no setter
document CPDFDocument
no setter
editManager CPDFEditManager
Get the edit manager This manager is used to handle content editing operations such as changing edit types. Example:
no setter
hashCode int
The hash code for this object.
no setterinherited
ready Future<void>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearDisplayRect() Future<void>
Clear the rectangular area set when jumping to the page number through controller.setDisplayPageIndex Example:
dismissContextMenu() Future<void>
Dismiss the context menu if it is currently displayed. Example:
enterSnipMode() Future<void>
Enters snip mode, allowing users to capture screenshots.
exitFormCreationMode() Future<void>
Exit form creation mode, equivalent to setting the form creation type to CPDFFormType.unknown This method is only available in CPDFViewMode.forms mode. Example:
exitSnipMode() Future<void>
Exits snip mode, stopping the screenshot capture.
getAnnotationMode() Future<CPDFAnnotationType>
Get the type of annotation added to the current touch page This method is only available in CPDFViewMode.annotations mode. Example:
getCurrentPageIndex() Future<int>
get current page index
getFormCreationMode() Future<CPDFFormType>
Get the type of form field added to the current touch page This method is only available in CPDFViewMode.forms mode. Example:
getPreviewMode() Future<CPDFViewMode>
Get the currently displayed mode
getReadBackgroundColor() Future<Color>
Get background color of reader.
getScale() Future<double>
Get the page scale
hasChange() Future<bool>
Check the document for modifications
hideDigitalSignStatusView() Future<void>
Hide the digital signature status view. This method can be used to hide the digital signature status view that is displayed after calling verifyDigitalSignatureStatus. Example:
hideTextSearchView() Future<void>
Hide the text search view if it is currently displayed. Example:
isContinueMode() Future<bool>
Whether it is continuous scroll mode.
isCoverPageMode() Future<bool>
Whether it is cover page mode.
isCropMode() Future<bool>
Whether it is crop mode.
isDoublePageMode() Future<bool>
Whether it is double page mode. is_ example:
isFormFieldHighlight() Future<bool>
Whether to display highlight Form Field.
isLinkHighlight() Future<bool>
Whether to display highlight Link.
isPageInScreen(int pageIndex) Future<bool>
Gets whether the specified pageIndex is displayed on the screen
isVerticalMode() Future<bool>
Whether it is vertical scroll mode.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reloadPages() Future<void>
reloadPages2() Future<void>
save() Future<bool>
Save document
saveCurrentInk() Future<void>
Save the currently drawing ink annotation Example:
saveCurrentPencil() Future<void>
Save the currently drawing pencil annotation This method is only available on the iOS platform. Example:
setAnnotationMode(CPDFAnnotationType type) Future<void>
Used to add a specified annotation type when touching the page in annotation mode This method is only available in CPDFViewMode.annotations mode. Example:
setCanScale(bool canScale) Future<void>
Whether allow to scale. Default : true
setContinueMode(bool isContinueMode) Future<void>
Sets whether it is continuous scroll mode.
setCoverPageMode(bool coverPageMode) Future<void>
Sets whether it is cover page mode.
setCropMode(bool isCropMode) Future<void>
Sets whether it is crop mode.
setDisplayPageIndex({required int pageIndex, bool animated = true, List<CPDFRectF> rectList = const []}) Future<void>
Jump to the index page.
setDoublePageMode(bool isDoublePageMode) Future<void>
Sets whether it is double page mode.
setFixedScroll(bool isFixedScroll) Future<void>
Sets whether to fix the position of the non-swipe direction when zooming in for reading.
setFormCreationMode(CPDFFormType type) Future<void>
Used to add a specified form field type when touching the page in form creation mode This method is only available in CPDFViewMode.forms mode. Example:
setFormFieldHighlight(bool isFormFieldHighlight) Future<void>
Sets whether to display highlight Form Field. isFormFieldHighlight : true to display highlight Form Field.
setLinkHighlight(bool isLinkHighlight) Future<void>
Sets whether to display highlight Link.
setMargins(CPDFEdgeInsets edgeInsets) Future<void>
Set document page spacing
setPageSameWidth(bool isSame) Future<void>
In the single page mode, set whether all pages keep the same width and the original page keeps the same width as readerView
setPageSpacing(int spacing) Future<void>
Sets the spacing between pages. This method is supported only on the Android platform.
setPreviewMode(CPDFViewMode viewMode) Future<void>
Switch the mode displayed by the current CPDFReaderWidget. Please see CPDFViewMode for available modes.
setReadBackgroundColor(CPDFThemes theme) Future<void>
Sets background color of reader. The color of each document space will be set to 75% of color transparency
setScale(double scale) Future<void>
Set the page scale Value Range: 1.0~5.0
setVerticalMode(bool isVerticalMode) Future<void>
Sets whether it is vertical scroll mode.
setWidgetBackgroundColor(Color color) Future<void>
showAddWatermarkView({CPDFWatermarkConfig? config}) Future<void>
Displays the Add Watermark view, allowing users to add text and/or image watermarks to the current document.
showBotaView() Future<void>
Displays the BOTA view, which includes the document outline, bookmarks, and annotation list.
showDisplaySettingView() Future<void>
Displays the display settings view, where users can configure options such as scroll direction, scroll mode, and themes.
showSecurityView() Future<void>
Displays the document security settings view, allowing users to configure document security options.
showTextSearchView() Future<void>
Show the text search view. Example:
showThumbnailView(bool editMode) Future<void>
Displays the thumbnail view. When editMode is true, the page enters edit mode, allowing operations such as insert, delete, extract, etc.
toString() String
A string representation of this object.
inherited
verifyDigitalSignatureStatus() Future<void>
Verify the status of the digital signature in the document and display the verification result on the screen. If the document contains a digital signature, a status view will be displayed at the top of the document indicating the verification result. If the document does not contain a digital signature, no status view will be displayed. Example:

Operators

operator ==(Object other) bool
The equality operator.
inherited