BootstrapBlazor.FileViewer
8.0.3-beta1
Prefix Reserved
See the version list below for details.
dotnet add package BootstrapBlazor.FileViewer --version 8.0.3-beta1
NuGet\Install-Package BootstrapBlazor.FileViewer -Version 8.0.3-beta1
<PackageReference Include="BootstrapBlazor.FileViewer" Version="8.0.3-beta1" />
paket add BootstrapBlazor.FileViewer --version 8.0.3-beta1
#r "nuget: BootstrapBlazor.FileViewer, 8.0.3-beta1"
// Install BootstrapBlazor.FileViewer as a Cake Addin #addin nuget:?package=BootstrapBlazor.FileViewer&version=8.0.3-beta1&prerelease // Install BootstrapBlazor.FileViewer as a Cake Tool #tool nuget:?package=BootstrapBlazor.FileViewer&version=8.0.3-beta1&prerelease
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.参数说明
参数 | 说明 | 默认值 |
---|---|---|
Filename | Excel/Word 文件路径或者URL | |
Width | 宽度 | 100% |
Height | 高度 | 700px |
StyleString | 组件外观 Css Style | |
Html | 设置 Html 直接渲染 | |
Stream | 用于渲染的文件流,为空则用Filename参数读取文件 | null |
IsExcel | 文件流模式需要指定是否 Excel | false |
NodataString | 无数据提示文本 | 无数据 |
LoadingString | 载入中提示文本 | 载入中... |
Reload(string filename) | 重新载入文件方法 | |
Reload(Stream stream) | 重新载入流方法 | |
Refresh() | 刷新方法 |
5.特别说明
如果在 Linux 下使用需要安装 libgdiplus 并开启 System.Drawing support.
相关错误提示: The type initializer for 'Gdip' threw an exception.
Enable System.Drawing support for non-Windows platforms: (reference):
In your project file (*.csproj), add:
<ItemGroup>
<RuntimeHostConfigurationOption Include="System.Drawing.EnableUnixSupport" Value="true" />
</ItemGroup>
更新历史
v8.0.2
- 修复 依赖包日期格式转换错误
- 修复 组件依赖
v7.0.2
- 修复 预览表格时间转换错误
v7.0.3
- 添加 Reload(Stream stream) : 重新载入流方法
- 修复 Reload(string filename) 不清空 Stream
Blazor 组件
AlexChow
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- ce.office.extension (>= 2.0.0)
- Microsoft.AspNetCore.Components.Web (>= 6.0.0)
- NPOI (>= 2.5.6)
-
net7.0
- ce.office.extension (>= 2.0.0)
- Microsoft.AspNetCore.Components.Web (>= 7.0.0)
- NPOI (>= 2.5.6)
-
net8.0
- ce.office.extension (>= 2.0.0)
- Microsoft.AspNetCore.Components.Web (>= 8.0.0)
- NPOI (>= 2.5.6)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on BootstrapBlazor.FileViewer:
Package | Downloads |
---|---|
BlazorShared
BlazorMaui , 整合Blazor,BootstrapBlazor UI组件库,Maui的共享跨平台工程示例共享库 |
|
BootstrapBlazor.Densen.All
Blazor 组件懒人包 |
|
BootstrapBlazor.Shared
Package Description |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on BootstrapBlazor.FileViewer:
Repository | Stars |
---|---|
dotnetcore/BootstrapBlazor
Bootstrap Blazor is an enterprise-level UI component library based on Bootstrap and Blazor.
|
|
densen2014/BlazorMaui
用 c # 和 Razor 创建本机移动应用和桌面应用。使用 Blazor.BB.Maui,可以快速开发共享代码库运行于 Windows (Winforms/WPF/UWP)、Android、iOS、macOS 的应用。
|
Version | Downloads | Last updated |
---|---|---|
9.0.0 | 0 | 11/13/2024 |
9.0.0-beta02 | 67 | 11/7/2024 |
9.0.0-beta01 | 97 | 11/1/2024 |
8.3.0 | 416 | 10/16/2024 |
8.1.1 | 221 | 10/10/2024 |
8.1.0 | 430 | 9/21/2024 |
8.0.3 | 2,026 | 5/21/2024 |
8.0.3-NPOI256 | 91 | 5/21/2024 |
8.0.3-beta2 | 96 | 5/21/2024 |
8.0.3-beta1 | 98 | 5/21/2024 |
8.0.1 | 1,831 | 12/9/2023 |
8.0.0 | 622 | 11/15/2023 |
7.0.3 | 5,049 | 2/17/2023 |
7.0.2 | 264 | 2/17/2023 |
7.0.1 | 1,574 | 12/23/2022 |
7.0.0 | 317 | 12/23/2022 |
1.0.0 | 366 | 12/23/2022 |