flutter_plugin_pdf_viewer 1.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new50

flutter_plugin_pdf_viewer #

A flutter plugin for handling PDF files. Works on both Android & iOS

Installation #

Add flutter_plugin_pdf_viewer as a dependency in your pubspec.yaml file.

flutter_plugin_pdf_viewer: any

Android #

No permissions required. Uses application cache directory.

iOS #

No permissions required.

How-to #

Load PDF #

// Load from assets
PDFDocument doc = await PDFDocument.fromAsset('assets/test.pdf');
 
// Load from URL
PDFDocument doc = await PDFDocument.fromURL('http://www.africau.edu/images/default/sample.pdf');

// Load from file
File file  = File('...');
PDFDocument doc = await PDFDocument.fromFile(file);

Load pages #

// Load specific page
PDFPage pageOne = await doc.get(page: _number);

Pre-built viewer #

Use the pre-built PDF Viewer

@override
  Widget build(BuildContext context) {
    Scaffold(
        appBar: AppBar(
          title: Text('Example'),
        ),
        body: Center(
        child: _isLoading
            ? Center(child: CircularProgressIndicator())
            : PDFViewer(document: document)),
    );
  }

This code produces the following view:

Demo Screenshot 1

1.0.1 #

  • Updated readme.md and added screenshots to package

1.0.0 #

  • Initial release

example/README.md

flutter_pdf_viewer_example #

Demonstrates how to use the flutter_pdf_viewer plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_plugin_pdf_viewer: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_plugin_pdf_viewer/flutter_plugin_pdf_viewer.dart';
  
Version Uploaded Documentation Archive
1.0.1 Mar 15, 2019 Go to the documentation of flutter_plugin_pdf_viewer 1.0.1 Download flutter_plugin_pdf_viewer 1.0.1 archive
1.0.0 Mar 15, 2019 Go to the documentation of flutter_plugin_pdf_viewer 1.0.0 Download flutter_plugin_pdf_viewer 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Mar 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.3.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_cache_manager ^0.3.2 0.3.2
material_design_icons_flutter ^3.2.3595 3.2.3595
numberpicker ^1.0.0 1.0.0
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
http 0.12.0+1
http_parser 3.1.3
infinite_listview 1.0.0
meta 1.1.6 1.1.7
path 1.6.2
path_provider 0.5.0+1
sky_engine 0.0.99
source_span 1.5.5
sqflite 1.1.3
string_scanner 1.0.4
synchronized 2.1.0
term_glyph 1.1.0
typed_data 1.1.6
uuid 2.0.0
vector_math 2.0.8