Passwords, Security & Metadata

IronPDF for Python provides comprehensive control over PDF document security and metadata — including author information, keywords, passwords, and user permission restrictions.

Getting Started

Load a PdfDocument, modify properties on its MetaData and SecuritySettings objects, then save. Both metadata and security settings are applied together in a single save operation.

Metadata Properties

  • MetaData.Author: Sets the document author name visible in PDF properties.
  • MetaData.Keywords: Sets SEO-friendly keywords associated with the document.
  • MetaData.ModifiedDate: Records when the document was last modified. Now() inserts the current timestamp.

Security Settings

  • SecuritySettings.RemovePasswordsAndEncryption(): Clears any existing passwords and encryption from the document before applying new settings.
  • SecuritySettings.MakePdfDocumentReadOnly(key): Restricts editing of the document. The key is an internal signing key, not a user-facing password.
  • SecuritySettings.AllowUserAnnotations: When False, users cannot add annotations in a PDF viewer.
  • SecuritySettings.AllowUserCopyPasteContent: When False, prevents copying text from the PDF.
  • SecuritySettings.AllowUserFormData: When False, form fields cannot be filled by the user.
  • SecuritySettings.AllowUserPrinting: Controls print permissions. PdfPrintSecurity.FullPrintRights allows printing; use other values to restrict it.
  • SecuritySettings.OwnerPassword: Password required to edit or change security settings in a PDF viewer.
  • SecuritySettings.UserPassword: Password required to open and read the PDF.

Learn to secure PDF documents with IronPDF for Python!

Ready to Get Started?
Version: 2026.6 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast?
run a sample watch your HTML become a PDF.