React native add custom button in header

, ,

Product: PDFtron

Product Version: react-native-pdftron@3.0.2-beta.3

Can’t Add Custom Button in DocumentView in react native

There is api/option to create custom icon / buttons in react native DocumentView compared to Webview.
Please suggest how to add an custom icon / button to the DocumentView toolbar so that we can use it to “save the document and store it in local folder in device”.

<DocumentView

      ref={(c) => this._viewer = c}

      // hideDefaultAnnotationToolbars={[Config.DefaultToolbars.Annotate]}

      // annotationToolbars={[Config.DefaultToolbars.Annotate, myToolbar]}          

      hideAnnotationToolbarSwitcher={false}

      hideTopToolbars={false}

      hideTopAppNavBar={false}

      document={path}

      padStatusBar={true}

      showLeadingNavButton={true}

      leadingNavButtonIcon={Platform.OS === 'ios' ? 'ic_close_black_24px.png' : 'ic_arrow_back_white_24dp'}

      onLeadingNavButtonPressed={this.onLeadingNavButtonPressed}

      onDocumentLoaded={this.onDocumentLoaded}

      onAnnotationChanged={this.onAnnotationChanged}

      onExportAnnotationCommand={this.onExportAnnotationCommand}

      onZoomChanged={this.onZoomChanged}

      readOnly={false}

      disabledElements={[Config.Buttons.userBookmarkListButton]}

      disabledTools={[Config.Tools.annotationCreateLine, Config.Tools.annotationCreateRectangle]}

      fitMode={Config.FitMode.FitPage}

      layoutMode={Config.LayoutMode.Continuous}

    />

Thanks in advance.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi,

Thank you for getting in touch with us about this and apologies for the delay in reply.
Are you able to share a diagram showing where you would like to add this button?

This customization may require you to work with native code directly rather than through the current React Native APIs, is that an approach which would work for you?