GithubHelp home page GithubHelp logo

milan-7span / pdf_viewer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kaichii/pdf_viewer

0.0 0.0 0.0 744 KB

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

Home Page: https://pub.dev/packages/easy_pdf_viewer

License: BSD 3-Clause "New" or "Revised" License

Ruby 4.25% Objective-C 10.79% Java 10.95% Kotlin 0.19% Dart 70.11% Swift 1.42% HTML 2.30%

pdf_viewer's Introduction

easy_pdf_viewer

A flutter plugin for handling PDF files. Works on both Android & iOS. Originally forked from (https://github.com/lohanidamodar/pdf_viewer).

Pub Package

Installation

> flutter pub add easy_pdf_viewer

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('https://www.ecma-international.org/wp-content/uploads/ECMA-262_12th_edition_june_2021.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) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Example'),
      ),
      body: Center(
          child: _isLoading
              ? Center(child: CircularProgressIndicator())
              : PDFViewer(document: document)),
    );
  }

This code produces the following view:

demo

Third-party packages used

Name Description
path_provider A Flutter plugin for finding commonly used locations on the filesystem. Supports iOS and Android.
flutter_cache_manager A CacheManager to download and cache files in the cache directory of the app. Various settings on how long to keep a file can be changed.
numberpicker NumberPicker is a custom widget designed for choosing an integer or decimal number by scrolling spinners.
flutter_advanced_networkimage An advanced image provider provides caching and retrying for flutter app. Now with zoomable widget and transition to image widget.

pdf_viewer's People

Contributors

lohanidamodar avatar kaichii avatar crosspt avatar milan-7span avatar markathomas avatar amerchdev avatar allanwolski avatar shabanov-krl avatar sebastienbtr avatar abhisheksrocks avatar apgapg avatar gabiionut avatar ludwiktrammer avatar rwbr avatar sharmashashi avatar wiansnyman avatar buckeye-interactive avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.