Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<PackageReference Include="BootstrapBlazor.OnScreenKeyboard" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.OpcDa" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.PdfReader" Version="10.0.26" />
<PackageReference Include="BootstrapBlazor.PdfViewer" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.PdfViewer" Version="10.0.1" />
<PackageReference Include="BootstrapBlazor.Player" Version="10.0.1" />
<PackageReference Include="BootstrapBlazor.RDKit" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.Region" Version="10.0.1" />
Expand Down
10 changes: 8 additions & 2 deletions src/BootstrapBlazor.Server/Components/Samples/PdfViewers.razor
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@
</Select>
</BootstrapInputGroup>
</div>
<div class="col-12 col-sm-6">
<BootstrapInputGroup>
<BootstrapInputGroupLabel>ShowToolbar</BootstrapInputGroupLabel>
<Switch @bind-Value="_showToolbar"></Switch>
</BootstrapInputGroup>
</div>
</div>
</section>
<PdfViewer Url="./samples/sample.pdf" Height="620px" PageIndex="@_pageIndex"
NotSupportCallback="NotSupportCallback" OnLoaded="OnLoaded"
<PdfViewer Url="./samples/sample.pdf#toolbar=0&navpanes=0" Height="620px" PageIndex="@_pageIndex"
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Url is now hardcoded with #toolbar=0&navpanes=0, which will force the browser PDF plugin to hide the toolbar regardless of the new ShowToolbar parameter. This makes the toggle ineffective and can also conflict with PdfViewer’s own URL handling. Consider keeping Url as the raw PDF path and let ShowToolbar control toolbar visibility (or dynamically append/remove the fragment based on _showToolbar).

Suggested change
<PdfViewer Url="./samples/sample.pdf#toolbar=0&navpanes=0" Height="620px" PageIndex="@_pageIndex"
<PdfViewer Url="./samples/sample.pdf" Height="620px" PageIndex="@_pageIndex"

Copilot uses AI. Check for mistakes.
NotSupportCallback="NotSupportCallback" OnLoaded="OnLoaded" ShowToolbar="_showToolbar"
UseGoogleDocs="@_useGoogleDocs"></PdfViewer>
</DemoBlock>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
Expand All @@ -17,6 +17,8 @@ public partial class PdfViewers

private int _pageIndex = 1;
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field '_pageIndex' can be 'readonly'.

Suggested change
private int _pageIndex = 1;
private readonly int _pageIndex = 1;

Copilot uses AI. Check for mistakes.

private bool _showToolbar = true;
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field '_showToolbar' can be 'readonly'.

Suggested change
private bool _showToolbar = true;
private readonly bool _showToolbar = true;

Copilot uses AI. Check for mistakes.

private Task OnLoaded() => ToastService.Success("Pdf Viewer", Localizer["PdfViewerToastSuccessfulContent"]);

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