搜尋套件、儲存庫與 APP 分類

套件詳情v2.12.0

pdfrx

pdfrx 是一個基於 PDFium 建構的豐富且快速的 PDF 查看器與操作外掛程式。支援在 Android、iOS、Windows、macOS、Linux 與 Web 上檢視、編輯及合併 PDF 檔案。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
63.8萬
喜歡數
356
Pub 分數
160

安裝套件

flutter pub add pdfrx

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

pdfrx 是一個高效率的 PDF 查看器與操作外掛程式,利用 PDFium 實現跨平台的快速渲染與處理。它讓使用者能在 Android、iOS、Web、macOS、Windows 與 Linux 上無縫地檢視、編輯與合併 PDF 文件。專為尋求強大 PDF 功能且設定簡單的開發者設計,pdfrx 提供類似原生的體驗,支援註解、文字選擇與頁面導航。其跨平台相容性使其成為需要可靠 PDF 處理功能而不需撰寫特定平台程式碼之應用的理想選擇。

適用情境

  • 在行動和桌面應用程式中檢視 PDF
  • 合併多個PDF檔案
  • 互動式編輯PDF內容
  • 將PDF整合到網頁應用程式中
  • 建立文件管理工具
  • 在應用程式中啟用註釋功能

主要特色

  • 基於 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 項

原始碼儲存庫

使用此套件的專案