搜索插件、代码仓与 APP 分类

插件详情v1.0.8

easy_pdf_viewer

一个用于处理 PDF 文件的 Flutter 插件。可在 Android 和 iOS 上运行

AndroidiOS
近 30 天下载
6590
喜欢数
77
Pub 分数
140

安装插件

flutter pub add easy_pdf_viewer

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Easy PDF Viewer 是一个 Flutter 插件,旨在简化移动应用程序中 PDF 文件的显示和处理。它支持 Android 和 iOS 平台,为在 Flutter 应用中渲染 PDF 提供了简单直接的集成方式。该包提供了一个简洁、可自定义的组件,使用户能够查看 PDF,并具备基本的导航功能,如缩放和滚动。该插件注重易用性,设置简单,可无缝集成到现有的 Flutter 项目中。非常适合需要轻量级 PDF 查看功能而无需复杂配置的应用。

适合场景

  • 在应用程序中显示PDF文档
  • 将PDF集成到教育工具中
  • 查看用户生成或下载的PDF
  • 在移动应用程序中嵌入手册或指南
  • 在移动设备上渲染合同或表单

主要特点

  • 跨平台支持(Android 和 iOS)
  • PDF 渲染的简单 API
  • 内置缩放和滚动功能
  • 轻量且易于集成
  • 可自定义的 UI 组件

适合对象

  • 开发以文档为中心的应用程序的开发者
  • 教育或企业应用
  • 需要PDF预览功能的应用程序
  • 寻求快速PDF集成的团队
  • 开发时间有限的项目

使用建议

  • 有限的高级PDF编辑功能
  • 无内置的文本搜索或注释工具
  • 性能可能因大PDF文件而异
  • 依赖外部原生库进行渲染
  • 未针对高分辨率或复杂PDF进行优化

原始 README

以下为关联源码仓库的 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.

所属分类

依赖

依赖清单 3 项

源码仓库

使用此插件的项目

暂无相关数据。