simple_pdf_viewer 0.1.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 80

simple_pdf_viewer #

A very simple flutter plugin project. Just show pdf from remote url on android/ios, support embedded widget.

Features #

On Android, first it use okhttp to download file to cache folder, then use built on AndroidPdfViewer to load file on local.

On IOS, it just use embedded webview to load url.

Note #

Add this to ios/Runner/info.plist to support embedded widget

<key>io.flutter.embedded_views_preview</key>
<true/>

If your pdf url is http not https, add this to

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Add follow to android/app/build.gradle

    defaultConfig {
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

If you have some android compile error about android support-v4 or AndroidX. It may caused by android webview plugin, we could remove the plugin to fix.

  1. add this config to android/app/build.gradle top level
configurations{
    all*.exclude module: "webview_flutter"
}
  1. create dir io.flutter.plugins.webviewflutter, create file WebViewFlutterPlugin.java with follow content
package io.flutter.plugins.webviewflutter;

import io.flutter.plugin.common.PluginRegistry;

public class WebViewFlutterPlugin {
    public static void registerWith(PluginRegistry.Registrar registrar) {
        //Do nothing
    }
}

Install #

simple_pdf_viewer: ^0.1.5

License: Apache 2.0

Thanks #

Screenshot #

image

0.0.1 #

  • TODO: Describe initial release.

example/README.md

pdf_viewer_example #

Demonstrates how to use the 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:
  simple_pdf_viewer: ^0.1.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:simple_pdf_viewer/simple_pdf_viewer.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
69
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/simple_pdf_viewer.dart.

Run flutter format to format lib/simple_pdf_viewer.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
webview_flutter ^0.3.3 0.3.15+1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8