Hello everyone,
I have a workflow that outputs PDFs. The files are tests for my students. The procedure is roughly the code shown below put inside a Do loop.
 
nb = CreateDocument[{}]; NotebookWrite[nb, 
 Cell["[someTextHere]", "Text"]];
(*more text on more pages*)
Export[exportPath <> theFileNameStr <> ".pdf", nb];
NotebookClose[nb]
I encrypt each file manually by creating a password as well as disabling copying and printing. Is there a way to do that programmatically with Mathematica either during export or by running shell commands? I have never used shell but I understand that there is Python code for encrypting PDFs on Macs.
Greg