Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Encrypt PDF | Manipulating and Combining PDFs
Manipulating and Combining PDFs
course content

Зміст курсу

Manipulating and Combining PDFs

bookEncrypt PDF

encrypt() is a PyPDF2 function that allows developers to add password-based encryption to a PDF file. It's useful for protecting sensitive information in a PDF document, restricting access to a PDF file, and ensuring that only authorized users can view or modify the contents of a PDF file. With encrypt(), developers can automate the process of adding encryption to a PDF file in Python.

Let's create an encrypted file encrypted-pdf.pdf and write the example.pdf content into it.

<example.pdf> file:

Завдання
test

Swipe to show code editor

  1. Read in a PDF;
  2. Add all pages to the writer;
  3. Add a password to the new PDF;
  4. Save the new PDF to a file using the .write() method.

encrypted-pdf.pdf file:

Mark tasks as Completed
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

encrypt() is a PyPDF2 function that allows developers to add password-based encryption to a PDF file. It's useful for protecting sensitive information in a PDF document, restricting access to a PDF file, and ensuring that only authorized users can view or modify the contents of a PDF file. With encrypt(), developers can automate the process of adding encryption to a PDF file in Python.

Let's create an encrypted file encrypted-pdf.pdf and write the example.pdf content into it.

<example.pdf> file:

Завдання
test

Swipe to show code editor

  1. Read in a PDF;
  2. Add all pages to the writer;
  3. Add a password to the new PDF;
  4. Save the new PDF to a file using the .write() method.

encrypted-pdf.pdf file:

Mark tasks as Completed
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 7
AVAILABLE TO ULTIMATE ONLY
We're sorry to hear that something went wrong. What happened?
some-alt