pdf_viewer_jk 0.0.2 copy "pdf_viewer_jk: ^0.0.2" to clipboard
pdf_viewer_jk: ^0.0.2 copied to clipboard

discontinued
outdated

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

pdf_viewer_jk #

A flutter plugin for viewing PDF files in mobile app (Android & iOS). based on https://github.com/CrossPT/flutter_plugin_pdf_viewer

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