Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] anonymize PDFs via UI redaction (Drawing black rectangle etc) #465

Closed
mokkin opened this issue Nov 5, 2023 · 11 comments · Fixed by #2433
Closed

[feature request] anonymize PDFs via UI redaction (Drawing black rectangle etc) #465

mokkin opened this issue Nov 5, 2023 · 11 comments · Fixed by #2433
Assignees
Labels
enhancement New feature or request Front End Issues or pull requests related to front-end development Priority: High Issues or pull requests with high priority

Comments

@mokkin
Copy link

mokkin commented Nov 5, 2023

Another cool feature would be to anonymize specific parts of PDF files.

  1. Upload the original PDF
  2. select areas to anonymize
  3. anonymize file
  4. download anonymized PDF
@Frooodle
Copy link
Member

Frooodle commented Nov 5, 2023

"select areas to anonymize"
What does this actually mean and involve in this feature? Do you mean remove or redact it or change it's metadata or..?

Can you explain the general process

@mokkin
Copy link
Author

mokkin commented Nov 6, 2023

Of course.
I mean to redact in and remove the original information to use it anonymously.

The best explanation can you find here in another software: https://code-industry.net/masterpdfeditor-help/redacting-pdf-document/

@Frooodle Frooodle changed the title [feature request] anonymize PDFs [feature request] anonymize PDFs via UI redaction (Drawing black rectangle etc) Jan 4, 2024
@Frooodle Frooodle added enhancement New feature or request Front End Issues or pull requests related to front-end development labels Jan 4, 2024
@lilotter45
Copy link

Just to add a little more description of the workflow in a couple other pdf editors that have this feature:

