Skip to content
pubscout

pdftron_flutter

1.0.1-62, released 5 weeks ago by pdftron.com

A wrapper for the PDFTron mobile SDK to view and annotate PDF documents.

$ flutter pub add pdftron_flutter
Source repository

What it does

It provides a convenience wrapper around the native PDFTron SDKs for Flutter apps to handle document viewing and annotating. Developers can present documents using either a plugin or a dedicated DocumentView widget.

AI-written summary of version 1.0.1-62, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need robust out-of-the-box PDF viewing and annotation capabilities inside your Flutter app.
  • You want to leverage the native PDFTron (Apryse) SDK functionality via a Flutter plugin or widget.

Skip it when

  • You require deep and complex custom modifications to the lower-level functionality of the native SDK.
  • You want a pure Dart-based PDF rendering engine without relying on large native wrapper binaries.

Strengths

  • Smooth and flexible stand-alone document viewing.
  • Supports both Android and iOS platforms with options for Swift Package Manager or CocoaPods.
  • Comes with built-in features for handling annotations and document configuration.

Weaknesses

  • Exposes only a limited set of APIs from the native SDKs.
  • Requires platform-specific setup steps (such as modifying Android build files or iOS deployment targets).

Setup

Kind
Plugin (native code)
Effort
High
Code generation
No
Direct dependencies
0

Requires native configuration including setting a PDFTRON_LICENSE_KEY, configuring Android permissions/MainActivity, and setting the minimum iOS deployment target to 13.0.

import 'package:flutter/material.dart';
import 'package:pdftron_flutter/pdftron_flutter.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Viewer(),
    );
  }
}

class Viewer extends StatefulWidget {
  @override
  _ViewerState createState() => _ViewerState();
}

class _ViewerState extends State<Viewer> {
  String _document = "https://pdftron.s3.amazonaws.com/downloads/pl/PDFTRON_mobile_about.pdf";

  @override
  void initState() {
    super.initState();
    PdftronFlutter.initialize("your_pdftron_license_key");
    PdftronFlutter.openDocument(_document);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('PDF Viewer')),
      body: Center(child: Text('Opening PDF...')),
    );
  }
}