From b8f34e1a47c3614328e3bc7c830b369aba4fc019 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 18 Oct 2026 14:29:49 +0800 Subject: [PATCH 1/2] fix(PdfViewer): fingerprint CSS asset Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../BootstrapBlazor.PdfViewer/PdfViewer.razor.cs | 10 +++++++++- .../BootstrapBlazor.PdfViewer/PdfViewer.razor.js | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/BootstrapBlazor.PdfViewer/PdfViewer.razor.cs b/src/components/BootstrapBlazor.PdfViewer/PdfViewer.razor.cs index daf81dd0d..6aa538a9e 100644 --- a/src/components/BootstrapBlazor.PdfViewer/PdfViewer.razor.cs +++ b/src/components/BootstrapBlazor.PdfViewer/PdfViewer.razor.cs @@ -12,6 +12,14 @@ namespace BootstrapBlazor.Components; /// public partial class PdfViewer { + private const string StylePath = "_content/BootstrapBlazor.PdfViewer/pdf-viewer.css"; + +#if NET9_0_OR_GREATER + private string StyleUrl => Assets[StylePath]; +#else + private static string StyleUrl => StylePath; +#endif + /// /// 获得/设置 文档 Url 属性 /// Gets or sets the url for the PDF file to be displayed @@ -96,7 +104,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) LoadedCallaback = nameof(TriggerOnLoaded), NotSupportCallback = nameof(TriggerNotSupportCallback), Url = GetAbsoluteUri(Url) - }); + }, StyleUrl); private string GetAbsoluteUri(string? url) { diff --git a/src/components/BootstrapBlazor.PdfViewer/PdfViewer.razor.js b/src/components/BootstrapBlazor.PdfViewer/PdfViewer.razor.js index 85d4def62..44cb498fc 100644 --- a/src/components/BootstrapBlazor.PdfViewer/PdfViewer.razor.js +++ b/src/components/BootstrapBlazor.PdfViewer/PdfViewer.razor.js @@ -1,8 +1,8 @@ import { addLink } from "../BootstrapBlazor/modules/utility.js" import Data from "../BootstrapBlazor/modules/data.js" -export async function init(id, invoke, options) { - await addLink("./_content/BootstrapBlazor.PdfViewer/pdf-viewer.css"); +export async function init(id, invoke, options, styleUrl) { + await addLink(styleUrl) const el = document.getElementById(id); const pdfViewer = { el, invoke, options }; From 4515afe0f83317a50c3238a582e904a4281eb7a0 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 21 Oct 2026 09:22:16 +0800 Subject: [PATCH 2/2] chore: bump version 11.0.0-rc.2.1 --- .../BootstrapBlazor.PdfViewer/BootstrapBlazor.PdfViewer.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/BootstrapBlazor.PdfViewer/BootstrapBlazor.PdfViewer.csproj b/src/components/BootstrapBlazor.PdfViewer/BootstrapBlazor.PdfViewer.csproj index 0da1b6d96..9ee3b2e8e 100644 --- a/src/components/BootstrapBlazor.PdfViewer/BootstrapBlazor.PdfViewer.csproj +++ b/src/components/BootstrapBlazor.PdfViewer/BootstrapBlazor.PdfViewer.csproj @@ -1,5 +1,8 @@ + + 11.0.0-rc.2.1 + Bootstrap Blazor WebAssembly wasm UI Components Pdf Viewer