censor/Censor
1
37
Fork
You've already forked Censor
3

feat: save redaction annotations #8

Open
opened 2025年12月01日 17:27:04 +01:00 by mahlzahn · 0 comments

Description

Currently, it is not possible to save the selected boxes, such that they can be edited/removed afteewards.

Implementation

Internally, PyMuPDF use a two-step process of annotating and applying redactions.

Censor could safe and read drafted redactions using PyMuPDF. It may require to firstly read and delete the redactions from the document to then draw its content without the drafted redactions.

UI

Applying redactions should be still on Ctrl+S, as it should stay the default action for saving.

Outdated UI considerations

The UI could include an Adw.Splitbutton with items

Apply Redactions... v (default, now Save As...)
| Open Document... (maybe?, now not shown)
| Save Draft...
| Preview (maybe in future?)

Additional buttons in saving menu

The UI could have an additional entry in the current menu and a keyboard shortcut like Ctrl+D could be added:

  • Open...
  • Save
  • Save As...
  • Save Draft As...
  • Keyboard Shortcuts
  • About Censor

But, the menu gets maybe too overloaded with more saving options. Also #111 would add an entry, e.g.,

  • Save Rasterized As...

And, I can imagine another functionality of exporting or importing redactions in JSON format as implemented in PR 214, which may add other entries, e.g.,

  • Export Redactions...
  • Import Redactions...

few buttons with simple actions according to KISS principle
does not require extra dialog
menu may become overloaded, or maybe I could hide the advanced options in a submenu?

Alternative with extra dialog

The Gtk.FileDialog does not support adding choices, thus an extra dialog could be shown before saving with saving options (that might also include more, such as optional metadata removal, etc.). See https://discourse.gnome.org/t/gtk4-filedialog-with-choices-option/36577.

less overloaded main menu
extensible for new saving functions and advanced configuration
extra dialog shown on every "first" saving, needs extra warning if redactions have not been applied.

## Description Currently, it is not possible to save the selected boxes, such that they can be edited/removed afteewards. ## Implementation Internally, PyMuPDF use a two-step process of annotating and applying redactions. Censor could safe and read drafted redactions using PyMuPDF. It may require to firstly read and delete the redactions from the document to then draw its content without the drafted redactions. ## UI Applying redactions should be still on <kbd>Ctrl</kbd>+<kbd>S</kbd>, as it should stay the default action for saving. <details><summary>Outdated UI considerations</summary> The UI could include an [Adw.Splitbutton](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.SplitButton.html) with items **Apply Redactions... v** (default, now **Save As...**) | **Open Document...** (maybe?, now not shown) | **Save Draft...** | **Preview** (maybe in future?) </details> ### Additional buttons in saving menu The UI could have an additional entry in the current menu and a keyboard shortcut like <kbd>Ctrl</kbd>+<kbd>D</kbd> could be added: * Open... * Save * Save As... * **Save Draft As...** * Keyboard Shortcuts * About Censor But, the menu gets maybe too overloaded with more saving options. Also #111 would add an entry, e.g., * **Save Rasterized As...** And, I can imagine another functionality of exporting or importing redactions in JSON format as implemented in PR 214, which may add other entries, e.g., * **Export Redactions...** * **Import Redactions...** ➕ few buttons with simple actions according to KISS principle ➕ does not require extra dialog ➖ menu may become overloaded, or maybe I could hide the advanced options in a submenu? ### Alternative with extra dialog The Gtk.FileDialog does not support adding choices, thus an extra dialog could be shown before saving with saving options (that might also include more, such as optional metadata removal, etc.). See https://discourse.gnome.org/t/gtk4-filedialog-with-choices-option/36577. ➕ less overloaded main menu ➕ extensible for new saving functions and advanced configuration ➖ extra dialog shown on every "first" saving, needs extra warning if redactions have not been applied.
Sign in to join this conversation.
No Branch/Tag specified
main
v0.7.3
v0.7.2
v0.7.1
v0.7.0
v0.6.0
v0.5.0
v0.4.0
v0.3.0
v0.2.0
v0.1.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
censor/Censor#8
Reference in a new issue
censor/Censor
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?