Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
20
rated 0 times [  20] [ 0]  / answers: 1 / hits: 55548  / 3 Years ago, fri, october 22, 2021, 12:30:48

I had to print a couple of PDFs recently to send to someone, but I wanted to redact (black out) a couple small bits of text.



A quick google search didn't turn up any tools for this specific purpose, so I fell back to imagemagick & gimp:




  • convert document.pdf document.png

  • gimp document-0.png

  • (use paintbrush to black out text)

  • print redacted page from gimp

  • print remaining pages from xpdf



The problem with this strategy is that the conversion process (from PDF to PNG or whatever other format) loses quality. I tried editing the PDF in gimp but it didn't work right away.



Is there a specific tool that permits redaction in this way? (It doesn't even need to be "real" redaction -- I'm not sending a softcopy so "fake" redaction will work because the hardcopy can't be hacked to reveal the underlying text.)



Or, is there a trick to being able to edit PDFs in gimp?


More From » pdf

 Answers
2

(originally I recommened Okular but it didn't work as I expected)



1. Edit the document in a vector editor



I was able to open a PDF file in Inkscape, draw a rectangle over a piece of text and print it out. Inkscape is a vector editor so no rasterization involved. Some fonts looked wrong though - probably because the document was created on Windows machine with fonts which are absent on mine.



Note that any method that does not involve rasterization is only acceptable if you're going to print the redacted document on paper and not distribute it electronically, as the text still can be retrieved from under blackouts.



2. Increase the rasterization resolution when opening in a bitmap editor



Regarding "quality loss" when opening the page in Gimp: you can directly open a PDF file in Gimp. It will be rasterized in the process. The amount of quality loss in the process is a matter of resolution you choose when importing - 300 dpi should give you a very decent quality (the default is 100).



You can also get good results with ImageMagick's convert command if you tell it to increase resolution:



convert -density 300x300 ...

[#42505] Saturday, October 23, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
antorchestr

Total Points: 92
Total Questions: 111
Total Answers: 120

Location: Jordan
Member since Wed, Jun 17, 2020
4 Years ago
;