Skip to main content

RTU UI Cleanup Screen

Overview​

The Cleanup Screen lets the end user manually erase unwanted artifacts, such as handwriting, stamps, stains, fingers, and shadows, from a scanned page while preserving the underlying document content. The user paints over the regions to remove with a configurable brush, and the SDK reconstructs a clean result image, with optional text preservation.

The screen is part of the RTU UI v2 Document Scanning Flow. The user reaches it from the Review Screen through the documentCleanupButton. When the user confirms with the confirm button in the top bar, the SDK saves the edits to the page. Canceling discards the edits. If there are unsaved changes, the screen asks the user to confirm first.

Out of the box, the Cleanup Screen provides:

  • A top bar with a title, a back button that cancels the edits, and a confirm button.
  • A canvas that renders the page image and the user's brush strokes, with pinch-to-zoom support.
  • A toolbar at the bottom with Undo, Redo, and Reset actions.
  • A stroke-size slider with a live preview of the current brush size.
  • An optional Introduction Screen shown the first time the user opens the Cleanup Screen.
  • Confirmation dialogs for Reset all edits and Discard changes.

Enabling the Cleanup Screen​

The user opens the Cleanup Screen from the Review Screen. Make sure the Review Screen is enabled and screens.review.toolbar.documentCleanupButton.barButton.visible is true. On a typical phone, the Review Screen toolbar has room for only a few buttons and moves the rest into the More menu. The cleanup button usually appears there.

The following code enables the Review Screen and its cleanup button:

Cleanup Bar Button
loading...

To style the cleanup button in the More menu, set toolbar.documentCleanupButton.popupMenuItem properties. The documentCleanupButton is an AdaptiveBarButtonConfiguration — it combines toolbar button and popup menu styling under a single object with nested barButton and popupMenuItem properties.

Example configuration of the Cleanup Screen​

Document Cleanup Screen
loading...

Configuration options​

Configure the Cleanup Screen through screens.cleanup on the Document Scanning Flow configuration object. The most relevant groups of options are:

GroupPropertiesDescription
Top bartopBarTitle, topBarBackButton, topBarConfirmButtonTitle text and styling, plus the cancel and confirm buttons.
CanvasbackgroundColorColor rendered behind the page image on the cleanup canvas.
EngineengineConfigurationThe DocumentCleanupConfiguration of the underlying engine: text preservation, undo stack size, and maximum cleanup resolution.
Toolbar actionstoolbar.undoButton, toolbar.redoButton, toolbar.resetButtonTitles, icons, and styling for the Undo, Redo, and Reset buttons.
Toolbar stroke sizetoolbar.strokeSizeSlider.visible, toolbar.strokeSizeSlider.minStrokeSize, toolbar.strokeSizeSlider.maxStrokeSize, toolbar.strokeSizeSlider.titleShow or hide the stroke-size slider and configure its allowed range and label.
Stroke indicatorstrokeSizeIndicator.backgroundColor, strokeSizeIndicator.borderColor, strokeSizeIndicator.opacityAppearance of the round preview that shows the current brush size on the canvas.
Introductionintroduction.showAutomatically and the nested introduction.* configurationIntroduction Screen shown the first time the user opens the Cleanup Screen.
Reset confirmationresetAllEditsAlertDialog.title, resetAllEditsAlertDialog.subtitle, and its buttonsDialog shown when the user taps Reset.
Discard confirmationdiscardChangesAlertDialog.title, discardChangesAlertDialog.subtitle, and its buttonsDialog shown when the user cancels with unsaved cleanup edits.

The Cleanup Screen also reads the following strings from the shared localization object on the flow configuration. Use them to override text without relying on platform string resources:

  • localization.documentCleanupScreenTitle
  • localization.documentCleanupUndoButtonTitle
  • localization.documentCleanupRedoButtonTitle
  • localization.documentCleanupResetButtonTitle

You can learn more about DocumentCleanupScreenConfiguration in the SDK's API documentation.

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license