NutrientViewConfiguration(opens in a new tab) is the new configuration API for Nutrient Flutter viewer widgets. It’s currently used by the NutrientInstantView(opens in a new tab) widget and will replace PdfConfiguration(opens in a new tab) as the standard configuration object going forward.

NutrientView still uses PdfConfiguration(opens in a new tab) for configuration. NutrientViewConfiguration(opens in a new tab) isn’t yet supported by NutrientView. Refer to the configuring PDF view properties guide for the current NutrientView configuration reference.

NutrientViewConfiguration(opens in a new tab) controls the viewer’s layout, user interface (UI) chrome, editing capabilities, and appearance. All fields are optional — unset fields fall through to the native SDK’s built-in defaults, so only set the values that differ from the defaults. Options that apply to all platforms are top-level fields; options specific to one platform are grouped under androidConfig(opens in a new tab), iosConfig(opens in a new tab), or webConfig(opens in a new tab).

NutrientInstantView(
serverUrl: serverUrl,
jwt: jwt,
configuration: const NutrientViewConfiguration(
pageLayoutMode: PageLayoutMode.single,
thumbnailBarMode: ThumbnailBarMode.floating,
enableAnnotationEditing: true,
enableFormEditing: true,
androidConfig: AndroidViewConfiguration(
showSearchAction: true,
showOutlineAction: true,
),
iosConfig: IOSViewConfiguration(
spreadFitting: SpreadFitting.adaptive,
),
),
)

Cross-platform fields

The following fields apply to Android, iOS, and Web unless otherwise noted.

Layout

FieldTypeDescription
scrollDirection(opens in a new tab)ScrollDirection?The axis along which pages scroll: horizontal (default) or vertical.
pageLayoutMode(opens in a new tab)PageLayoutMode?How many pages appear side by side: single, double, or automatic.
pageTransition(opens in a new tab)PageTransition?Animation used when moving between pages. See PageTransition values below.
firstPageAlwaysSingle(opens in a new tab)bool?When true, the first page is always shown alone, even in double-page mode. Useful for documents with a full-width cover.
startPage(opens in a new tab)int?Zero-based index of the page to open on. Applied on Android and Web; ignored on iOS.

PageTransition values

ValuePlatforms
scrollContinuousAndroid, iOS, Web.
scrollPerSpreadAndroid, iOS, Web.
curliOS only.
slideHorizontal, slideVertical, cover, fadeAndroid, iOS.
scrollContinuousPerPage, autoAndroid, iOS.
disabledAndroid, iOS, Web.

UI chrome

FieldTypeDescription
userInterfaceViewMode(opens in a new tab)UserInterfaceViewMode?When the toolbar and overlays are visible: automatic (shown on tap), always, automaticNoFirstLastPage, or never (kiosk/immersive mode).
thumbnailBarMode(opens in a new tab)ThumbnailBarMode?Where the page thumbnail strip appears: none, defaultStyle, pinned, scrubberBar, scrollable, or floating.
appearanceMode(opens in a new tab)AppearanceMode?Color theme: defaultMode, sepia, night, or allCustomColors.

Editing

FieldTypeDescription
enableTextSelection(opens in a new tab)bool?Enable the user to select and copy text.
enableAnnotationEditing(opens in a new tab)bool?Enable creating, moving, and deleting annotations. When false, annotations are read-only.
enableFormEditing(opens in a new tab)bool?Enable filling in PDF form fields. When false, fields are rendered but not interactive.
disableAutosave(opens in a new tab)bool?When true, the SDK doesn’t automatically save changes. The app triggers saves manually via NutrientViewHandle(opens in a new tab).

Zoom

These fields apply to iOS and Web. Android doesn’t expose zoom constraints through its configuration builder. See minimumZoomScale(opens in a new tab) and maximumZoomScale(opens in a new tab).

FieldTypeDescription
minimumZoomScale(opens in a new tab)double?Minimum zoom factor the user can zoom out to.
maximumZoomScale(opens in a new tab)double?Maximum zoom factor the user can zoom in to.

AndroidViewConfiguration

AndroidViewConfiguration(opens in a new tab) holds options that only apply to the Android platform. Pass it as NutrientViewConfiguration.androidConfig(opens in a new tab). It’s silently ignored on iOS and Web.

androidConfig: AndroidViewConfiguration(
showSearchAction: true,
showOutlineAction: true,
showBookmarksAction: false,
inlineSearch: true,
enableDocumentEditor: false,
darkThemeResource: 'MyApp_Dark',
defaultThemeResource: 'MyApp_Light',
)
FieldTypeDescription
appearanceMode(opens in a new tab)AppearanceMode?Overrides the top-level appearanceMode(opens in a new tab) on Android.
thumbnailBarMode(opens in a new tab)ThumbnailBarMode?Overrides the top-level thumbnailBarMode(opens in a new tab) on Android.
grayScale(opens in a new tab)bool?Render the document in grayscale.
showPageLabels(opens in a new tab)bool?Use named page labels (for example, “i,” “Cover”) instead of numeric indices.
documentLabelEnabled(opens in a new tab)bool?Show the document title as an overlay at the top of the screen.
inlineSearch(opens in a new tab)bool?Show search as a compact inline bar instead of a full modal dialog.
showActionNavigationButtons(opens in a new tab)bool?Show back and forward buttons for navigating previously visited pages.
showSearchAction(opens in a new tab)bool?Show the search button in the toolbar.
showOutlineAction(opens in a new tab)bool?Show the outline (table of contents) button in the toolbar.
showBookmarksAction(opens in a new tab)bool?Show the bookmarks button in the toolbar.
showAnnotationListAction(opens in a new tab)bool?Show a button that opens the annotation list.
showThumbnailGridAction(opens in a new tab)bool?Show a button that opens the fullscreen thumbnail grid.
showPrintAction(opens in a new tab)bool?Show a print button in the toolbar overflow menu.
enableDocumentEditor(opens in a new tab)bool?Enable page editing — insertion, deletion, reordering (requires Document Editor license).
contentEditorEnabled(opens in a new tab)bool?Enable in-place text and image editing (requires Content Editor license).
darkThemeResource(opens in a new tab)String?Name of the Android XML theme resource to apply in dark mode.
defaultThemeResource(opens in a new tab)String?Name of the Android XML theme resource to apply in light mode.

