Mac OS: PDFPen Pro (source)
Windows: ABBYY is the best; Paperport is decent.
Linux: Scribus, Inkscape, Censor (source) or pdfimages + GIMP

Things are a bit rougher but linux folks are less sheltered anyway. If you need pampering, there is a tool called Censor. I have not tried it because it’s not in official Debian repos and apparently only comes as a flatpak. I’m not enthusiastic about flatpaks. And the fact that it’s not official Debian could be a hint that the quality and popularity may not be up to scratch.

We might expect Inkscape and Scribus to be up to the task but it seems they are not.


So for the unpampered, we have pdfimages and GIMP. First do:

$ pdfimages -all $pdf guts

to extract the scanned images from the PDF. This is lossless, apart of course from losing PDF elements like bookmarks and OCR text.

If you get PNG or JPG files, that’s easy enough. Use GIMP on every image that needs a redaction. Use pdfjam to reassemble all the pages back into a PDF without transcoding.

If you get Huffman (CCITT) files, you’re lucky as far as avoiding bloat. But unlucky as far as effort and obscurity. Run this in a bash directory with the *.ccitt files that were extracted:

$ for f in *ccitt; do fax2tiff $(<${f%.ccitt}.params) -o "${f%.ccitt}.tiff" "$f"; done

Now you have TIFFs. Use GIMP to redact where needed, and save new TIFFs without compression. Then:

$ tiffcp page1.tiff page2.tiff page3.tiff page4.tiff … publication.tiff
$ tiff2pdf -F -p $papertype -o publication.pdf publication.tiff; # where $papertype is A4 or letter

Update: bug! 🪲

There is apparently a defect in my procedure. Every TIFF file that I edited in GIMP, saved as TIFF, and included alongside unedited TIFFs – they appear correct on the screen but they print in tiny in a 3-up fashion (each such page has 3 copies of itself on a physical sheet of paper). Surely that’s a software defect not a defect in my procedure. More testing needed. The fucked up printing occurs when I do lp $pdf. But if I load evince and print with centering and scale to “fit to page”, it works. But I should not have to do that.