# flutter_pdfview
Native PDF View for iOS and Android
[![xscode](https://img.shields.io/badge/Available%20on-xs%3Acode-blue?style=?style=plastic&logo=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAAlUlEQVR42uzXSwqAMAwE0Mn9L+3Ggtgkk35QwcnSJo9S+yGwM9DCooCbgn4YrJ4CIPUcQF7/XSBbx2TEz4sAZ2q1RAECBAiYBlCtvwN+KiYAlG7UDGj59MViT9hOwEqAhYCtAsUZvL6I6W8c2wcbd+LIWSCHSTeSAAECngN4xxIDSK9f4B9t377Wd7H5Nt7/Xz8eAgwAvesLRjYYPuUAAAAASUVORK5CYII=)](https://xscode.com/endigo/flutter_pdfview)
[![Latest compatibility result for Stable channel](https://img.shields.io/endpoint?url=https://pub.green/packages/flutter_pdfview/badge?channel=stable)](https://pub.green/packages/flutter_pdfview)
[![Latest compatibility result for Beta channel](https://img.shields.io/endpoint?url=https://pub.green/packages/flutter_pdfview/badge?channel=beta)](https://pub.green/packages/flutter_pdfview)
[![Latest compatibility result for Dev channel](https://img.shields.io/endpoint?url=https://pub.green/packages/flutter_pdfview/badge?channel=dev)](https://pub.green/packages/flutter_pdfview)
# Use this package as a library
## 1. Depend on it
Add this to your package's pubspec.yaml file:
```
dependencies:
flutter_pdfview: ^1.0.4
```
### 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 packages 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`.
```
# Info.plist
...
<key>io.flutter.embedded_views_preview</key>
<true/>
...
```
### 4. Import it
Now in your Dart code, you can use:
```
import 'package:flutter_pdfview/flutter_pdfview.dart';
```
## Options
| Name | Android | iOS | Default |
| :-------------------- | :-----: | :-: | :---------------: |
| defaultPage | ✅ | ✅ | `0` |
| onViewCreated | ✅ | ✅ | `null` |
| onRender | ✅ | ✅ | `null` |
| onPageChanged | ✅ | ✅ | `null` |
| onError | ✅ | ✅ | `null` |
| onPageError | ✅ | ❌ | `null` |
| onLinkHandle | ✅ | ✅ | `null` |
| gestureRecognizers | ✅ | ✅ | `null` |
| filePath | ✅ | ✅ | |
| pdfData | ✅ | ✅ | |
| fitPolicy | ✅ | ❌ | `FitPolicy.WIDTH` |
| enableSwipe | ✅ | ✅ | `true` |
| swipeHorizontal | ✅ | ✅ | `false` |
| password | ✅ | ✅ | `null` |
| nightMode | ✅ | ❌ | `false` |
| password | ✅ | ✅ | `null` |
| autoSpacing | ✅ | ✅ | `true` |
| pageFling | ✅ | ✅ | `true` |
| pageSnap | ✅ | ❌ | `true` |
| preventLinkNavigation | ✅ | ✅ | `false` |
## 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>` |
## Example
```dart
PDFView(
filePath: path,
enableSwipe: true,
swipeHorizontal: true,
autoSpacing: false,
pageFling: false,
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
[AndroidPdfViewer](https://github.com/barteksc/AndroidPdfViewer)
### iOS (only support> 11.0)
[PDFKit](https://developer.apple.com/documentation/pdfkit)
# Future plans
- Replace barteksc/AndroidPdfViewer with MuPDF or Android Native PDF Renderer.
- Improve documentation
- Support other platforms such as MacOS, Windows, Linux and Web
- Add search functionality
- Improve performance on zooming, page changing
- Improve image quality
- Write more test
# Support
<p align="center">
<a href="https://www.buymeacoffee.com/endigo" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/lato-blue.png" alt="Buy Me A Coffee" height=60 ></a>
</p>
<p align="center">
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=98DC9WJ8782WW&source=url" target="_blank">
<img height=60 src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" >
</a>
</p>
### Developer
- [endigo](https://github.com/endigo)
没有合适的资源?快使用搜索试试~ 我知道了~
flutter_pdfview:Flutter的PDF视图
共101个文件
png:23个
xml:6个
gradle:5个
需积分: 48 3 下载量 45 浏览量
2021-05-07
11:20:00
上传
评论
收藏 4.6MB ZIP 举报
温馨提示
flutter_pdfview 适用于iOS和Android的本机PDF视图 将此包用作库 1.依赖它 将此添加到包的pubspec.yaml文件中: dependencies: flutter_pdfview: ^1.0.4 2.安装 您可以从命令行安装软件包: 使用Flutter: $ flutter packages get 另外,您的编辑器可能支持pub get或flutter packages get 。 检查您的编辑器的文档以了解更多信息。 3.设定 的iOS 通过使用键io.flutter.embedded_views_preview和值YES向应用程序的Info.plist文件添加一个布尔属性,选择加入嵌入式视图预览。 # Info.plist ... <key>io.flutter.embedded_views_preview</key> <true>
资源详情
资源评论
资源推荐
收起资源包目录
flutter_pdfview:Flutter的PDF视图 (101个子文件)
.classpath 352B
.classpath 352B
flutter_pdfview.dart 9KB
main.dart 8KB
widget_test.dart 901B
flutter_pdfview_test.dart 518B
.gitignore 1KB
.gitignore 360B
.gitignore 97B
.gitignore 69B
.gitkeep 0B
build.gradle 2KB
build.gradle 710B
settings.gradle 484B
build.gradle 470B
settings.gradle 37B
FlutterPDFView.h 771B
PDFViewFlutterPlugin.h 95B
Runner-Bridging-Header.h 37B
flutter_pdfview.iml 1KB
FlutterPDFView.java 8KB
PDFLinkHandler.java 2KB
PDFViewFactory.java 811B
PDFViewFlutterPlugin.java 430B
MainActivity.java 157B
Contents.json 2KB
Contents.json 391B
.last_build_id 32B
LICENSE 1KB
pubspec.lock 5KB
pubspec.lock 3KB
Podfile.lock 1KB
FlutterPDFView.m 8KB
PDFViewFlutterPlugin.m 380B
README.md 5KB
CHANGELOG.md 3KB
README.md 584B
README.md 336B
.metadata 309B
.metadata 306B
project.pbxproj 22KB
demo-landscape.pdf 4.63MB
corrupted.pdf 953KB
demo.pdf 785KB
demo-link.pdf 54KB
Info.plist 2KB
AppFrameworkInfo.plist 773B
IDEWorkspaceChecks.plist 238B
Icon-App-1024x1024@1x.png 11KB
Icon-App-60x60@3x.png 4KB
Icon-App-83.5x83.5@2x.png 4KB
Icon-App-76x76@2x.png 3KB
Icon-App-60x60@2x.png 3KB
Icon-App-40x40@3x.png 3KB
Icon-App-29x29@3x.png 2KB
Icon-App-40x40@2x.png 2KB
Icon-App-76x76@1x.png 2KB
Icon-App-29x29@2x.png 2KB
Icon-App-20x20@3x.png 2KB
ic_launcher.png 1KB
Icon-App-20x20@2x.png 1KB
Icon-App-40x40@1x.png 1KB
ic_launcher.png 1KB
Icon-App-29x29@1x.png 1KB
ic_launcher.png 721B
Icon-App-20x20@1x.png 564B
ic_launcher.png 544B
ic_launcher.png 442B
LaunchImage.png 68B
LaunchImage@2x.png 68B
LaunchImage@3x.png 68B
Podfile 3KB
flutter_pdfview.podspec 999B
Flutter.podspec 758B
org.eclipse.buildship.core.prefs 317B
org.eclipse.buildship.core.prefs 56B
org.eclipse.buildship.core.prefs 54B
proguard-rules.pro 28B
.project 615B
.project 591B
.project 433B
gradle-wrapper.properties 234B
gradle.properties 104B
gradle.properties 29B
flutter_export_environment.sh 553B
LaunchScreen.storyboard 2KB
Main.storyboard 2KB
AppDelegate.swift 403B
Release.xcconfig 108B
Debug.xcconfig 106B
Runner.xcscheme 3KB
contents.xcworkspacedata 224B
contents.xcworkspacedata 152B
AndroidManifest.xml 2KB
launch_background.xml 434B
styles.xml 361B
AndroidManifest.xml 343B
AndroidManifest.xml 343B
AndroidManifest.xml 127B
pubspec.yaml 2KB
共 101 条
- 1
- 2
ZackRen
- 粉丝: 28
- 资源: 4624
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (175601006)51单片机交通信号灯系统设计
- Starter SINAMICS S120驱动第三方直线永磁同步电机系列视频-调试演示.mp4
- (174755032)抽烟、烟雾检测voc数据集
- 基于滑膜控制的差动制动防侧翻稳定性控制,上层通过滑膜控制产生期望的横摆力矩,下层根据对应的paper实现对应的制动力矩分配,实现车辆的防侧翻稳定性控制,通过通过carsim和simulink联合仿真
- 伺服系统基于陷波滤波器双惯量伺服系统机械谐振抑制matlab Simulink仿真 1.模型简介 模型为基于陷波滤波器的双惯量伺服系统机械谐振抑制仿真,采用Matlab R2018a Simul
- (175989002)DDR4 JESD79-4C.pdf
- lanchaoHunanHoutaiQiantai
- (177377030)Python 爬虫.zip
- (177537818)python爬虫基础知识及爬虫实例.zip
- 自动驾驶横纵向耦合控制-复现Apollo横纵向控制 基于动力学误差模型,使用mpc算法,一个控制器同时控制横向和纵向,实现横纵向耦合控制 matlab与simulink联合仿真,纵向控制已经做好油门刹
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0