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

Enable outputting the replacement value on PDFs #179

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

JessieAMorris
Copy link
Contributor

Description

Enables outputting/replacing the text in PDFs by including the replacement value inside of the redaction box.

Best efforts are given to ensure that the text does not expand beyond the bounds of the box. This does, however, create scenarios where the box is really small so the font size ends up being tiny and not supremely useful.

Somewhat readable example:
Screenshot 2024-12-17 at 16 38 04

Indecipherable example:
Screenshot 2024-12-17 at 16 38 18

I'm wondering if this is something that should be disabled by default.

There also needs to be some documentation written for the PDF configuration portion of the policy.

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Comment on lines 250 to 251
var replacementText = rectangle.getSpan().getReplacement();
var rectangleWidth = rectangle.getPdRectangle().getWidth();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen much var usage in the project, so I'm happy to change this if requested.

@jzonthemtn
Copy link
Member

I think my initial thought is to have it disabled by default since it changes how things are redacted. My thought is for existing users they would have to go disable it after discovering it. But I'm open to other thoughts on that.

I wrote #181 to capture the documentation task.

@JessieAMorris
Copy link
Contributor Author

Sounds good, I'll get that changed so the default remains.

@JessieAMorris
Copy link
Contributor Author

Okay, I've added disabling by default, did a minor refactor, and added documentation. I did slightly rename the arguments to make them a bit more obvious what their behavior actually does.

@jzonthemtn jzonthemtn merged commit 68b7026 into philterd:main Dec 19, 2024
7 checks passed
@jzonthemtn
Copy link
Member

Awesome! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants