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]
Contents 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]
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]
Also included: 3 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.