Blazor组件自做十四 : Blazor FileViewer 文件预览 组件

38 篇文章 10 订阅
30 篇文章 4 订阅

Blazor FileViewer 文件预览 组件

目前支支持 Excel(.docx) 和 Word(.xlsx) 格式

示例:

https://www.blazor.zone/fileViewers

https://blazor.app1.es/fileViewers

使用方法:

1.nuget包

BootstrapBlazor.FileViewer

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

@using BootstrapBlazor.Components

3.razor页面

<FileViewer Filename="c:/DemoShared/sample.xlsx" />

<FileViewer Filename="c:/DemoShared/sample.docx" />

<FileViewer Filename="https://localhost:5011/_content/DemoShared/sample.xlsx" />

<FileViewer Filename="https://localhost:5011/_content/DemoShared/sample.docx" />

<FileViewer @ref="fileViewer" Filename=@Url />

@code{
    private string Url { get; set; } = ("c:/sample.docx");

    private async Task Apply()
    {
        await fileViewer.Reload(Url);
    }
}

4.参数说明

参数说明默认值
FilenameExcel/Word 文件路径或者URL
Width宽度100%
Height高度700px
StyleString组件外观 Css Style
Html设置 Html 直接渲染
Stream用于渲染的文件流,为空则用Filename参数读取文件null
IsExcel文件流模式需要指定是否 Excel. 默认为 false
Reload(string filename)重新载入文件方法
Refresh()刷新方法

Blazor 组件

条码扫描 ZXingBlazor
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-pLmJ3MJD-1671758541927)(null)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-mz6gu9yU-1671758542315)(null)]

图片浏览器 Viewer

条码扫描 BarcodeScanner

手写签名 Handwritten

手写签名 SignaturePad

定位/持续定位 Geolocation

屏幕键盘 OnScreenKeyboard

百度地图 BaiduMap

谷歌地图 GoogleMap

蓝牙和打印 Bluetooth

PDF阅读器 PdfReader

文件系统访问 FileSystem

光学字符识别 OCR

电池信息/网络信息 WebAPI

视频播放器 VideoPlayer

文件预览 FileViewer

AlexChow

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Densen2014

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值