UpdateDocSecurity Attribute Error

Discussion created by sdpawlak on Sep 14, 2011
Latest reply on Sep 16, 2011 by mnakleh
Hello Forum, I'm trying to add a security password to my PDFs, but the following error is returned after I run my python script:

File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\", line 928, in updateDocSecurity
return convertArcObjectToPythonObject(self._arc_object.updateDocSecurity(*gp_fixargs((new_master_password, new_user_password, encryption, permissions), True)))
AttributeError: PDFDocObject: Cannot update security of PDF document

The script looks like this:

import arcpy
pdfDoc = arcpy.mapping.PDFDocumentOpen(r"path_to_pdfdoc", "master")
pdfDoc.updateDocSecurity("master", "user", "RC4", "OPEN")
del pdfDoc

My script resembles the script example found here: