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:
let configuration = SBSDKUI2DocumentScanningFlow()
configuration.screens.review.enabled = true
configuration.screens.review.toolbar.documentCleanupButton.barButton.visible = true
To style the cleanup button in the More menu, use toolbar.documentCleanupButton.popupMenuItem.
Example configuration of the Cleanup Screen
- UIKit
- SwiftUI
loading...
loading...
Configuration options
Configure the Cleanup Screen through screens.cleanup on the Document Scanning Flow configuration object. The most relevant groups of options are:
| Group | Properties | Description |
|---|---|---|
| Top bar | topBarTitle, topBarBackButton, topBarConfirmButton | Title text and styling, plus the cancel and confirm buttons. |
| Canvas | backgroundColor | Color rendered behind the page image on the cleanup canvas. |
| Engine | engineConfiguration | The DocumentCleanupConfiguration of the underlying engine: text preservation, undo stack size, and maximum cleanup resolution. |
| Toolbar actions | toolbar.undoButton, toolbar.redoButton, toolbar.resetButton | Titles, icons, and styling for the Undo, Redo, and Reset buttons. |
| Toolbar stroke size | toolbar.strokeSizeSlider.visible, toolbar.strokeSizeSlider.minStrokeSize, toolbar.strokeSizeSlider.maxStrokeSize, toolbar.strokeSizeSlider.title | Show or hide the stroke-size slider and configure its allowed range and label. |
| Stroke indicator | strokeSizeIndicator.backgroundColor, strokeSizeIndicator.borderColor, strokeSizeIndicator.opacity | Appearance of the round preview that shows the current brush size on the canvas. |
| Introduction | introduction.showAutomatically and the nested introduction.* configuration | Introduction Screen shown the first time the user opens the Cleanup Screen. |
| Reset confirmation | resetAllEditsAlertDialog.title, resetAllEditsAlertDialog.subtitle, and its buttons | Dialog shown when the user taps Reset. |
| Discard confirmation | discardChangesAlertDialog.title, discardChangesAlertDialog.subtitle, and its buttons | Dialog 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.documentCleanupScreenTitlelocalization.documentCleanupUndoButtonTitlelocalization.documentCleanupRedoButtonTitlelocalization.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 licenseScanbot SDK is part of the Apryse SDK product family
A mobile scan is just the start. With Apryse SDKs, you can expand mobile workflows into full cross‑platform document processing. Whether you need to edit PDFs, add secure digital signatures, or use a fast, customizable document viewer and editor, Apryse gives you the tools to build powerful features quickly.
Learn more
