Hello, thank you for your response. I have a PDF with form field values. The PDF is essentially always the same, but the field values differ. Here is an image from the PDF. "Date:" for example, is always the same. To the right of it, the current date is placed as a form field value. As I hover my mouse over the date, the blue rectangle behind it appears indicating it's a field value and that it's somehow not "baked into" the PDF. I don't know that this is considered an "annotation"?

After I have opened the PDF in Preview (a contract in this example) I attempt to annotate it by signing it with my digital signature by overlaying the signature block of the contract with a PNG file of my digital signature. When I attempt to annotate it, it says the PDF Is password protected (I assume that my ability to edit the actual date of 9/7/25 and other field values is why it's locked--which is fine--I don't want to edit existing values). But because the PDF is locked, I can't, for example, create an automation which annotates the document with my digital signature.
To get around this I have to open the PDF in Preview, Save as PDF on top of itself, reopen it, and then I can annotate it. And then I have to Save as PDF again when I am done to lock in those annotations. Given that this is a function I must do frequently, I would love to automate it.
However the first step of any workflow I build needs to give me a version of the PDF that 1) has the field values flattened into it and 2) is able to be annotated. It makes no difference to me if the solution somehow unlocks the original PDF or creates a new PDF that is identical to the original PDF. All the automations and shortcuts I attempt to make without opening Preview either 1) strip the form field data (for example, it will strip out 9/7/25) from the PDF, or 2) give me some kind of error message about the PDF being locked.
The only 2 ways I know of to get a PDF into the state I need using native macOS tools (without 3rd party software are):
- the aforementioned opening in Preview and saving as a new pdf
- using the Create PDF shortcut in Finder which only appears when I select 2 or more PDFs
These methods of creating a PDF are evidently more robust than the options in Automator and Shortcuts which as mentioned, strip the PDF of form field data. Whatever code is run when you Create PDF in Finder, I'd love to just make a quick action to run that same code on 1 PDF! But I don't think I have the ability to see that code? Is there a way to simulate clicking that button in Finder?
I do have an automation to open the PDF in Preview and Save as PDF, but it relies on Accessibility / simulating clicks and keyboard commands, and this can get wonky depending on if my computer is running hot or slow--windows don't always appear when the script expects, and the script tries to click buttons which haven't popped up yet, etc.