Configuring PDF View Properties

The configuration argument in the present() method allows you to customize various properties of the PDF view. Here’s an example showcasing how you can set your PDF view’s configuration:

// First copy the document from assets to the temporary directory.
await Pspdfkit.present(document.path, {
    pageScrollDirection: pageScrollDirectionVertical,
    pageScrollContinuous: false,
    fitPageToWidth: true,
    androidImmersiveMode: false,
    userInterfaceViewMode: userInterfaceViewModeAutomaticBorderPages,
    androidShowSearchAction: true,
    inlineSearch: false,
    showThumbnailBar: showThumbnailBarFloating,
    androidShowThumbnailGridAction: true,
    androidShowOutlineAction: true,
    androidShowAnnotationListAction: true,
    showPageNumberOverlay: false,
    showPageLabels: true,
    showDocumentLabel: false,
    invertColors: false,
    grayScale: false,
    startPage: 2,
    enableAnnotationEditing: true,
    enableTextSelection: false,
    androidEnableBookmarkList: false,
    androidEnableDocumentEditor: false,
    androidShowShareAction: true,
    androidShowPrintAction: false,
    showDocumentInfoView: true,
    appearanceMode: appearanceModeDefault,
    androidDefaultThemeResource: 'PSPDFKit.Theme.Example',
    iOSRightBarButtonItems: [
        'thumbnailsButtonItem',
        'activityButtonItem',
        'searchButtonItem',
        'annotationButtonItem'
    ],
    iOSLeftBarButtonItems: ['settingsButtonItem'],
    iOSAllowToolbarTitleChange: false,
    toolbarTitle: 'Custom Title',
    androidSettingsMenuItems: ['theme', 'scrolldirection'],
    iOSSettingsMenuItems: [
        'scrollDirection',
        'pageTransition',
        'appearance',
        'brightness',
        'pageMode',
        'spreadFitting'
    ],
    showActionNavigationButtons: false,
    iOSShowActionNavigationButtonLabels: false,
    pageLayoutMode: 'double',
    isFirstPageAlwaysSingle: true
});

💡 Tip: You can find the available configuration options on Android in ConfigurationAdapter.java and on iOS in PspdfkitPlugin.m and PspdfkitFlutterConverter.m.