Extract Text from a PDF
Then there are PDF files that contain an image and a text layer in the background. That typically happens when a document was scanned. Although the scanning software (OCR) is pretty good today, it still fails once in a while. PyPDF2 is no OCR software; it will not be able to detect those failures.
Installation
There are several ways to install PyPDF2.
The PdfReader Class
a XmpInformation instance that can be used to access XMP metadata from the document. or None if no metadata was found on the document root. ... This page is about PyPDF2.
The PdfWriter Class
This page is about PyPDF2.
🌐
Readthedocs
pypdf2.readthedocs.io › en › 3.0.0 › index.html
Welcome to PyPDF2 — PyPDF2 documentation - Read the Docs
PyPDF2 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.
🌐
Readthedocs
pypdf2.readthedocs.io › _ › downloads › en › 2.1.0 › pdf pdf
PyPDF2 documentation
PyPDF2 supports streaming data to a file-like object and here is how. ... Suppose you want to manipulate a PDF and write it directly to AWS S3 without having to write the document to a file
🌐
Readthedocs
pypdf2.readthedocs.io › _ › downloads › en › 3.0.0 › pdf pdf
PyPDF2 documentation
January 6, 2023 - typically happens when a document was scanned. Although the scanning software (OCR) is pretty good today, it still fails once in a while. PyPDF2 is no OCR software; it will not be able to detect those failures.
🌐
PyPI
pypi.org › project › PyPDF2
PyPDF2 · PyPI
PyPDF2 can do a lot more, e.g. splitting, merging, reading and creating annotations, decrypting and encrypting, and more. Please see the documentation for more usage examples!
🌐
Omz Software
omz-software.com › pythonista › docs › ios › PyPDF2.html
PyPDF2 — Python 3.6.1 documentation
February 19, 2020 - PyPDF2 is a pure-python PDF library capable of splitting, merging together, cropping, and transforming the pages of PDF files. It can also add custom data, viewing options, and passwords to PDF files.
🌐
PyPDF
pypdf.readthedocs.io
Welcome to pypdf — pypdf 7.1.0 documentation
Documentation · Testing · Releasing · About pypdf · CHANGELOG · Changelog of PyPDF2 1.X · Migration Guide: 1.x to 2.x · Project Governance · Taking Ownership of pypdf · History of pypdf · Contributors · Scope of pypdf · pypdf vs X · Frequently Asked Questions ·
🌐
GeeksforGeeks
geeksforgeeks.org › python › introduction-to-python-pypdf2-library
Introduction to Python PyPDF2 Library - GeeksforGeeks
July 23, 2025 - PyPDF2 is a Python library that helps in working and dealing with PDF files. It allows us to read, manipulate, and extract information from PDFs without the need for complex software.
Find elsewhere
🌐
Readthedocs
pypdf2.readthedocs.io › en › 3.x › user › extract-text.html
Extract Text from a PDF — PyPDF2 documentation
PyPDF2 is not OCR software. PDF documents can contain images and text. PDF files don’t store text in a semantically meaningful way, but in a way that makes it easy to show the text on screen or print it.
🌐
Readthedocs
pypdf2.readthedocs.io › en › 3.0.0 › modules › PdfWriter.html
The PdfWriter Class — PyPDF2 documentation
reader – PdfReader from the document root should be copied. close() → None[source] · To match the functions from Merger · encrypt(user_password: ~typing.Optional[str] = None, owner_password: ~typing.Optional[str] = None, use_128bit: bool = True, permissions_flag: ~PyPDF2.constants.UserAccessPermissions = UserAccessPermissions.None, user_pwd: ~typing.Optional[str] = None, owner_pwd: ~typing.Optional[str] = None) → None[source] ·
🌐
Konfuzio
konfuzio.com › start › blog › python › pypdf2 - python tutorial for pdf manipulation
PyPDF2 - Python Tutorial for PDF Manipulation
May 24, 2025 - Merge, split, encrypt, decrypt and more PDF files with PyPDF2. This Python tutorial shows you how.
🌐
Readthedocs
pypdf2.readthedocs.io › en › 2.3.0 › modules › PdfWriter.html
The PdfWriter Class — PyPDF2 documentation
insert_page(page: PyPDF2._page.PageObject, index: int = 0) → None[source] · Insert a page in this PDF file. The page is usually acquired from a PdfReader instance. ... page (PageObject) – The page to add to the document.
🌐
Read the Docs
app.readthedocs.org › projects › pypdf2
PyPDF2 - Read the Docs Community
PyPDF2 · EN · Maintainers · Repository · https://github.com/py-pdf/PyPDF2 · Versions 12 Builds 375 ·
🌐
Real Python
realpython.com › pdf-python
How to Work With a PDF in Python – Real Python
April 17, 2019 - The Portable Document Format, or PDF, is a file format that can be used to present and exchange documents reliably across operating systems. While the PDF was originally invented by Adobe, it is now an open standard that is maintained by the International Organization for Standardization (ISO). You can work with a preexisting PDF in Python by using the PyPDF2 package.
🌐
Readthedocs
pypdf2.readthedocs.io › en › 1.27.12 › modules › PdfFileReader.html
The PdfFileReader Class — PyPDF2 documentation
class PyPDF2.pdf.PdfFileReader(stream, strict=True, warndest=None, overwriteWarnings=True)[source]
🌐
Readthedocs
pypdf2.readthedocs.io › en › 3.x › dev › pdf-format.html
The PDF Format - PyPDF2 documentation - Read the Docs
It’s recommended to look in the PDF specification for details and clarifications. This is only intended to give a very rough overview of the format · Header: Contains the version of the PDF, e.g. %PDF-1.7
🌐
Analytics Vidhya
analyticsvidhya.com › home › pypdf2 library for working with pdf files in python
PyPDF2 Library for Working with PDF Files in Python
November 20, 2024 - Built entirely in Python, PyPDF2 does not rely on any external modules, making it an accessible tool for Python developers. The library offers a dual API system to cater to different programming needs. The low-level API, inspired by Pygments, provides the capability to craft programs that can generate or manipulate documents with high efficiency.
🌐
PyPDF
pypdf.readthedocs.io › en › latest
Welcome to pypdf — pypdf 6.5.0 documentation - Read the Docs
Documentation · Testing · Releasing · About pypdf · CHANGELOG · Changelog of PyPDF2 1.X · Migration Guide: 1.x to 2.x · Project Governance · Taking Ownership of pypdf · History of pypdf · Contributors · Scope of pypdf · pypdf vs X · Frequently Asked Questions ·