software · Q555
pypdf
Pure-Python library for manipulating PDF pages and extracting existing text and metadata.
Overview
pypdf is a pure-Python library for manipulating existing PDF documents and extracting their text and metadata. It can split, combine, crop and transform pages, and provides programmatic access to other document features. It is a library for an application's processing logic rather than an interactive document viewer or an OCR engine.[1][2]
Processing existing PDFs
pypdf supports common page-processing operations without requiring an application to implement PDF syntax itself. Its stated scope includes manipulating documents, extracting data and handling encryption. Generating a designed report from scratch, converting HTML or word-processing files, and reliable replacement of arbitrary words are separate problems. A library substitution should be based on concrete transformations rather than the broad label PDF editing.[1][2]
Text extraction and scanned pages
The extraction API reads existing text information and offers layout-oriented output and visitor hooks. Scanned pages may contain only images, while an OCR-processed scan may carry a separate text layer that pypdf can read. It does not perform OCR or validate an OCR engine's recognition. Complex layouts also make reading order and coordinates difficult, and parsing a large content stream can consume substantially more memory than its stored file size suggests.[4]
Cropping and transformation
Cropping adjusts the visible page box and can leave the hidden material in the file. It must not be used as a security redaction method. The transformation documentation also distinguishes rotating the page from transforming the coordinates of its contents, and separates changing page size from scaling the content. These distinctions matter in imposed layouts and overlays where a visually plausible result may still have unexpected clipping.[5]
Dependencies and output assurances
The installation guide lists Python 3.9 or later and a minimal base installation, with additional dependencies for AES encryption and image extraction. Calling the library pure Python should not be generalized into a promise that every optional workflow has no external components. The source uses BSD-3-Clause licensing. Separately, the documentation explicitly makes no PDF/A guarantees, so a successful write is not an archival-conformance certificate.[3][6][7]
Substitution considerations
pypdf can substitute for pikepdf for selected Python page-manipulation tasks. pikepdf wraps a native C++ engine, so deployment and API choices differ. A migration should retain representative input and output tests for the operations actually used, especially where forms, metadata or archival requirements matter. This research establishes documented overlap, not identical behavior or measured performance.[1][7][8]
Capabilities & limitations
Existing text extraction
limitedExtracts text streams, including existing OCR layers, but does not recognize characters in page images.[2][4]
Python PDF manipulation and text extraction · Python 3.9+; optional dependencies vary by task · Version, build and integration requirements apply
2 sources · check evidence
Text extraction limitations and memory requirements
vendor · checked 2026-10-07Library scope and excluded OCR, format conversion and layout roles
vendor · checked 2026-10-07Secure removal by cropping
unsupportedChanging the visible page box leaves cropped content recoverable.[5]
Python PDF manipulation and text extraction · Python 3.9+; optional dependencies vary by task · Version, build and integration requirements apply
1 source · check evidence
Crop boxes preserve hidden content; page versus content transformation
vendor · checked 2026-10-07PDF/A guarantees
unsupportedDocumentation explicitly makes no PDF/A guarantees.[7]
Python PDF manipulation and text extraction · Python 3.9+; optional dependencies vary by task · Version, build and integration requirements apply
1 source · check evidence
No PDF/A guarantees
vendor · checked 2026-10-07Can substitute for
These are products or services this entry can replace. Check the task and limitations for each comparison.
pikepdf for Python PDF manipulation and text extraction
limitedCan cover page manipulation in Python with a pure-Python implementation; API, rendering and archival requirements need separate evaluation.[1][7][8]
Python 3.9+; optional dependencies vary by task · Version, build and integration requirements apply
References
- pypdf documentation
Library identity and page manipulation
vendor · retrieved 2026-10-07 - Scope of pypdf
Library scope and excluded OCR, format conversion and layout roles
vendor · retrieved 2026-10-07 - pypdf license
Three-clause BSD terms
vendor · retrieved 2026-10-07 - pypdf text extraction
Text extraction limitations and memory requirements
vendor · retrieved 2026-10-07 - pypdf cropping and transformation
Crop boxes preserve hidden content; page versus content transformation
vendor · retrieved 2026-10-07 - pypdf installation
Python requirement and optional crypto/image dependencies
vendor · retrieved 2026-10-07 - pypdf PDF/A limitations
No PDF/A guarantees
vendor · retrieved 2026-10-07 - pikepdf documentation
Native qpdf wrapper and manipulation scope
vendor · retrieved 2026-10-07
Discussion & disputes
Ask about unclear claims or explain a concern with supporting sources. If you have a specific fix, suggest a correction.
No discussion yet.
Revision history
Open a revision to read an earlier version of this article.
| Revision | Timestamp | Edit summary |
|---|---|---|
| 602 | 2026-10-12 22:36:07 | /* wbeditentity-create-item:0| */ sf:69916d29-78f6-4856-9dd8-b3d76d419438:v1 | Add pypdf with OCR, cropping, optional dependencies and PDF/A guarantee boundaries; source research only. | attribution: /proposals/69916d29-78f6-4856-9dd8-b3d76d419438 |