Add default output format setting for Text Extractor
Summary of the Pull Request
This PR adds a new setting to Text Extractor that allows users to choose the default output format when capturing text. Users can now set their preferred format method (None, Single line, or Table) in the Settings UI, so they don't need to manually select it each time.
PR Checklist
- [x] Applies to an existing issue: Fixes #38447
- [x] Communication: I've discussed this approach in the issue
- [x] Tests: Not adding unit tests for this settings addition as it follows the existing pattern
- [x] Localization: English strings added, other languages will be localized in the standard process
Detailed Description of the Pull Request
Changes made:
-
PowerOcrProperties.cs: Added
DefaultOutputModeproperty (int, default 0)- 0 = None (no format applied)
- 1 = Single line (joins text into single line)
- 2 = Table (formats as table)
-
IUserSettings.cs/UserSettings.cs: Added
DefaultOutputModesetting that loads from settings JSON -
OCROverlay.xaml.cs: Applied default format mode on initialization based on user settings
-
PowerOcrViewModel.cs: Added
DefaultOutputModeproperty with two-way binding -
PowerOcrPage.xaml: Added ComboBox UI for selecting default output format
-
Resources.resw: Added localization strings for the new setting
Validation Steps
- Open Settings > Text Extractor
- The new "Default output format" dropdown should appear with options: None, Single line, Table
- Select a format and capture text - the selected format should be pre-applied
- Settings persist across restarts
Screenshots
The new setting appears under the Language selector in Text Extractor settings.
@microsoft-github-policy-service agree