搜索插件、代码仓与 APP 分类

插件详情v2.12.1

pdfrx

pdfrx 是一个基于 PDFium 构建的丰富且快速的 PDF 查看器和操作插件。支持在 Android、iOS、Windows、macOS、Linux 和 Web 上查看、编辑和合并 PDF 文件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
68.6万
喜欢数
357
Pub 分数
160

安装插件

flutter pub add pdfrx

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

pdfrx 是一个高性能的 PDF 查看器和操作插件,利用 PDFium 实现跨平台的快速渲染和处理。它使用户能够在 Android、iOS、Web、macOS、Windows 和 Linux 上无缝查看、编辑和合并 PDF 文档。专为寻求强大 PDF 功能且设置简单的开发者设计,pdfrx 提供原生体验,支持注释、文本选择和页面导航。其跨平台兼容性使其成为需要可靠 PDF 处理功能而无需编写特定平台代码的应用的理想选择。

适合场景

  • 在移动和桌面应用程序中查看 PDF
  • 合并多个PDF文件
  • 交互式编辑PDF内容
  • 将PDF集成到Web应用程序中
  • 创建文档管理工具
  • 在应用程序中启用注释功能

主要特点

  • 基于 PDFium 构建,以实现速度和可靠性
  • 跨平台支持(Android、iOS、Web、macOS、Windows、Linux)
  • 支持 PDF 编辑和合并
  • 原生性能与 Flutter 集成
  • 文本选择和搜索功能
  • 注释和标记工具

适合对象

  • 开发文档密集型应用的开发者
  • 需要处理PDF的教育或企业软件
  • 需要多平台PDF支持的应用程序
  • 需要轻量级 PDF 解决方案的团队
  • 需要快速 PDF 渲染的项目

使用建议

  • 某些平台需要原生依赖项
  • PDF 渲染 UI 的自定义选项有限
  • 由于包含 PDFium,可能导致应用体积增大
  • 高级PDF功能可能需要额外配置
  • Web 支持取决于浏览器兼容性
  • 性能在大型或复杂的PDF文件中会有所不同

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

pdfrx

This repository contains multiple Dart/Flutter packages for PDF rendering, viewing, and manipulation:

Requirements

  • Dart packages require Dart 3.13 or later.
  • Flutter packages require Flutter 3.47 or later.
  • Apple platform integrations target iOS 15 or later and macOS 12 or later.

Packages

pdfrx_engine

A platform-agnostic PDF rendering and manipulation API built on top of PDFium.

  • Pure Dart package (no Flutter dependencies)
  • Provides low-level PDF document API for viewing and editing
  • Supports page re-arrangement, PDF combining, image import, and document manipulation
  • Can be used in CLI applications or non-Flutter Dart projects
  • Supports all platforms: Android, iOS, Windows, macOS, Linux

View repo | API reference

pdfrx

A cross-platform PDF viewer and manipulation plugin for Flutter.

  • Flutter plugin with UI widgets
  • Built on top of pdfrx_engine
  • Provides high-level viewer widgets and overlays
  • Includes text selection, search, zoom controls, and more
  • Supports PDF editing features like page manipulation, document combining, and image import

View repo | API reference

pdfrx_coregraphics

⚠️ EXPERIMENTAL - CoreGraphics-backed renderer for pdfrx on iOS/macOS.

  • Uses PDFKit/CoreGraphics instead of PDFium on Apple platforms
  • Drop-in replacement for teams preferring the system PDF stack
  • Maintains full compatibility with pdfrx widget API
  • iOS and macOS only

View repo | API reference

pdfium_dart

Low-level Dart FFI bindings for the PDFium library.

  • Pure Dart package with auto-generated FFI bindings using ffigen
  • Provides direct access to PDFium's C API from Dart
  • Provides PDFium as a Dart native asset, downloaded and bundled at build time
  • Includes getPdfium() for resolving PDFium from a custom module path, Flutter-packaged library, or bundled native asset
  • Coordinates with pdfium_flutter so iOS/macOS Flutter apps use the PDFium XCFramework instead of bundling a duplicate dylib
  • Used as a foundation by higher-level packages

View repo | API reference

pdfium_flutter

Flutter FFI plugin for PDFium integration on native Flutter platforms.

  • Supports Android, iOS, Windows, macOS, and Linux
  • Provides the platform packaging needed to deploy PDFium in Flutter apps
  • Uses Dart native assets for Android, Linux, and Windows
  • Uses the iOS/macOS PDFium XCFramework through CocoaPods or Swift Package Manager
  • Includes low-level PDFium FFI bindings

View repo | API reference

When to Use Which Package

  • Use pdfrx if you're building a Flutter application and need PDF viewing and manipulation capabilities with UI
  • Use pdfrx_engine if you need PDF rendering and manipulation without Flutter dependencies (e.g., server-side PDF processing, CLI tools, PDF combining utilities)
  • Use pdfrx_coregraphics (experimental) if you want to use CoreGraphics/PDFKit instead of PDFium on iOS/macOS
  • Use pdfium_flutter if you're building Flutter apps or plugins that need direct PDFium access on native platforms
  • Use pdfium_dart if you need low-level PDFium FFI bindings for pure Dart projects

Getting Started

For Flutter Applications

Add pdfrx to your pubspec.yaml:

dependencies:
  pdfrx: ^2.6.5
For Pure Dart Applications

Add pdfrx_engine to your pubspec.yaml:

dependencies:
  pdfrx_engine: ^0.6.1

Documentation

Comprehensive documentation is available in the doc/ directory, including:

  • Getting started guides
  • Feature tutorials
  • Platform-specific configurations
  • Code examples

Development

This is a monorepo managed with pub workspaces. Just do dart pub get on some directory inside the repo to obtain all the dependencies.

Example Applications

PDF Viewer

The example viewer application is located in packages/pdfrx/example/viewer/. It demonstrates the full capabilities of the pdfrx Flutter plugin.

cd packages/pdfrx/example/viewer
flutter run
PDF Combine

The packages/pdfrx/example/pdf_combine/ application demonstrates PDF page manipulation and combining features:

  • Drag-and-drop interface for page re-arrangement
  • Visual thumbnails of PDF pages
  • Support for combining multiple PDF documents
  • Platform file drag-and-drop support
cd packages/pdfrx/example/pdf_combine
flutter run

Contributing

Contributions are welcome! Please read the individual package READMEs for specific development guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

所属分类

依赖

依赖清单 13 项

源码仓库

使用此插件的项目