pypdf 6.9.2


pip install pypdf

  Latest version

Released: Mar 23, 2026


Meta
Author: Mathieu Fenniak
Maintainer: stefan6419846
Requires Python: >=3.9

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

Programming Language
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Operating System
  • OS Independent

Topic
  • Software Development :: Libraries :: Python Modules

Typing
  • Typed

PyPI version Python Support GitHub last commit codecov

pypdf

pypdf is a free and open-source pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. It can also add custom data, viewing options, and passwords to PDF files. pypdf can retrieve text and metadata from PDFs as well.

See pdfly for a CLI application that uses pypdf to interact with PDFs.

Installation

Install pypdf using pip:

pip install pypdf

For using pypdf with AES encryption or decryption, install extra dependencies:

pip install pypdf[crypto]

NOTE: pypdf 3.1.0 and above include significant improvements compared to previous versions. Please refer to the migration guide for more information.

Usage

from pypdf import PdfReader

reader = PdfReader("example.pdf")
number_of_pages = len(reader.pages)
page = reader.pages[0]
text = page.extract_text()

pypdf can do a lot more, e.g. splitting, merging, reading and creating annotations, decrypting and encrypting. Check out the documentation for additional usage examples!

For questions and answers, visit StackOverflow (tagged with pypdf).

Contributions

Maintaining pypdf is a collaborative effort. You can support the project by writing documentation, helping to narrow down issues, and submitting code. See the CONTRIBUTING.md file for more information.

Q&A

The experience pypdf users have covers the whole range from beginner to expert. You can contribute to the pypdf community by answering questions on StackOverflow, helping in discussions, and asking users who report issues for MCVE's (Code + example PDF!).

Issues

A good bug ticket includes a MCVE - a minimal complete verifiable example. For pypdf, this means that you must upload a PDF that causes the bug to occur as well as the code you're executing with all of the output. Use print(pypdf.__version__) to tell us which version you're using.

Code

All code contributions are welcome, but smaller ones have a better chance to get included in a timely manner. Adding unit tests for new features or test cases for bugs you've fixed help us to ensure that the Pull Request (PR) is fine.

pypdf includes a test suite which can be executed with pytest:

$ pytest
===================== test session starts =====================
platform linux -- Python 3.6.15, pytest-7.0.1, pluggy-1.0.0
rootdir: /home/moose/GitHub/Martin/pypdf
plugins: cov-3.0.0
collected 233 items

tests/test_basic_features.py ..                         [  0%]
tests/test_constants.py .                               [  1%]
tests/test_filters.py .................x.....           [ 11%]
tests/test_generic.py ................................. [ 25%]
.............                                           [ 30%]
tests/test_javascript.py ..                             [ 31%]
tests/test_merger.py .                                  [ 32%]
tests/test_page.py .........................            [ 42%]
tests/test_pagerange.py ................                [ 49%]
tests/test_papersizes.py ..................             [ 57%]
tests/test_reader.py .................................. [ 72%]
...............                                         [ 78%]
tests/test_utils.py ....................                [ 87%]
tests/test_workflows.py ..........                      [ 91%]
tests/test_writer.py .................                  [ 98%]
tests/test_xmp.py ...                                   [100%]

========== 232 passed, 1 xfailed, 1 warning in 4.52s ==========
6.9.2 Mar 23, 2026
6.9.1 Mar 17, 2026
6.9.0 Mar 15, 2026
6.8.0 Mar 09, 2026
6.7.5 Mar 02, 2026
6.7.4 Feb 27, 2026
6.7.3 Feb 24, 2026
6.7.2 Feb 22, 2026
6.7.1 Feb 17, 2026
6.7.0 Feb 08, 2026
6.6.2 Jan 26, 2026
6.6.1 Jan 25, 2026
6.6.0 Jan 09, 2026
6.5.0 Dec 21, 2025
6.4.2 Dec 14, 2025
6.4.1 Dec 07, 2025
6.4.0 Nov 23, 2025
6.3.0 Nov 16, 2025
6.2.0 Nov 09, 2025
6.1.3 Oct 22, 2025
6.1.2 Oct 19, 2025
6.1.1 Sep 28, 2025
6.1.0 Sep 21, 2025
6.0.0 Aug 11, 2025
5.9.0 Jul 27, 2025
5.8.0 Jul 13, 2025
5.7.0 Jun 29, 2025
5.6.1 Jun 22, 2025
5.6.0 Jun 01, 2025
5.5.0 May 11, 2025
5.4.0 Mar 16, 2025
5.3.1 Mar 02, 2025
5.3.0 Feb 09, 2025
5.2.0 Jan 26, 2025
5.1.0 Oct 27, 2024
5.0.1 Sep 29, 2024
5.0.0 Sep 17, 2024
4.3.1 Jul 21, 2024
4.3.0 Jul 14, 2024
4.2.0 Apr 07, 2024
4.1.0 Mar 03, 2024
4.0.2 Feb 18, 2024
4.0.1 Jan 28, 2024
4.0.0 Jan 19, 2024
3.17.4 Dec 24, 2023
3.17.3 Dec 17, 2023
3.17.2 Dec 10, 2023
3.17.1 Nov 14, 2023
3.17.0 Oct 29, 2023
3.16.4 Oct 10, 2023
3.16.3 Oct 08, 2023
3.16.2 Sep 24, 2023
3.16.1 Sep 17, 2023
3.16.0 Sep 10, 2023
3.15.5 Sep 03, 2023
3.15.4 Aug 27, 2023
3.15.3 Aug 26, 2023
3.15.2 Aug 20, 2023
3.15.1 Aug 13, 2023
3.15.0 Aug 06, 2023
3.14.0 Jul 29, 2023
3.13.0 Jul 23, 2023
3.12.2 Jul 16, 2023
3.12.1 Jul 09, 2023
3.12.0 Jul 02, 2023
3.11.1 Jun 27, 2023
3.11.0 Jun 23, 2023
3.10.0 Jun 18, 2023
3.9.1 Jun 04, 2023
3.9.0 May 21, 2023
3.8.1 Apr 23, 2023
3.8.0 Apr 16, 2023
3.7.1 Apr 09, 2023
3.7.0 Mar 26, 2023
3.6.0 Mar 18, 2023
3.5.2 Mar 12, 2023
3.5.1 Mar 05, 2023
3.5.0 Feb 26, 2023
3.4.1 Feb 12, 2023
3.4.0 Feb 05, 2023
3.3.0 Jan 22, 2023
3.2.1 Jan 08, 2023
3.2.0 Dec 31, 2022
3.1.0 Dec 23, 2022
1.13 May 17, 2014
1.12 May 17, 2014
1.11 May 17, 2014
1.10 May 17, 2014
1.9 May 17, 2014
1.8 May 17, 2014
1.7 May 17, 2014
1.6 May 17, 2014
1.5 May 17, 2014
1.4 May 17, 2014

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
typing_extensions (>=4.0)