パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v2.4.0

alh_pdf_view

ファイルパスのバイトをウィジェットとしてPDFを表示する機能があり、いくつかの追加機能も備えています。

AndroidiOS
30日間ダウンロード
1440
いいね数
36
Pub ポイント
160

パッケージをインストール

flutter pub add alh_pdf_view

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

alh_pdf_view は、バイトデータまたはファイルパスを使用してPDFファイルをウィジェットとして表示できるFlutterパッケージです。ズーム、スクロール、ページナビゲーションなどの追加機能を提供しており、インタラクティブなPDFレンダリングを必要とするアプリに適しています。このパッケージはAndroidおよびiOSプラットフォームをサポートしており、クロスプラットフォーム互換性を確保しています。Flutterのウィジェットシステムとシームレスに統合され、モバイルアプリ内でのドキュメント表示に最適です。

用途

  • ファイルパスからPDFを表示する
  • バイトデータからPDFをレンダリングする
  • ズーム機能付きのインタラクティブなPDF閲覧
  • モバイルアプリにドキュメントを埋め込む
  • ユーザーがアップロードしたPDFの表示
  • ドキュメントプレビュー画面の作成

主な機能

  • バイトまたはファイルパスからのPDFレンダリングをサポート
  • 内蔵のズームおよびスクロール機能
  • クロスプラットフォーム(Android および iOS)
  • Flutterウィジェットとの簡単な統合
  • 軽量で高速なレンダリング
  • ページナビゲーションコントロール

適している対象

  • ドキュメントビューアアプリ
  • eラーニングプラットフォーム
  • モバイルバンキングアプリ
  • PDF注釈ツール
  • コンテンツ管理システム
  • ユーザー生成コンテンツのプレビュー

注意事項

  • 適切なファイルパスの処理が必要です
  • 基本的なPDF操作に限定
  • 組み込みのテキスト選択または検索なし
  • 外部のネイティブライブラリに依存しています
  • 大きなPDFではパフォーマンスの問題が発生する可能性があります
  • 複雑なPDF編集には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Pub Version GitHub branch checks state

With this widget, you can display a PDF with bytes or a path.

Index

Introduction

The package alh_pdf_view includes:

  • Displays PDF with bytes or path

See more about the functionalities in the parameter section.

Android
iOS
  • implemented in Swift with the dependency PDFKit

Example


import 'package:alh_pdf_view/alh_pdf_view.dart';
import 'package:flutter/material.dart';

class AlhPdfViewExample extends StatelessWidget {
  const AlhPdfViewExample({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('PDF Example')),
      body: const AlhPdfView(
        filePath: 'ADD_PATH_TO_FILE',
      ),
    );
  }
}
Parameters

This is a list of all parameters that can be used for this widget. Consider that some paremters only work for one platform.

Parameter Description Default Value
filePath Optional path to load PDF file. -
bytes Optional bytes to load PDF file. -
fitPolicy Defines how the PDF should fit inside the widget. FitPolicy.both
fitEachPage Each page of the PDF will fit inside the given space. (only Android) true
enableSwipe The current page will be changed when swiping. true
swipeHorizontal If true, all pages are displayed in horizontal direction. false
nightMode Inverting colors of pages to have the look of a dark mode. (only Android) false
autoSpacing If true, spacing will be added to fit each page on its own on the screen. (only Android) true
pageFling Making a fling change. true
pageSnap Snap pages to screen boundaries when changing the current page. (only Android) true
defaultPage Describes which page should be shown at first. 0
defaultZoomFactor Defines how much the displayed PDF page should zoomed when rendered. 1.0
backgroundColor Setting backgroundColor of remaining space around the pdf view. Colors.transparent
password Unlocks PDF page with this password. ""
enableDoubleTap When double tapping, the zoom of the page changes. (only Android) 1.0
minZoom Min zoom value that the user can reach while zooming. 0.5
maxZoom Max zoom value that the user can reach while zooming. 4.0
enableDefaultScrollHandle Adds a button to scroll faster through the document. (only Android) false
showScrollbar If true, a Scrollbar is visible for the Pdf View (only iOS). true
spacing Spacing between pdf pages. 0

This is a list of functional parameters.

Parameter Description Default Value
gestureRecognizers Which gestures should be consumed by the pdf view. -
onViewCreated If not null invoked once the native view is created. -
onRender Callback once the PDF page was loaded. -
onPageChanged When changing the page, this method will be called with the new page. -
onZoomChanged Called when changing the zoom. -
onError When there are errors happening, this methods returns a message. -
onLinkHandle Called when tapping a link in PDF. (only iOS) -
AlhPdfViewController

If you want to start specific actions for the displayed PDF file, you can use AlhPdfViewController. This controller contains some functionalities to update your view. Here is a list of them.

Parameter Description
getPageSize Returns the size of the given [page] index. (only iOS)
getPageCount Returns the number of pages for the PDF.
getCurrentPage Returns the current displayed page.
goToNextPage Navigates to the next page of the PDF.
goToPreviousPage Navigates to the previous page of the PDF.
setPage Jumping to the page optionally animated.
resetZoom Setting the scale factor to the default zoom factor.
setZoom Zooming to the given zoom.
getZoom Returns the current zoom value.

カテゴリー

依存関係

依存関係一覧 3 件

  • alh_pdf_view_android^2.3.3
  • alh_pdf_view_ios^2.4.0
  • alh_pdf_view_platform_interface^2.3.1

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。