This is a feature I've used regularly in both Adobe Acrobat and Foxit PDF; they both have a similar approach:

  • They give multiple options for applying redaction:
    • Manually select text and images
    • Redact entire pages
    • Search and redact (similar in functionality to Stirling PDF's Auto Redact feature)
  • When manually selecting text, both allow you to highlight a section of text (could be a single letter to an entire block of text), then they "draw" a red box around the selected text to mark it for redaction. You can also draw a box around the picture/text
  • When marking text to be redacted, it does just that, first marks it (with the red box/outline) and when you are finished you confirm your intention then the marked text blocks have a black box drawn over them.

Foxit PDF screenshots:

Redaction menu:

image

Text highlighting (not visible in the screenshot is the cursor for selecting text):

image

Highlighted text marked for redaction:

image

Highlight a custom area to be redacted:

image

Highlighted area marked for redaction:

image

Redaction applied:

image

@louispires
Copy link

It would also be beneficial to manually be able to select text to be redacted:

When highlighting words/text manually, only that word/text gets redacted

@Frooodle Frooodle moved this to Backlog in Stirling-PDF V1 Nov 22, 2024
@Frooodle Frooodle added the Priority: High Issues or pull requests with high priority label Nov 22, 2024
@Frooodle Frooodle moved this from Backlog to Next to pickup in Stirling-PDF V1 Dec 3, 2024
@omar-ahmed42
Copy link
Contributor

@Frooodle I forgot to inform you that I'm currently working on this issue/feature

@xuzhu007
Copy link

I would like to know when this feature will be available. I urgently need this feature, thank you.

@Frooodle
Copy link
Member

This is our next priority feature coming soon!

@xuzhu007
Copy link

@Frooodle Thank you for your feedback. Do you have an estimated release date? I’m really looking forward to this feature.

@Frooodle
Copy link
Member

Frooodle commented Dec 11, 2024

With Christmas holidays coming up timing is very unpredictable 😂
So I won't give any estimates :)

At least a week and less than 2 months 😂

@xuzhu007
Copy link

@omar-ahmed42 Hello, I would like to inquire about this feature. What is the technical plan you have in mind? Are you planning to use pdf.js to add a mask layer on top?

@omar-ahmed42
Copy link
Contributor

omar-ahmed42 commented Dec 11, 2024

@omar-ahmed42 Hello, I would like to inquire about this feature. What is the technical plan you have in mind? Are you planning to use pdf.js to add a mask layer on top?

@xuzhu007 Hello, My plan was to use PDF.js to display the PDF and provide custom tools for redaction in the toolbar, based on the chosen/selected tool a corresponding redaction mode is enabled allowing the user to select/draw redactions on top of the document, then submitting the document for processing and performing the redaction process on the actual PDF in the backend.

At the same time providing the user with option to redact certain pages entirely, whether by specifying page number(s), range(s) or functions such as (2n) for even page numbers for example.

@Frooodle Frooodle moved this from Next to pickup to In Progress in Stirling-PDF V1 Dec 13, 2024
Frooodle added a commit that referenced this issue Jan 6, 2025
# Description

## Manual Redaction:

- ### Text Selection-based redaction:
-
![image](https://github.com/user-attachments/assets/e59c5e6c-ef52-4f54-a98e-fc26e3226c8e)
- Users can now redact currently selected text by selecting the text
then clicking `ctrl + s` shortcut or by pressing on **apply/save/disk
icon** in the toolbar.
- Users can delete/cancel the redacted area by clicking on the box
containing the text, then clicking on `delete/trash` icon or by using
the shortcut `delete`.
- Users can customize the color of the redacted area/text (after the
redaction was applied) by simply clicking on the box containing the
text/area then clicking on the `color palette` icon and choosing the
color they want.
- Users can choose to select the color of redaction before redacting
text or applying changes (this only affects newly created redaction
areas, to change the color of an existing one; check the previous bullet
point).


- ### Draw/Area-based redaction:
-
![image](https://github.com/user-attachments/assets/e2968ae3-ebaf-497e-b3bd-0c8c8f4ee157)
- Users can now redact an area in the page by selecting the then
clicking `ctrl + s` shortcut or by pressing on **apply/save/disk icon**
in the toolbar.
- Users can delete/cancel the redacted area by clicking on the drawn
box, then clicking on `delete/trash` icon or by using the shortcut
`delete` (requires temporarily turning off drawing mode).
- Users can customize the color of the redacted area (after the
redaction was applied) by simply clicking on the box containing the area
then clicking on the `color palette` icon and choosing the color they
want.
- Users can choose to select the color of redaction before drawing the
box or applying changes (this only affects newly created redaction
areas, to change the color of an existing one; check the previous bullet
point).

 - ### Page-based redaction:
-
![image](https://github.com/user-attachments/assets/aba59432-23e7-4fe6-aa28-872c23a91242)
- Users can now redact **ENTIRE** pages by specifying the page
number(s), range(s) or functions.
- Users can customize the color of page-based redaction (doesn't affect
text-based nor draw-based redactions).

### Redaction modes:
There are three modes of redaction/operation currently supported
  - Text Selection-based redaction (TEXT)
  - Draw/Area-based redaction (DRAWING)
  - None - by simply not choosing any of the above modes (NONE).

## How to use:

- **Text Selection-based redaction:** click on this icon in the toolbar
![image](https://github.com/user-attachments/assets/52cc31ef-6946-482c-84a2-1ddb79646dd8)
to enable `text-selection redaction mode` then select the text you want
to redact then press `ctrl + s` or click on the disk/save icon
![image](https://github.com/user-attachments/assets/f2bdf2f2-ee07-4682-bb9a-95e13a1004cf).
- **Draw/Area-based redaction:** click on this icon in the toolbar
![image](https://github.com/user-attachments/assets/fe00dca9-761e-47a0-a748-2041830dc73e)
to enable `draw/area-based redaction` then `left mouse click (LMB)` on
the starting point of the rectangle, then once you are satisfied with
the rectangle's placement/dimensions then `left mouse click (LMB)` again
to apply the redaction.
- **Example:** `Left mouse click (LMB)` then move mouse to the right
then bottom then `Left mouse click (LMB)`.
- Note: Red box/rectangle borders indicate that you have not yet saved
(you need to left click on the page to save)
![image](https://github.com/user-attachments/assets/5ce5f789-9d6f-4984-8555-e8fef2a3e3cc)
once saved the borders will become green
![image](https://github.com/user-attachments/assets/85cabb9f-e7ee-4268-90cd-80493b625466)
(they also become clickable/hover-able when drawing mode is off).
- **Page-based redactions:**: Insert the page number(s), range(s) and/or
functions (separated by `,`) then select your preferred color and click
on `Redact` to submit.

![image](https://github.com/user-attachments/assets/ed8a0a98-32b2-4ae1-a3c7-c54bfe0fea66)

- **Color Customizations:**
- You can change the redaction color for new redactions by clicking on
this icon in the toolbar
![image](https://github.com/user-attachments/assets/bad573ee-0545-4329-b131-2022f970f134).
- You can change the redaction color for existing redactions by hovering
over the redaction box then clicking on it (`Left mouse click LMB`) then
clicking on color palette (highlighted in red in the picture)
![image](https://github.com/user-attachments/assets/22281a81-2cd9-4771-9a93-a75b6dd93433)
then select your preferred color.

- **Deletions:**
- You can delete a redacted area by hovering over the redaction box then
clicking on it (`Left mouse click LMB`) then clicking on the trash icon
(highlighted in red in the picture)
![image](https://github.com/user-attachments/assets/f0347279-8211-4b1c-a91d-c1fcb929cc5d).

## Card in the home page:

![image](https://github.com/user-attachments/assets/b3fb16eb-5ff0-4548-9f22-b1b8fe162c8b)

Closes #465

## Checklist

- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [x] I have performed a self-review of my own code
- [x] I have attached images of the change if it is UI based
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] If my code has heavily changed functionality I have updated
relevant docs on [Stirling-PDFs doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
- [ ] My changes generate no new warnings
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

---------

Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from In Progress to Done in Stirling-PDF V1 Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Front End Issues or pull requests related to front-end development Priority: High Issues or pull requests with high priority
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants