Skip to content

Commit e160cd8

Browse files
authored
feat(PdfViewer): add ShowToolbar parameter (#7594)
* feat(PdfViewer): add ShowToolbar parameter * chore: 更新依赖
1 parent 6831db0 commit e160cd8

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<PackageReference Include="BootstrapBlazor.OnScreenKeyboard" Version="10.0.0" />
6666
<PackageReference Include="BootstrapBlazor.OpcDa" Version="10.0.0" />
6767
<PackageReference Include="BootstrapBlazor.PdfReader" Version="10.0.26" />
68-
<PackageReference Include="BootstrapBlazor.PdfViewer" Version="10.0.0" />
68+
<PackageReference Include="BootstrapBlazor.PdfViewer" Version="10.0.1" />
6969
<PackageReference Include="BootstrapBlazor.Player" Version="10.0.1" />
7070
<PackageReference Include="BootstrapBlazor.RDKit" Version="10.0.0" />
7171
<PackageReference Include="BootstrapBlazor.Region" Version="10.0.1" />

src/BootstrapBlazor.Server/Components/Samples/PdfViewers.razor

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@
2929
</Select>
3030
</BootstrapInputGroup>
3131
</div>
32+
<div class="col-12 col-sm-6">
33+
<BootstrapInputGroup>
34+
<BootstrapInputGroupLabel>ShowToolbar</BootstrapInputGroupLabel>
35+
<Switch @bind-Value="_showToolbar"></Switch>
36+
</BootstrapInputGroup>
37+
</div>
3238
</div>
3339
</section>
34-
<PdfViewer Url="./samples/sample.pdf" Height="620px" PageIndex="@_pageIndex"
35-
NotSupportCallback="NotSupportCallback" OnLoaded="OnLoaded"
40+
<PdfViewer Url="./samples/sample.pdf#toolbar=0&navpanes=0" Height="620px" PageIndex="@_pageIndex"
41+
NotSupportCallback="NotSupportCallback" OnLoaded="OnLoaded" ShowToolbar="_showToolbar"
3642
UseGoogleDocs="@_useGoogleDocs"></PdfViewer>
3743
</DemoBlock>
3844

src/BootstrapBlazor.Server/Components/Samples/PdfViewers.razor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -17,6 +17,8 @@ public partial class PdfViewers
1717

1818
private int _pageIndex = 1;
1919

20+
private bool _showToolbar = true;
21+
2022
private Task OnLoaded() => ToastService.Success("Pdf Viewer", Localizer["PdfViewerToastSuccessfulContent"]);
2123

2224
private Task NotSupportCallback() => ToastService.Error("PdfViewer", Localizer["PdfViewerToastNotSupportContent"]);

0 commit comments

Comments
 (0)