Skip to main content

📄 flet-pdfview

A lightweight and efficient PDF viewer component for Flet applications.

flet-pdfview provides a simple way to render PDF files inside your UI while keeping performance, stability, and user experience in mind.


✨ Features

  • 🧩 Native PDF rendering inside Flet layouts.
  • 🔍 Interactive Zoom: Support for zooming in and out with configurable limits.
  • 📐 High-resolution rendering with custom DPI.
  • 🖼️ Flexible image fitting using BoxFit.
  • 📱 Fully responsive (via expand=True).
  • 🚫 Silent failure for invalid paths (no crashes, no UI freezes).
  • ⚡ Optimized for performance and UI stability.

📦 Installation

Install the package directly from PyPI:

pip install flet-pdfview

🚀 Basic UsagePython

from flet_pdfview import PdfColumn
from flet import Page, run, BoxFit

def main(page: Page):
    page.add(
        PdfColumn(
            src="path/to/your/file.pdf",
            expand=True,
            dpi=300,
            fitImage=BoxFit.FILL,
            enable_zoom=True
        )
    )

run(main)

🔍 Zoom Control

You can now fully control the viewing experience with the following properties:

min_zoom: Sets the minimum scale allowed (Default : 0.8).

max_zoom: Sets the maximum scale allowed to ensure quality and performance (Default : 2.5).

⚠️ Important Behavior & Performance

1. Silent Failure

PdfColumn will not render anything if the provided path does not exist or does not end with .pdf.

No exceptions ❌

No error dialogs ❌

No UI interruption ❌

2. Technical Performance Warning

[!WARNING] Resource Management: Be cautious when performing intensive property updates on the PdfColumn object after its initial call. If changes involve high values or frequent updates, it may cause a brief delay when closing the application as the component finishes processing tasks to ensure a stable exit.

[!IMPORTANT] This behavior is intentional:

  • No exceptions ❌
  • No error dialogs ❌
  • No UI interruption ❌

The component simply stays silent and allows the application to continue running normally.


🎯 Why Silent Failure?

This design choice ensures:

  • 🛡️ Application stability: Prevents crashes due to missing files.
  • 🧠 Clean Experience: A distraction-free UI for the end-user.
  • 🚀 Production Ready: Predictable behavior in live environments.

In short: No valid PDF → No rendering → App remains stable.

Release files for flet-pdfview 0.84.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flet-pdfview 0.84.0
File Size Uploaded
flet_pdfview-0.84.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flet-pdfview 0.84.0
File Interpreter ABI Platform
flet_pdfview-0.84.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / flet_pdfview-0.84.0.tar.gz

Download URL flet_pdfview-0.84.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5e41cf6890910c9b2dbc844360d46ef72c5de3e78f9260b187461c51f86d1b8d
BLAKE2b-256 checksum
How to use checksums
909a93b472d2df6c1c2feedfba3b17e46fdee30935a9ca8c07ea74d1cac6d031
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / flet_pdfview-0.84.0-py3-none-any.whl

Download URL flet_pdfview-0.84.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccaf3e06d843c653defeef5014da4fb5acdd5d884edaab13d4dc8a40f7101639
BLAKE2b-256 checksum
How to use checksums
bf7c022855c1098defdfdb580d76623f5e4558bbfe7c797ea0f70d4b2d03ea29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.84.0 This release

2 release files

0.2.1

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page