pdfium_flutter
0.4.3, released 4 days ago by espresso3389.jp
Flutter FFI plugin that bundles PDFium for native PDF rendering on Android, iOS, Windows, macOS, and Linux.
What it does
It packages PDFium native binaries and exposes low‑level FFI bindings so Flutter apps can load and render PDFs directly. The plugin also handles platform‑specific asset packaging and XCFramework integration.
AI-written summary of version 0.4.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need direct, low‑level access to PDFium for custom PDF processing or rendering
- You target native Flutter platforms (mobile, desktop) and require a bundled PDF engine
- You want automatic native binary handling without managing PDFium yourself
Skip it when
- You need a high‑level PDF viewer widget or web support
- You prefer a pure‑Dart solution without native toolchains
- You are building for the web
Strengths
- Cross‑platform native PDFium binaries are bundled automatically
- Supports multi‑engine applications via a process‑wide gate
- Handles iOS/macOS XCFramework integration via CocoaPods/SwiftPM
- No separate download step for PDFium binaries
Weaknesses
- Low‑level API requires manual handling of PDF rendering
- Requires a C toolchain for native builds
- No web support
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 5
A C toolchain is required to compile the bundled gate library on native platforms. iOS/macOS need CocoaPods or Swift Package Manager for the XCFramework. Ensure Flutter 3.47+ and Dart 3.13+.
import 'package:pdfium_flutter/pdfium_flutter.dart';
final pdfium = pdfiumBindings; // default bindings
final customPdfium = getPdfium(modulePath: '/custom/path/to/pdfium.so');Alternatives
Packages that do the same job and could replace pdfium_flutter.
- open_filex
Plugin to open files via native apps, returning a string result
88Compare - pdf_manipulator
Cross-platform PDF toolkit for Flutter. Merge, split, render, extract, search, sign, encrypt, convert, build from scratch. Rust engine, off the main thread.
83Compare - file_saver_ffi
Save any file type to device storage, gallery, or a user‑chosen folder with progress and conflict handling.
76Compare - filepicker_windows
Windows file and directory picker using native dialog controls
75Compare
Works with
Packages commonly used together with pdfium_flutter: ones it builds on, ones built on it, and its own family.
- hookspdfium_flutter depends on itDart API for the JSON-based protocol for package build and link hooks.
- code_assetspdfium_flutter depends on itProvides the hook protocol specification for bundling native code with Dart packages.
- ffipdfium_flutter depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- pdfium_dartpdfium_flutter depends on itDart FFI bindings for the PDFium library providing low-level C API access.
- pdfrx_engineSame familyPure Dart PDF rendering and manipulation API built on top of PDFium.
- pdfrxBuilt on pdfium_flutterFast, cross‑platform PDF viewer and editor widget for Flutter apps.