IOSViewConfiguration

IOSViewConfiguration(opens in a new tab) holds options that only apply to the iOS platform. Pass it as NutrientViewConfiguration.iosConfig(opens in a new tab). It’s silently ignored on Android and Web.

iosConfig: IOSViewConfiguration(
spreadFitting: SpreadFitting.adaptive,
leftBarButtonItems: ['closeButtonItem'],
rightBarButtonItems: ['annotationButtonItem', 'searchButtonItem'],
)
FieldTypeDescription
spreadFitting(opens in a new tab)SpreadFitting?How a page spread is fit into the viewport: fit (letterbox), fill (crop to fill), or adaptive (SDK chooses per spread).
thumbnailBarMode(opens in a new tab)ThumbnailBarMode?Overrides the top-level thumbnailBarMode(opens in a new tab) on iOS.
showPageLabels(opens in a new tab)bool?Use named page labels instead of numeric indices.
documentLabelEnabled(opens in a new tab)bool?Show the document title overlay.
inlineSearch(opens in a new tab)bool?Show search as a compact inline bar instead of a modal sheet.
showActionNavigationButtons(opens in a new tab)bool?Show back and forward page navigation buttons.
allowToolbarTitleChange(opens in a new tab)bool?Update the navigation bar title to the current page label while scrolling.
bookmarkIndicatorMode(opens in a new tab)IOSBookmarkIndicatorMode?When to show the bookmark icon on pages: off, alwaysOn, or onWhenBookmarked.
bookmarkIndicatorInteractionEnabled(opens in a new tab)bool?Enable tapping the bookmark indicator to toggle bookmarks. Only meaningful when bookmarkIndicatorMode(opens in a new tab) isn’t off.
leftBarButtonItems(opens in a new tab)List<String>?Replaces the default left navigation bar buttons. Pass an empty list to remove all buttons.
rightBarButtonItems(opens in a new tab)List<String>?Replaces the default right navigation bar buttons. Pass an empty list to remove all buttons.

Bar button item identifiers

IdentifierDescription
closeButtonItem(opens in a new tab)Close/dismiss.
annotationButtonItem(opens in a new tab)Opens the annotation toolbar.
searchButtonItem(opens in a new tab)Opens search.
outlineButtonItem(opens in a new tab)Opens the outline/table of contents panel.
bookmarkButtonItem(opens in a new tab)Opens the bookmarks panel.
thumbnailsButtonItem(opens in a new tab)Opens the thumbnail grid.
printButtonItem(opens in a new tab)Opens the print dialog.
activityButtonItem(opens in a new tab)Opens the system share sheet.
brightnessButtonItem(opens in a new tab)Opens brightness control.

WebViewConfiguration

WebViewConfiguration(opens in a new tab) holds options specific to the Web platform. It’s typed as Object? in the platform interface to avoid a circular package dependency — import it from package:nutrient_flutter and pass it as webConfig(opens in a new tab). Common options include showToolbar(opens in a new tab), showAnnotations(opens in a new tab), readOnly(opens in a new tab), and theme(opens in a new tab).

import 'package:nutrient_flutter/nutrient_flutter.dart';
NutrientViewConfiguration(
webConfig: WebViewConfiguration(
showToolbar: true,
showAnnotations: true,
readOnly: false,
theme: 'DARK',
),
)

Common WebViewConfiguration fields

FieldTypeDescription
showToolbar(opens in a new tab)bool?Show or hide the main toolbar.
showAnnotations(opens in a new tab)bool?Show or hide all annotations in the viewer.
readOnly(opens in a new tab)bool?Open in read-only mode (no annotation creation/editing).
theme(opens in a new tab)String?Viewer theme string, e.g. DARK, LIGHT, AUTO.
enableAnnotationToolbar(opens in a new tab)bool?Show or hide the annotation toolbar.
sidebarMode(opens in a new tab)SidebarMode?Which sidebar panel is open initially (annotations, bookmarks, thumbnails, etc.).
interactionMode(opens in a new tab)NutrientWebInteractionMode?Initial active tool/interaction mode on load.
zoom(opens in a new tab)dynamic (num or ZoomMode)Initial zoom level.
allowPrinting(opens in a new tab)bool?Allow or block printing from the web viewer UI.
disableTextSelection(opens in a new tab)bool?Disable text selection in the viewer.
disableForms(opens in a new tab)bool?Disable form field interaction.
locale(opens in a new tab)String?UI locale (BCP-47), e.g. en, de.
toolbarItems(opens in a new tab)List<NutrientWebToolbarItem>?Customize the main toolbar items.
autoSaveMode(opens in a new tab)AutoSaveMode?Control auto-save behavior for web changes.

For advanced web-only options (callbacks, rendering hooks, performance toggles, and other low-level NutrientViewer.load() options), refer to the complete WebViewConfiguration API reference(opens in a new tab).