-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: Support manual redaction #2433
base: main
Are you sure you want to change the base?
Feature: Support manual redaction #2433
Conversation
- Add redact.html which contains the nav-bar, file chooser, outer container and print container (used by PDF.JS viewer) and lastly the footer. - Add redact.css which is used specifically to style redaction operation and the redaction page (except for PDF.js viewer). - Add viewer-redact.css which is used to style PDF.js viewer that's used in the page (Changed the background to correspond with Stirling's themes). - Add redact.js which contains the redaction related logic.
- Add submit button. - Add hidden redactions input. - Rename fileSelector from pdf-upload to fileInput.
- Scale x, y, width and height to match PDF page points accurately.
- Fix formula for redaction points and dimensions as x, y, height and width should be the original width rather than the width after adjusting it to the zoom level (zoom level is mainly used for correct display positioning, while scale factor is used for correct positioning in the actual PDF).
- Slightly refactor redact.js for more readability and to reduce code duplication.
…ion-based Redaction mode buttons - Now, when one button is clicked, the other is automatically deselected, ensuring only one mode can be active at a time.
- Support page-based redactions by providing page numbers, page ranges and functions.
- Rename pageNumbers's input id to be more meaningful
- Add a button to apply redaction on selected text, now users can redact text either by using the shortcut "ctrl + s" or by simply clicking on the save/apply/disk icon.
/deploypr |
🚀 PR Test DeploymentYour PR has been deployed for testing! 🔗 Test URL: http://185.252.234.121:2433 This deployment will be automatically cleaned up when the PR is closed. |
Hi, this feature is absolutely fantastic, great work! I just have questions about presentation. |
Hi, before I explain anything let's take a look at what we need first to implement this feature (redaction):
Let's address each point, as for :
as for:
This might not be a problem for either, the sign implementation nor the viewer.mjs as for zooming:
We will still have to modify the code and ensure the presentation doesn't lose any quality in the process of zooming in (you can try zooming in the sign - after extracting the canvas and its container out of the form card of course so that it would be bigger - you will find that it loses quality in the process, that's something we have to take into account as well), in other words, we will have to reinvent the wheel to some degree to get the same functionality that's made and ready to use in viewer.mjs These are the main reasons why I went with viewer.mjs rather than sign's implementation, I believe the sign's implementation is superb and really fits the use case of sign and other pages as well, in the case of this feature I didn't feel like it would be a great fit for this use case. Another thing I had in mind, is that we might add extra features to the manual redact page, such as displaying on the right the selected text for redaction for example, and on click the page would be displayed or that the user could simply remove it from that list/catalogue on the right side of the screen, also providing faster access to other pages through the ready made page preview on the left of the screen (I am not sure if that's what it's called), we can also modify the page preview to correspond to changes on the actual page (if the user decided to redact some text with a green rectangle, then a green rectangle would appear in the page preview in an approximate location), etc. We could also modify the look and feel of the toolbar later on to correspond more to the Stirling's look and feel. As for the icons' size, I can try and making them bigger if you think they would be easier to use, along with the toolbar, either way, I think we would need to come out with better icons for redactions because I don't find the icons that I used to be intuitive enough so that beginners could use it without heading to a guide/tutorial (I couldn't really find any icons to denote the usage of these buttons/features, so I had to come up with a custom solution that can relate even 1% to their intention). Also, given this new UI for redactions we could later on incorporate auto redactions as well, so that we would've a complete redaction feature that would support all kinds of redactions, while at the same time, we still keep the auto redaction page because it's more lightweight and has specific usage so that users that need it can simply use it directly without the extra complexity of the current page. Anyway, if you have any feedback, questions or any ideas, please, let me know. Also, regarding:
Thanks! |
Hi there. Thanks for your reply, that all makes perfect sense! If you could make those icons bigger that would help straight away and if there's anything else you feel you could do to bring that page a little closer visually to the UI of other pages it would be much appreciated. I don't know how much can be done about the top toolbar in the pdfjs viewer, would it be possible to pull that functionality out into a custom toolbar, one similar to the one we have in multitool perhaps? If that is possible it would make a world of difference on bringing the presentation more in line with our existing design. I shall try to find you some icons that will be appropriate for these functions and send them across. Thanks again for your contributions! |
Sure thing! I think this might provide a better user-experience, so you have a point!
Sure, I can try this again, might look better than the current one given the bigger icons, etc
All I know that we can customize the styling of it, but not pull our the functionality itself into a separate one, not to mention that if we managed to somehow pull it out and make it work:
But as for styling it, I was actually thinking of styling it to match the rest of the designs actually as you mentioned, but I thought I would push the feature first in case we needed to deliver it earlier than expected. But yeah, I bringing the toolbar and icons as close as possible to existing design should be the next step (after making the icons bigger), so basically I should be starting with the size of the icons then proceed to the toolbar and the tools as well.
Appreciate that a lot! this would be of great help! Thank you! |
Description
Manual Redaction:
Text Selection-based redaction:
ctrl + s
shortcut or by pressing on apply/save/disk icon in the toolbar.delete/trash
icon or by using the shortcutdelete
.color palette
icon and choosing the color they want.Draw/Area-based redaction:
ctrl + s
shortcut or by pressing on apply/save/disk icon in the toolbar.delete/trash
icon or by using the shortcutdelete
(requires temporarily turning off drawing mode).color palette
icon and choosing the color they want.Page-based redaction:
Redaction modes:
There are three modes of redaction/operation currently supported
How to use:
Text Selection-based redaction: click on this icon in the toolbar to enable
text-selection redaction mode
then select the text you want to redact then pressctrl + s
or click on the disk/save icon .Draw/Area-based redaction: click on this icon in the toolbar to enable
draw/area-based redaction
thenleft mouse click (LMB)
on the starting point of the rectangle, then once you are satisfied with the rectangle's placement/dimensions thenleft mouse click (LMB)
again to apply the redaction.Left mouse click (LMB)
then move mouse to the right then bottom thenLeft mouse click (LMB)
.Page-based redactions:: Insert the page number(s), range(s) and/or functions (separated by
,
) then select your preferred color and click onRedact
to submit.Color Customizations:
Left mouse click LMB
) then clicking on color palette (highlighted in red in the picture) then select your preferred color.Deletions:
Left mouse click LMB
) then clicking on the trash icon (highlighted in red in the picture) .Card in the home page:
Closes #465
Checklist