PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Add default output format setting for Text Extractor

Open ThanhNguyxn opened this issue 3 weeks ago • 1 comments

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:

  1. PowerOcrProperties.cs: Added DefaultOutputMode property (int, default 0)

    • 0 = None (no format applied)
    • 1 = Single line (joins text into single line)
    • 2 = Table (formats as table)
  2. IUserSettings.cs/UserSettings.cs: Added DefaultOutputMode setting that loads from settings JSON

  3. OCROverlay.xaml.cs: Applied default format mode on initialization based on user settings

  4. PowerOcrViewModel.cs: Added DefaultOutputMode property with two-way binding

  5. PowerOcrPage.xaml: Added ComboBox UI for selecting default output format

  6. Resources.resw: Added localization strings for the new setting

Validation Steps

  1. Open Settings > Text Extractor
  2. The new "Default output format" dropdown should appear with options: None, Single line, Table
  3. Select a format and capture text - the selected format should be pre-applied
  4. Settings persist across restarts

Screenshots

The new setting appears under the Language selector in Text Extractor settings.

ThanhNguyxn avatar Dec 03 '25 08:12 ThanhNguyxn

@microsoft-github-policy-service agree

ThanhNguyxn avatar Dec 03 '25 08:12 ThanhNguyxn