How to encrypt a PDF and redact sensitive information automatically

How to Encrypt a PDF Using AppleScript and PDFpenPro

This post may contain affiliate links. Please read my disclosure for more info.

I am a productivity and automation freak, and in this article, I will show you how to encrypt a PDF and redact sensitive information using a combination of Automator, AppleScript, and PDFpenPro. I will also show you how to apply Optical Character Recognition (OCR) and how to detect if a PDF already has an OCR layer using AppleScript.

Shop mentioned products

My usual data processing workflow starts with scanning every document that lands on my desk. If I get the document electronically, I skip the scanning and go straight to applying OCR, if the PDF doesn’t have an OCR layer yet. I use an automation tool called Hazel to help with many of the tasks I describe below. OCR is necessary because it makes the PDF searchable. That’s a prerequisite before you can redact sensitive information.