비밀번호, 보안 및 메타데이터
from ironpdf import *

# Open an Encrypted File, alternatively create a new PDF from Html
pdf = PdfDocument.FromFile("encrypted.pdf", "password")

# Edit file metadata
pdf.MetaData.Author = "Satoshi Nakamoto"
pdf.MetaData.Keywords = "SEO, Friendly"
pdf.MetaData.ModifiedDate = Now()

# The following code makes a PDF read only and will disallow copy & paste and printing
pdf.SecuritySettings.RemovePasswordsAndEncryption()
pdf.SecuritySettings.MakePdfDocumentReadOnly("secret-key")
pdf.SecuritySettings.AllowUserAnnotations = False
pdf.SecuritySettings.AllowUserCopyPasteContent = False
pdf.SecuritySettings.AllowUserFormData = False
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights

# Change or set the document encryption password
pdf.SecuritySettings.OwnerPassword = "top-secret"  # password to edit the pdf
pdf.SecuritySettings.UserPassword = "sharable"  # password to open the pdf
pdf.SaveAs("secured.pdf")
pip install ironpdf
비밀번호, 보안 및 메타데이터

비밀번호, 보안 및 메타데이터

IronPDF for Python은 PDF 문서 보안 및 메타데이터에 대한 포괄적인 제어를 제공합니다 - 저자 정보, 키워드, 비밀번호 및 사용자 권한 제한을 포함합니다.

시작하기

PdfDocument을(를) 로드하고, MetaData 및 SecuritySettings 객체의 속성을 수정한 후, 저장합니다. 메타데이터와 보안 설정은 단일 저장 작업으로 함께 적용됩니다.

메타데이터 속성

  • MetaData.Author: PDF 속성에서 보이는 문서 저자 이름을 설정합니다.
  • MetaData.Keywords: 문서와 관련된 SEO 친화적 키워드를 설정합니다.
  • MetaData.ModifiedDate: 문서가 마지막으로 수정된 시간을 기록합니다. Now()는 현재 타임스탬프를 삽입합니다.

보안 설정

  • SecuritySettings.RemovePasswordsAndEncryption(): 새로운 설정을 적용하기 전에 문서의 기존 비밀번호 및 암호화를 제거합니다.
  • SecuritySettings.MakePdfDocumentReadOnly(key): 문서 편집을 제한합니다. key는 사용자에게 보이는 비밀번호가 아닌 내부 서명 키입니다.
  • SecuritySettings.AllowUserAnnotations: False일 때, 사용자가 PDF 뷰어에서 주석을 추가할 수 없습니다.
  • SecuritySettings.AllowUserCopyPasteContent: False일 때, PDF에서 텍스트 복사를 방지합니다.
  • SecuritySettings.AllowUserFormData: False일 때, 사용자에 의해 양식 필드 작성이 불가능합니다.
  • SecuritySettings.AllowUserPrinting: 인쇄 권한을 제어합니다. PdfPrintSecurity.FullPrintRights가 인쇄를 허용합니다. 다른 값을 사용하여 이를 제한합니다.
  • SecuritySettings.OwnerPassword: PDF 뷰어에서 보안 설정을 편집하거나 변경하려면 비밀번호가 필요합니다.
  • SecuritySettings.UserPassword: PDF를 열고 읽으려면 비밀번호가 필요합니다.
IronPDF for Python으로 PDF 문서를 안전하게 관리하는 방법을 알아보세요!

시작할 준비 되셨나요?

버전:2026.11방금 출시