FLUTTER ECOSYSTEM

kaichii/pdf_viewer

PDFファイルを処理するためのFlutterプラグイン。AndroidおよびiOSで動作します

pdf_viewer のプロジェクト画像
Stars
6
Forks
43
最終プッシュ(UTC)
2024/10/15
プロジェクト状態
公開中
Kai Qi GitHub avatar
GITHUB User

Kai Qi ↗

@Pi-Squared-IncInternet
言語DartJavaObjective-CRubyHTMLSwiftKotlin

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 5 件

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

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.