Configuring PDF view properties
This guide documents PdfConfiguration, the configuration object for the deprecated NutrientView widget. As of Nutrient Flutter SDK 6, use NutrientViewConfiguration with NutrientDocumentView instead. For current configuration options, refer to the view configuration guide.
Use the configuration property on NutrientView to customize PDF view behavior and UI. The following example shows a PDF view configuration:
NutrientView( documentPath: document.path, configuration: PdfConfiguration( toolbarTitle: 'Nutrient Flutter Example', scrollDirection: ScrollDirection.horizontal, pageLayoutMode: PageLayoutMode.single, pageTransition: PageTransition.scrollContinuous, spreadFitting: SpreadFitting.fit, immersiveMode: false, showPageLabels: true, showActionNavigationButtons: true, userInterfaceViewMode: UserInterfaceViewMode.automatic, androidShowSearchAction: true, inlineSearch: false, showThumbnailBar: ThumbnailBarMode.floating, androidShowThumbnailGridAction: true, androidShowOutlineAction: true, androidShowAnnotationListAction: true, documentLabelEnabled: false, invertColors: false, androidGrayScale: false, startPage: 2, enableAnnotationEditing: true, enableTextSelection: false, androidShowBookmarksAction: false, androidEnableDocumentEditor: false, androidShowShareAction: true, androidShowPrintAction: false, androidShowDocumentInfoView: true, appearanceMode: AppearanceMode.defaultMode, androidDefaultThemeResource: 'Nutrient.Theme.Example', iOSRightBarButtonItems: [ 'thumbnailsButtonItem', 'activityButtonItem', 'searchButtonItem', 'annotationButtonItem' ], iOSLeftBarButtonItems: ['settingsButtonItem'], iOSAllowToolbarTitleChange: false, firstPageAlwaysSingle: true, enableInstantComments: true, webConfiguration: PdfWebConfiguration( allowPrinting: false, disableForms: false, showAnnotationNotes: true, showSignatureValidationStatus: ShowSignatureValidationStatusMode.ifSigned, sideBarMode: SidebarMode.annotations, spreadSpacing: 20, enableClipboardActions: true, autoSaveMode: AutoSaveMode.disabled, )), );Configuration options
The following tables list the configuration options that each platform supports. Some options support only one platform because platform behavior differs. Android-only and iOS-only options use a platform prefix. Web options are grouped under the webConfiguration property.
Document interaction options
Use these options to configure how users navigate and interact with document pages.
| Configuration option | Data type | Possible values | iOS | Android | Web | Description |
|---|---|---|---|---|---|---|
scrollDirection | String | horizontal, vertical | ✅ | ✅ | ✅ | Configures the page scrolling direction in the document view. |
pageTransition | String | scrollPerSpread, scrollContinuous, curl | ✅ | ✅ | ✅ | Configures the page scrolling mode. curl mode works only on iOS; Android ignores it. |
enableTextSelection | Boolean | true/false | ✅ | ✅ | ✅ | Turns text selection on or off. |
Document presentation options
Use these options to configure how the viewer displays document pages and metadata.
| Configuration option | Data type | Possible values | iOS | Android | Web | Description |
|---|---|---|---|---|---|---|
pageMode | String | single, double, automatic | ✅ | ✅ | ✅ | Configures the page mode. |
spreadFitting | String | fit, fill, adaptive | ✅ | ✅ | ✅ | Controls the page fitting mode. adaptive mode works only on iOS and has no effect on Android. |
showPageLabels | Boolean | true/false | ✅ | ✅ | ❌ | Shows the current page number. |
startPage | Integer | ✅ | ✅ | ✅ | Configures the starting page number. | |
documentLabelEnabled | Bool | true/false | ✅ | ✅ | ✅ | Shows an overlay with the document name. |
firstPageAlwaysSingle | Boolean | true/false | ✅ | ✅ | ❌ | Shows the first page separately. |
invertColors | Boolean | true/false | ✅ | ✅ | ✅ | Inverts the document colors when set to true. |
password | String | ✅ | ✅ | ✅ | Sets the password required to unlock the document. | |
androidGrayScale | Boolean | true/false | ❌ | ✅ | ❌ | Converts the document colors to grayscale. |
User interface options
Use these options to configure toolbar content, UI visibility, menus, and platform-specific actions.
| Configuration option | Data type | Possible values | iOS | Android | Web | Description |
|---|---|---|---|---|---|---|
inlineSearch | Boolean | true/false | ✅ | ✅ | ❌ | Sets the search bar type to inline or modal. |
toolbarTitle | String | ✅ | ✅ | ❌ | Sets the toolbar title. On iOS, set documentLabelEnabled, iOSUseParentNavigationBar, and iOSAllowToolbarTitleChange to false before you set a custom title. | |
showActionNavigationButtons | Boolean | true/false | ✅ | ✅ | ❌ | Shows action navigation buttons. |
userInterfaceViewMode | String | automatic, automaticBorderPages, automaticNoFirstLastPage, always, alwaysVisible, alwaysHidden, never | ✅ | ✅ | ✅ | Configures UI visibility. |
immersiveMode | Boolean | true/false | ✅ | ✅ | ❌ | Hides the UI when set to true. |
appearanceMode | String | default, night, sepia | ✅ | ✅ | ✅ | Sets the document appearance mode. |
settingsMenuItems | [Array of String] | pageTransition, scrollDirection, androidTheme, iOSAppearance, androidPageLayout, iOSPageMode, iOSSpreadFitting, androidScreenAwake, iOSBrightness | ✅ | ✅ | ❌ | Defines the options shown in the Settings menu. Options with iOS or Android prefixes work only on that platform. Options without a prefix work on both platforms. |
androidShowSearchAction | Boolean | true/false | ❌ | ✅ | ❌ | Turns document search on or off. On iOS, add searchButtonItem to iOSLeftBarButtonItems or iOSRightBarButtonItems for the same behavior. |
androidShowOutlineAction | Boolean | true/false | ❌ | ✅ | ❌ | Turns the Outline menu on or off in the activity. On iOS, add outlineButtonItem to iOSLeftBarButtonItems or iOSRightBarButtonItems for the same behavior. |
androidShowBookmarksAction | Boolean | true/false | ❌ | ✅ | ❌ | Turns the bookmark list on or off. On iOS, add bookmarkButtonItem to iOSLeftBarButtonItems or iOSRightBarButtonItems for the same behavior. |
androidShowShareAction | Boolean | true/false | ❌ | ✅ | ❌ | Shows or hides share features. On iOS, add activityButtonItem to iOSLeftBarButtonItems or iOSRightBarButtonItems for the same behavior. |
androidShowPrintAction | Boolean | true/false | ❌ | ✅ | ❌ | Shows or hides the print option when the document and device support printing. On iOS, add printButtonItem to iOSLeftBarButtonItems or iOSRightBarButtonItems for the same behavior. |
androidShowDocumentInfoView | Boolean | true/false | ❌ | ✅ | ❌ | Shows or hides document information. On iOS, add outlineButtonItem to iOSLeftBarButtonItems or iOSRightBarButtonItems for the same behavior. |
androidEnableDocumentEditor | Boolean | true/false | ❌ | ✅ | ❌ | Turns the document editor button on or off. On iOS, add documentEditorButtonItem to iOSLeftBarButtonItems or iOSRightBarButtonItems for the same behavior. |
androidDarkThemeResource | String | ❌ | ✅ | ❌ | Sets the resource string for the dark theme. | |
androidDefaultThemeResource | String | ❌ | ✅ | ❌ | Sets the resource string for the default theme. | |
iOSLeftBarButtonItems | [Array of String] | closeButtonItem, outlineButtonItem, searchButtonItem, thumbnailsButtonItem, documentEditorButtonItem, printButtonItem, openInButtonItem, emailButtonItem, messageButtonItem, annotationButtonItem, bookmarkButtonItem, brightnessButtonItem, activityButtonItem, settingsButtonItem, readerViewButtonItem | ✅ | ❌ | ❌ | Sets the left bar button items. On Android, set individual options such as androidShowOutlineAction and androidShowSearchAction for the same behavior. |
iOSRightBarButtonItems | [Array of String] | closeButtonItem, outlineButtonItem, searchButtonItem, thumbnailsButtonItem, documentEditorButtonItem, printButtonItem, openInButtonItem, emailButtonItem, messageButtonItem, annotationButtonItem, bookmarkButtonItem, brightnessButtonItem, activityButtonItem, settingsButtonItem, readerViewButtonItem | ✅ | ❌ | ❌ | Sets the right bar button items. On Android, set individual options such as androidShowOutlineAction and androidShowSearchAction for the same behavior. |
iOSAllowToolbarTitleChange | Boolean | true/false | ✅ | ❌ | ❌ | Enables Nutrient SDK to change this view controller’s title. |
Thumbnail options
Use these options to configure thumbnail bars and thumbnail grid actions.
| Configuration option | Data type | Possible values | iOS | Android | Web | Description |
|---|---|---|---|---|---|---|
showThumbnailBar | String | none, default, floating, pinned, scrubberBar, scrollable | ✅ | ✅ | ✅ | Controls how the viewer shows page thumbnails while displaying a document. |
androidShowThumbnailGridAction | Boolean | true/false | ❌ | ✅ | ❌ | Shows or hides the action bar icon for the thumbnail page grid. On iOS, add thumbnailsButtonItem to iOSLeftBarButtonItems or iOSRightBarButtonItems for the same behavior. |
Annotation, form, and bookmark options
Use these options to configure annotation editing and annotation list access.
| Configuration option | Data type | Possible values | iOS | Android | Web | Description |
|---|---|---|---|---|---|---|
enableAnnotationEditing | Boolean | true/false | ✅ | ✅ | ✅ | Turns annotation editing on or off for all annotations. |
androidShowAnnotationListAction | Boolean | true/false | ❌ | ✅ | ❌ | Shows or hides the annotation list. On iOS, add outlineButtonItem to iOSLeftBarButtonItems or iOSRightBarButtonItems for the same behavior. |
Web-only options
Use webConfiguration with a PdfWebConfiguration object to configure Web-specific behavior.
| Configuration option | Data type | Possible values | iOS | Android | Web | Description |
|---|---|---|---|---|---|---|
AutoSaveMode | Boolean | disabled, immediate, intelligent | The auto-save mode to use. | |||
allowPrinting | Boolean | true / false | ❌ | ❌ | ✅ | Whether to enable printing. |
disableForms | Boolean | true/false | ❌ | ❌ | ✅ | Whether to disable forms. |
showAnnotationNotes | Boolean | true/false | ❌ | ❌ | ✅ | Whether to show annotation notes. |
showSignatureValidationStatus | String | always, ifSigned, never | ❌ | ❌ | ✅ | The mode for showing signature validation status. |
sideBarMode | String | annotations, bookmarks, thumbnails, documentInfo, outline | ❌ | ❌ | ✅ | |
spreadSpacing | Number | ❌ | ❌ | ✅ | The spacing between spreads. | |
enableClipboardActions | Boolean | true/false | ❌ | ❌ | ✅ | Whether to enable clipboard actions. |
interactionMode | String | automatic, selectionOnly, inkOnly | ❌ | ❌ | ✅ | The interaction mode to use. |
sidebarMode | String | annotations, bookmarks, thumbnails, documentInfo, outline | ❌ | ❌ | ✅ | The sidebar mode to use. |
canScrollWhileDrawing | Boolean | true/false | ❌ | ❌ | ✅ | Whether to enable scrolling while drawing. |
keepFirstSpreadAsSinglePage | Boolean | true/false | ❌ | ❌ | ✅ | |
keepSelectedTool | Boolean | true/false | ❌ | ❌ | ✅ | |
pageSpacing | Number | ❌ | ❌ | ✅ | The spacing between pages. | |
pageRotation | Number | ❌ | ❌ | ✅ | The page rotation. | |
previewRedactionMode | Boolean | true / false | ❌ | ❌ | ✅ | Whether to preview redaction mode. |
showAnnotationNotes | Boolean | true / false | ❌ | ❌ | ✅ | Whether to show annotation notes. |
customFonts | Array | ❌ | ❌ | ✅ | An array of custom fonts to load. | |
customRenderers | Object | ❌ | ❌ | ✅ | Custom renderers to use. | |
customUIConfiguration | Object | ❌ | ❌ | ✅ | Custom UI configuration to use. | |
electronicSignatures | Object | ❌ | ❌ | ✅ | Electronic signatures configuration to use. | |
formDesignMode | Boolean | true / false | ❌ | ❌ | ✅ | Whether to enable form design mode. |
maxMentionSuggestions | Number | ❌ | ❌ | ✅ | The maximum number of mention suggestions to show. | |
mentionableUsers | Array | ❌ | ❌ | ✅ | An array of mentionable users. | |
restrictAnnotationToPageBounds | Boolean | true / false | ❌ | ❌ | ✅ | Restrict annotations to page bounds. |
stampAnnotationTemplates | Array | ❌ | ❌ | ✅ | An array of stamp annotation templates. | |
styleSheets | Array | ❌ | ❌ | ✅ | An array of style sheets to load. | |
theme | String | light, dark | ❌ | ❌ | ✅ | The web theme to use. |
toolbarPlacement | String | top, bottom | ❌ | ❌ | ✅ | The toolbar placement to use. |
zoom | Number | ❌ | ❌ | ✅ | The zoom level to use. | |
minDefaultZoomLevel | Number | ❌ | ❌ | ✅ | The minimum default zoom level. | |
maxDefaultZoomLevel | Number | ❌ | ❌ | ✅ | The maximum default zoom level. | |
zoomStep | Number | ❌ | ❌ | ✅ | The zoom step to use. | |
toolbarItems | Array | ❌ | ❌ | ✅ | An array of items to show in the toolbar. | |
xfdf | String | ❌ | ❌ | ✅ | The XFDF string to load into the document. | |
xfdfKeepCurrentAnnotations | bool | true/false | ❌ | ❌ | ✅ | Whether to keep the current annotations when loading XFDF. |
autoCloseThreshold | Number | ❌ | ❌ | ✅ | The threshold for automatically closing the document. | |
baseCoreUrl | String | ❌ | ❌ | ✅ | The base URL for the Nutrient Core library. | |
baseUrl | String | ❌ | ❌ | ✅ | The base URL for Document Engine. | |
container | String | ❌ | ❌ | ✅ | The ID of the container element for the viewer. | |
disableHighQualityPrinting | bool | true / false | ❌ | ❌ | ✅ | Whether to disable high-quality printing. |
disableMultiSelection | bool | true/false | ❌ | ❌ | ✅ | Whether to disable multi-selection. |
disableOpenParameters | bool | true/false | ❌ | ❌ | ✅ | Whether to disable open parameters. |
disableTextSelection | bool | true/false | ❌ | ❌ | ✅ | Whether to disable text selection. |
disableWebAssemblyStreaming | bool | true/false | ❌ | ❌ | ✅ | Whether to disable WebAssembly streaming. |
documentEditorFooterItems | Array | ❌ | ❌ | ✅ | An array of items to show in the document editor footer. | |
documentEditorToolbarItems | Array | ❌ | ❌ | ✅ | An array of items to show in the document editor toolbar. | |
documentId | String | ❌ | ❌ | ✅ | The ID of the document to load. | |
editableAnnotationTypes | Array | ❌ | ❌ | ✅ | An array of editable annotation types. | |
enableAutomaticLinkExtraction | bool | true/false | ❌ | ❌ | ✅ | Whether to enable automatic link extraction. |
enableHistory | bool | true/false | ❌ | ❌ | ✅ | Whether to enable history. |
enableServiceWorkerSupport | bool | true/false | ❌ | ❌ | ✅ | Whether to enable service worker support. |
formFieldsNotSavingSignatures | Array | ❌ | ❌ | ✅ | An array of form fields that shouldn’t save signatures. | |
headless | bool | true/false | ❌ | ❌ | ✅ | Whether to run in headless mode. |
instant | bool | true/false | ❌ | ❌ | ✅ | Whether to run in Instant mode (server only). |
instantJSON | Object | ❌ | ❌ | ✅ | The JSON configuration for Instant mode (server only). | |
locale | String | ❌ | ❌ | ✅ | The locale to use. | |
maxPasswordRetries | Number | ❌ | ❌ | ✅ | The maximum number of password retries. | |
overrideMemoryLimit | Number | ❌ | ❌ | ✅ | The memory limit to override. | |
preventTextCopy | bool | true/false | ❌ | ❌ | ✅ | Whether to prevent text copy. |
printOptions | Object | ❌ | ❌ | ✅ | The print options to use. | |
serverUrl | String | ❌ | ❌ | ✅ | The URL of Document Engine (server only). | |
standaloneInstancesPoolSize | Number | ❌ | ❌ | ✅ | The size of the standalone instances pool. | |
viewportPadding | Number | ❌ | ❌ | ✅ | The viewport padding to use. | |
annotationToolbarItems | Array | ❌ | ❌ | ✅ | An array of items to show in the annotation toolbar. | |
useCDN | bool | true/false | ❌ | ❌ | ✅ | Whether to load Nutrient Web SDK assets from the CDN instead of self-hosted files. Defaults to true. Set to false for self-hosted deployments. |