How do I automate opening a PDF in Preview, opening Print, Save as PDF--without opening preview??!

I have PDFs with form field data I have to annotate. I can't annotate them because macOS thinks they are locked. I can open them in Preview without any problem. However I have to Print, then Save as PDF, then open that new PDF to annotate them. It is perhaps the most annoying task I have to do on my Mac on a day to day basis and I have to do it dozens of times.


I'm desperately trying to automate this task using Automator, or Script Editor, or Shortcuts--however no solution works. The closest I've been able to get is macOS creating a new PDF which I can edit, but it strips out all the form field data.


  • macOS can't flatten a PDF with form field data if it's locked
  • macOS can't use OCR on a PDF if it's locked


Is there any way to automate opening a PDF in preview, clicking Print, then Save as PDF 1) without actually opening Preview and 2) without installing 3rd party software?


I know this is an incredibly common task on macOS for a multitude of users and I can't believe Apple wouldn't provide a way to automate this by 2025--so I assume it's here and I'm simply not discovering the right path here.


Posted on Sep 5, 2025 5:24 PM

Reply
18 replies

Oct 24, 2025 4:17 PM in response to VikingOSX

I have noticed with both my script and yours--if the original PDF is locked, running the script causes the new PDF to be blank and ask for a password input when you open it.


Of course if I open the PDF in Preview which I can do without a password, and Save as PDF (which is of course what I'm trying to simulate without opening Preview) the new PDF is not locked.


Is there code we can add to create the new PDF as unlocked even if the original PDF is password protected--just as if we had opened Preview and Save as PDF?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I automate opening a PDF in Preview, opening Print, Save as PDF--without opening preview??!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.