一个用于在 Android、iOS、Web、macOS 和 Windows 上显示 PDF 缩略图的 Flutter 包。该包通过简单地添加一个组件并提供文件路径,使开发者能够轻松将缩略图查看器集成到其应用中。该包轻量级,旨在实现 PDF 页面预览的无缝渲染,无需复杂的设置。非常适合文档管理应用或任何需要快速视觉访问 PDF 内容的应用。
适合场景
移动应用中的文档预览
PDF画廊界面
快速文件浏览
电子学习平台
数字图书馆应用
主要特点
跨平台支持
简单小部件集成
文件路径输入
轻量级渲染
响应式缩略图布局
适合对象
开发文档查看器的开发者
需要 PDF 导航的应用程序
教育或企业软件
以用户界面为重点的PDF应用程序
使用建议
需要有效的PDF文件路径
仅限缩略图显示
无交互式PDF功能
未针对大PDF文件进行优化
取决于底层平台的渲染
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
Pdf Thumbnail
Thumbnail viewer for pdfs
Installation 💻
❗ In order to start using Pdf Thumbnail you must have the Flutter SDK installed on your machine.
There is a detailed example app in the repo, but I've deleted iOS and Android folders.
Simple go to example folder, and run flutter create . inside the folder to add missing native files for the example app.
Demo
Caching ⏲
I left caching part unopinionated to keep the package simple. Just create your own class from ImageThumbnailCacher and implement the read/write methods.
Holding images as Uint8List, so Map<int, Uint8List> is what's need to be written to and read from the cache. It maps page numbers to the images.