flutter_pdf_viewer 0.0.3 copy "flutter_pdf_viewer: ^0.0.3" to clipboard
flutter_pdf_viewer: ^0.0.3 copied to clipboard

outdated

A native Pdf viewer for flutter based on Pdfium Android

flutter pdf viewer #

Android Only!

A native Pdf viewer for flutter, built on AndroidPdfViewer, which is based on PdfiumAndroid

Features #

  • Can do fast, in-memory native XOR - decryption of files.
  • Night Mode.
  • Password protected pdf.
  • ScrollBar
  • Pinch to zoom

Drawbacks #

  • Inline Pdf Viewing is not supported. ( A new activity is opened ). See #1.

Install #

To use this plugin, follow the installation instructions.

pub package

License: MIT

Example #

Put test.pdf at assets/test.pdf

# pubspec.yaml

flutter:
    ...

    assets:
        - assets/test.pdf
// main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
          child: RaisedButton(
            onPressed: () => FlutterPdfViewer.loadAsset('assets/test.pdf'),
            child: Text('OPEN'),
          ),
        ),
      ),
    );
  }
}

Alternatively,

$ git clone https://github.com/pycampers/flutter_pdf_viewer.git
$ cd flutter_pdf_viewer/example
$ flutter run

Preview #

API #

import 'package:flutter_pdf_viewer/flutter_pdf_viewer.dart';

/// Load Pdf from file path.
/// (Transformed to a File Uri in native code)
Future<void> FlutterPdfViewer.loadFilePath(
    String filePath, {
    String password,
    bool nightMode,
    String xorDecryptKey,
  })


/// Load Pdf from raw bytes.
///
/// Note - This has a performance limitation,
/// because flutter uses a message channel to pass data to native code.
/// (Serialization of large byte arrays can be expensive)
Future<void> loadBytes(
    Uint8List pdfBytes, {
    String password,
    bool nightMode,
    String xorDecryptKey,
  })

/// Load Pdf from Flutter's asset folder
Future<void> loadAsset(
    String assetPath, {
    String password,
    bool nightMode,
    String xorDecryptKey,
  })

Thanks #


Buy Me A Coffee

🐍🏕️

17
likes
0
pub points
61%
popularity

Publisher

unverified uploader

A native Pdf viewer for flutter based on Pdfium Android

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_pdf_viewer