updateDocSecurity() doesn't seem to be documented correctly and is not executing as expected in these scenarios:
pdfDoc.updateDocSecurity("123456", "123456", "RC4", "OPEN")
returns this error:
TypeError: updateDocSecurity() takes from 2 to 4 positional arguments but 5 were given
pdfDoc.updateDocSecurity("123456", "123456", "RC4")
results in the process running forever.
pdfDoc.updateDocSecurity("", "", "RC4")
results in the process running successfully.
Any idea what's going on?
ArcGIS Pro 2.8.3
python 3.0 documentation states with named parameters.
updateDocSecurity (new_master_password, {new_user_password}, {encryption})
or with your listing
pdfDoc.updateDocSecurity(new_master_password="123456",
new_user_password="654321",
encryption="RC4")
I suspect if the new user and master password are the same it will spin.
Change the first 2 parameters to suit.
Your first example failed because there is no 4th parameter (eg "OPEN" )
I tried it with the four parameters in the first example because that's how I saw in the example block on the documentation page. But yeah probably doesn't need that perimeter at all.
I have tried different variations of the passwords, also excluding only the master password or excluding only the user password. I still get the tool spinning forever.
Using named parameters, as in my example, ensures that you have the correct parameter names.
The first parameter is required and must be known.
The second parameter is optional and its default is None.
If it is spinning, check your first parameter
It's still spinning forever after adjusting the script:
# Update PDF security.
pdfDoc.updateDocSecurity(new_master_password="password123")
and
# Update PDF security.
pdfDoc.updateDocSecurity("password123")
Tech Support is your best bet. I can't find anything listed on the public support site.