Skip to main content

Flet pdf view for all platforms

Project description

📄 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flet_pdfview-0.84.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flet_pdfview-0.84.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file flet_pdfview-0.84.0.tar.gz.

File metadata

  • Download URL: flet_pdfview-0.84.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for flet_pdfview-0.84.0.tar.gz
Algorithm Hash digest
SHA256 5e41cf6890910c9b2dbc844360d46ef72c5de3e78f9260b187461c51f86d1b8d
MD5 4cefa371472339e8e09e103d110c956f
BLAKE2b-256 909a93b472d2df6c1c2feedfba3b17e46fdee30935a9ca8c07ea74d1cac6d031

See more details on using hashes here.

File details

Details for the file flet_pdfview-0.84.0-py3-none-any.whl.

File metadata

  • Download URL: flet_pdfview-0.84.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for flet_pdfview-0.84.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ccaf3e06d843c653defeef5014da4fb5acdd5d884edaab13d4dc8a40f7101639
MD5 6a50bfca07ebf718017712561c6877bd
BLAKE2b-256 bf7c022855c1098defdfdb580d76623f5e4558bbfe7c797ea0f70d4b2d03ea29

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page