Skip to content

jawadsahil/pdf_viewer_jk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Viewer (JK)

A flutter plugin for viewing PDF files in mobile app (Android & iOS)

Pub.dev

    https://pub.dev/packages/pdf_viewer_jk

Github

    https://github.com/jawadsahil/pdf_viewer_jk/

This plugin is based on Cross PT flutter plugin pdf viewer. Upgrades by Damodar Lohani are also incorporated.

Installation

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

pdf_viewer_jk: 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)),
    );
  }

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published