搜尋套件、儲存庫與 APP 分類

套件詳情v1.1.5

flutter_fullpdfview

適用於 Android 和 IOS 的 PDF 查看器,包含縮放策略。基於 endigo 的 flutter_pdfview。

近 30 天下載
54
喜歡數
27
Pub 分數
40

安裝套件

flutter pub add flutter_fullpdfview

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個用於在 Android 和 iOS 上顯示 PDF 的 Flutter 套件,支援自訂縮放策略。作為 flutter_pdfview 套件的延伸建構,它提供流暢、互動式的 PDF 閱讀體驗,支援縮放、拖曳與響應式版面調整。專為尋求可靠、跨平台解決方案,將 PDF 渲染整合至應用程式中的開發者設計,無需進行大量設定。

適用情境

  • 在移動應用中顯示文件
  • 查看用戶上傳的PDF文件
  • 閱讀電子書或手冊
  • 在教育類應用程式中整合PDF
  • 渲染合約或表格

主要特色

  • 跨平台相容性(Android 與 iOS)
  • 支援多種擬合策略
  • 縮放和拖動手勢
  • 輕量且易於整合
  • 響應式佈局處理

適合對象

  • 行動應用開發者
  • 文件管理應用
  • 電子學習平台
  • 內容分發應用
  • PDF密集型企業應用

使用建議

  • 需要原生平台權限以存取檔案
  • 僅限 Android 和 iOS(無網頁/桌面端支援)
  • 性能可能因大PDF檔案而異
  • 無內建的PDF編輯功能
  • 依賴於底層的 flutter_pdfview 實現

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_fullpdfview

Native PDF View for iOS and Android

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_fullpdfview: latest_version
2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

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

3. Setup
iOS

Opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file with the key io.flutter.embedded_views_preview and the value YES.

4. Import it

Now in your Dart code, you can use:

import 'package:flutter_fullpdfview/flutter_fullpdfview.dart';

Options

Name Android iOS
onViewCreated V V
onRender V V
onPageChanged V V
onError V V
onPageError V X
gestureRecognizers V V
filePath V V
fitEachPage V V
defaultPage V V
dualPageMode V V
displayAsBook V V
dualPageWithBreak V V
enableSwipe V V
swipeHorizontal V V
password V V
nightMode V X
password V V
autoSpacing V V
pageFling V V
pageSnap V V
backgroundColor V V
fitPolicy V X

Only black and white are supported on Android and iOS at the moment!

Controller Options

Name Description Parameters Return
getPageCount Get total page count - Future<int>
getCurrentPage Get current page - Future<int>
setPage Go to/Set page int page Future<bool>
setPageWithAnimation Go to/Set page int page Future<bool>
resetZoom Go page and fitToWidth int page Future<bool>
getZoom Get the current zoom double zoom Future<double>
setZoom Set the current zoom double zoom Future<double>
getPageWidth Get the pdf width double width Future<double>
getPageHeight Get the pdf height double height Future<double>

Example

PDFView(
  filePath: path,
  enableSwipe: true,
  fitEachPage: true,
  swipeHorizontal: true,
  autoSpacing: false,
  pageFling: false,
  defaultPage: 8,
  dualPageMode: orientation == Orientation.landscape,
  displayAsBook: true,
  onRender: (_pages) {
    setState(() {
      pages = _pages;
      isReady = true;
    });
  },
  onError: (error) {
    print(error.toString());
  },
  onPageError: (page, error) {
    print('$page: ${error.toString()}');
  },
  onViewCreated: (PDFViewController pdfViewController) {
    _controller.complete(pdfViewController);
  },
  onPageChanged: (int page, int total) {
    print('page change: $page/$total');
  },
),

For production usage

If you use proguard, you should include this line.

-keep class com.shockwave.**

Dependencies

Android

apv Updated From: AndroidPdfViewer

iOS (only support> 11.0)

PDFKit

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。