Bash script from internet that interactively guides you to properly redact a pdf file
. ./pdf-redact-tools.sh
pdf_redact <PDF filename>
When editing the PDF file in GIMP remember to save the file and export it as PDF, not XCF. Otherwise the resulting PDF will not contain the modifications.
Public Domain