# pypdfium2

Python bindings to PDFium for PDF rendering, inspection and manipulation\.

ID: Q610 · Revision: 658

Type: software · License: Apache\-2\.0 / BSD\-3\-Clause; PDFium and bundled dependencies retain separate licenses[^intro] · Status: active

Website: https://pypdfium2.readthedocs.io/en/stable/



pypdfium2 provides Python bindings to PDFium, with helper classes and access to its underlying C API\. It supports rendering, inspection, manipulation and creation of PDFs\. Its packaged native engine makes it a different deployment choice from a pure\-Python PDF parser\.[^intro]

## Binding and API scope

The Python helpers wrap native PDFium functions, while the raw interface remains available for features not covered by helpers\. This is not unrestricted access to PDF internals: the public API does not expose arbitrary PDF dictionaries or streams\. JavaScript and XFA functionality also depends on explicitly selecting an enabled engine build\.[^intro]

## Threads and object lifetimes

PDFium calls cannot run simultaneously across threads, even on separate documents\. A mutex can serialize calls; processes are the documented route for parallel rendering\. Objects also hold native resources\. Closing a parent closes its children, and closed handles must not be reused\. These constraints matter when embedding the library in a web server or worker pool\.[^api]

## Extraction and API stability

Text extraction provides characters and geometric information, but the core does not perform semantic layout analysis into words, lines or paragraphs\. That distinction matters when building search indexes or reconstructing structured documents\. The support\-model API remains described as beta and covers only part of PDFium; integrations should account for changes rather than assuming every helper has permanent compatibility\.[^api]

## Build availability

The platform matrix includes Windows, macOS and several Linux architectures, with different support tiers and build strategies\. Since version 5\.12, included platforms can vary by release, and release\-specific information takes precedence over the default matrix\. iOS is marked untested, while Pyodide support is experimental with known memory\-management concerns\. A listed architecture therefore does not establish equally mature support across environments\.[^platforms]

## Licensing and substitution

The binding uses Apache\-2\.0/BSD\-3\-Clause terms; PDFium and bundled dependencies have separate notices\. pypdfium2 can substitute for PDF rendering and selected inspection tasks performed by [PyMuPDF](/pymupdf)\. This is a task\-level choice between APIs and engines, not a replacement for every supported format or optional product\. Applications that rely on PyMuPDF\-specific objects, broader input conversion or specialized extraction need separate adaptation and validation\.[^intro][^pymupdf][^api]

## Capabilities and substitutions

### PDF rendering — supported

Helpers expose PDFium page rendering and bitmap output\.[^intro]

Use case: Render PDF pages and inspect text or page objects from Python · Platforms: Windows, macOS, Linux, Python · Region: Version, build and integration requirements apply

### Concurrent threaded PDFium calls — unsupported

Calls must not overlap across threads, even for different documents\.[^api]

Use case: Render PDF pages and inspect text or page objects from Python · Platforms: Windows, macOS, Linux, Python · Region: Version, build and integration requirements apply

### Semantic layout analysis — unsupported

Core text extraction does not identify words, lines or paragraphs as layout\-analysis objects\.[^api]

Use case: Render PDF pages and inspect text or page objects from Python · Platforms: Windows, macOS, Linux, Python · Region: Version, build and integration requirements apply

### JavaScript and XFA — limited

Enabled PDFium builds are an explicit packaging choice, not assumed in ordinary wheels\.[^intro]

Use case: Render PDF pages and inspect text or page objects from Python · Platforms: Windows, macOS, Linux, Python · Region: Version, build and integration requirements apply

### [Substitute for PyMuPDF](/pymupdf) — limited

Can replace PDF rendering and selected inspection tasks when PDFium's API and build fit; it is not equivalent to PyMuPDF's broader document\-format or optional product support\.[^intro][^api][^pymupdf]

Use case: Render PDF pages and inspect text or page objects from Python · Platforms: Windows, macOS, Linux, Python · Region: Version, build and integration requirements apply

## References

[^intro]: [pypdfium2 introduction](<https://pypdfium2.readthedocs.io/en/stable/readme.html>) — Binding architecture, installation, optional V8/XFA builds and licensing (vendor; retrieved 2026-10-07T13:44:43Z)

[^api]: [Python API](<https://pypdfium2.readthedocs.io/en/stable/python_api.html>) — Thread safety, helper stability, memory management and text\-analysis limits (vendor; retrieved 2026-10-07T13:44:43Z)

[^platforms]: [Platform support](<https://pypdfium2.readthedocs.io/en/stable/platforms.html>) — August 2026 matrix, release strategies and experimental platforms (vendor; retrieved 2026-10-07T13:44:43Z)

[^pymupdf]: [PyMuPDF features](<https://pymupdf.readthedocs.io/en/latest/about.html>) — Rendering and document\-processing library (vendor; retrieved 2026-10-07T13:44:43Z)

Source revision: https://substitutefor.net/entities/Q610?revision=658
