Maui Blazor 中文社区 QQ群:645660665

Blazor组件自做十二 : Blazor Pdf Reader PDF阅读器 组件 (新版 7.1 移除pdfobject)

Blazor Pdf Reader PDF阅读器 组件

QQ截图20221218143438

示例:

https://www.blazor.zone/PdfReaders

https://blazor.app1.es/pdfReaders

使用方法:

1.nuget包

BootstrapBlazor.PdfReader

2._Imports.razor 文件 或者页面添加 添加组件库引用

@using BootstrapBlazor.Components

3.razor页面

<PdfReader Filename="https://densen.es/test/webdev/pdf/sample.pdf" />
           
<PdfReader UrlBase="https://blazor.app1.es/"
           Filename="_content/DemoShared/sample.pdf" />

<pre>流化方式,可跨域</pre>
<PdfReader UrlBase="https://blazor.app1.es/"
           Filename="_content/DemoShared/sample.pdf" 
           StreamMode="true"/> 

4.参数说明

** 7.1 移除pdfobject, 一些参数也被移除,请注意更改 **

参数 说明 默认值 旧版名称
Stream 用于渲染的文件流,为空则用URL参数读取文件 PdfStream
Filename PDF文件URL null
StreamMode 使用流化模式,可跨域读取文件 false EnableStreamingMode
UrlBase PDF文件基础路径, (使用流化模式才需要设置), https://xx.com
Width 宽 单位(px/%) 100%
Height 高 单位(px/%) 500px
Page 页码 1
Navpanes 显示导航窗格 1
Toolbar 显示工具栏 1
Statusbar 显示状态栏 1
View *视图模式 FitV
Pagemode *页面模式 thumbs
Search *查询字符串
ViewerBase 浏览器页面路径 内置 PDFJS_URL
移除参数
Func<string, Task>? OnInfo
Func<string, Task>? OnError
ForceIframe
ForcePDFJS

开源地址

https://github.com/densen2014/BootstrapBlazor.PdfReader


Blazor 组件

条码扫描 ZXingBlazor
nuget
stats

图片浏览器 Viewer

条码扫描 BarcodeScanner

手写签名 Handwritten

手写签名 SignaturePad

定位/持续定位 Geolocation

屏幕键盘 OnScreenKeyboard

百度地图 BaiduMap

谷歌地图 GoogleMap

蓝牙和打印 Bluetooth

PDF阅读器 PdfReader

文件系统访问 FileSystem

光学字符识别 OCR

电池信息/网络信息 WebAPI

视频播放器 VideoPlayer

AlexChow

今日头条 | 博客园 | 知乎 | Gitee | GitHub

posted @ 2022-12-18 21:41  AlexChow  阅读(356)  评论(0编辑  收藏  举报