From 52c8cea9339b9e58140765ca89f92dea3332d715 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 29 Nov 2025 12:58:41 +0800 Subject: [PATCH 1/3] feat(PdfReader): add localization support --- .../BootstrapBlazor.PdfReader/Locales/en.json | 17 +++++- .../BootstrapBlazor.PdfReader/Locales/zh.json | 17 +++++- .../BootstrapBlazor.PdfReader/PdfReader.razor | 52 +++++++++---------- 3 files changed, 58 insertions(+), 28 deletions(-) diff --git a/src/components/BootstrapBlazor.PdfReader/Locales/en.json b/src/components/BootstrapBlazor.PdfReader/Locales/en.json index da66418c..0fb9e593 100644 --- a/src/components/BootstrapBlazor.PdfReader/Locales/en.json +++ b/src/components/BootstrapBlazor.PdfReader/Locales/en.json @@ -13,6 +13,21 @@ "TwoPageView": "Two pages on view", "PresentationMode": "Presentation mode", "DocumentProperty": "Document properties", - "CloseButtonText": "Close" + "CloseButtonText": "Close", + "DocumentProperties": "Document properties", + "DocumentFileName": "File name:", + "DocumentFileSize": "File size:", + "DocumentTitle": "Title:", + "DocumentAuthor": "Author:", + "DocumentSubject": "Subject:", + "DocumentKeywords": "Keywords:", + "DocumentCreationDate": "Created:", + "DocumentModificationDate": "Modified:", + "DocumentApplication": "Application:", + "DocumentProducer": "PDF producer:", + "DocumentVersion": "PDF version:", + "DocumentPageCount": "Page count:", + "DocumentPageSize": "Page size:", + "DocumentFastWebView": "Fast web view:" } } diff --git a/src/components/BootstrapBlazor.PdfReader/Locales/zh.json b/src/components/BootstrapBlazor.PdfReader/Locales/zh.json index d2b90f80..8b2049e0 100644 --- a/src/components/BootstrapBlazor.PdfReader/Locales/zh.json +++ b/src/components/BootstrapBlazor.PdfReader/Locales/zh.json @@ -13,6 +13,21 @@ "TwoPageView": "双页视图", "PresentationMode": "演示模式", "DocumentProperty": "文档属性", - "CloseButtonText": "关闭" + "CloseButtonText": "关闭", + "DocumentProperties": "文档属性", + "DocumentFileName": "文件名:", + "DocumentFileSize": "文件大小:", + "DocumentTitle": "标题:", + "DocumentAuthor": "作者:", + "DocumentSubject": "主题:", + "DocumentKeywords": "关键字:", + "DocumentCreationDate": "创建时间:", + "DocumentModificationDate": "修改时间:", + "DocumentApplication": "应用程序:", + "DocumentProducer": "PDF 生成器:", + "DocumentVersion": "PDF 版本:", + "DocumentPageCount": "页数:", + "DocumentPageSize": "页面尺寸:", + "DocumentFastWebView": "Fast web view:" } } diff --git a/src/components/BootstrapBlazor.PdfReader/PdfReader.razor b/src/components/BootstrapBlazor.PdfReader/PdfReader.razor index 268b3657..509d7c3a 100644 --- a/src/components/BootstrapBlazor.PdfReader/PdfReader.razor +++ b/src/components/BootstrapBlazor.PdfReader/PdfReader.razor @@ -101,70 +101,70 @@
-
Document properties
+
@Localizer["DocumentProperties"]
-
File name:
+
@Localizer["DocumentFileName"]
-
File size:
+
@Localizer["DocumentFileSize"]
-
Title:
-
+
@Localizer["DocumentTitle"]
+
-
-
Author:
-
+
@Localizer["DocumentAuthor"]
+
-
-
Subject:
-
+
@Localizer["DocumentSubject"]
+
-
-
Keywords:
-
+
@Localizer["DocumentKeywords"]
+
-
-
Created:
-
+
@Localizer["DocumentCreationDate"]
+
-
-
Modified:
-
+
@Localizer["DocumentModificationDate"]
+
-
-
Application:
-
+
@Localizer["DocumentApplication"]
+
-
-
PDF producer:
-
+
@Localizer["DocumentProducer"]
+
-
-
PDF version:
-
+
@Localizer["DocumentVersion"]
+
-
-
Page count:
-
+
@Localizer["DocumentPageCount"]
+
-
-
Page size:
-
+
@Localizer["DocumentPageSize"]
+
-
-
Fast web view:
+
@Localizer["DocumentFastWebView"]
No
From f69716e292908922d719fb643971469156670197 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 29 Nov 2025 12:59:05 +0800 Subject: [PATCH 2/3] chore: bump version 10.0.8 --- .../BootstrapBlazor.PdfReader/BootstrapBlazor.PdfReader.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.PdfReader/BootstrapBlazor.PdfReader.csproj b/src/components/BootstrapBlazor.PdfReader/BootstrapBlazor.PdfReader.csproj index d7c1e685..0e5bd517 100644 --- a/src/components/BootstrapBlazor.PdfReader/BootstrapBlazor.PdfReader.csproj +++ b/src/components/BootstrapBlazor.PdfReader/BootstrapBlazor.PdfReader.csproj @@ -1,7 +1,7 @@  - 10.0.7 + 10.0.8 From 9f071530489741810327a287b57706a4b76ba420 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 29 Nov 2025 13:02:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=80=82=E9=85=8D=E6=A8=A1=E5=BC=8F=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PdfReader.razor.cs | 7 ++++++ .../PdfReaderFitMode.cs | 24 +++++-------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/components/BootstrapBlazor.PdfReader/PdfReader.razor.cs b/src/components/BootstrapBlazor.PdfReader/PdfReader.razor.cs index 8e6b4940..df42c884 100644 --- a/src/components/BootstrapBlazor.PdfReader/PdfReader.razor.cs +++ b/src/components/BootstrapBlazor.PdfReader/PdfReader.razor.cs @@ -141,6 +141,7 @@ public partial class PdfReader private string? _dropdownItemDefaultIcon; private bool _enableThumbnails = true; private bool _showToolbar = true; + private PdfReaderFitMode _fitMode; /// /// @@ -175,6 +176,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) _currentPage = CurrentPage; _enableThumbnails = EnableThumbnails; _showToolbar = ShowToolbar; + _fitMode = FitMode; } if (_url != Url) @@ -203,6 +205,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender) await InvokeVoidAsync("resetThumbnails", Id); } } + if (_fitMode != FitMode) + { + _fitMode = FitMode; + await SetFitMode(_fitMode); + } } /// diff --git a/src/components/BootstrapBlazor.PdfReader/PdfReaderFitMode.cs b/src/components/BootstrapBlazor.PdfReader/PdfReaderFitMode.cs index 6bf38ae2..5f5a0fb9 100644 --- a/src/components/BootstrapBlazor.PdfReader/PdfReaderFitMode.cs +++ b/src/components/BootstrapBlazor.PdfReader/PdfReaderFitMode.cs @@ -11,12 +11,6 @@ namespace BootstrapBlazor.Components; /// public enum PdfReaderFitMode { - /// - /// 页面宽度 - /// - [Description("page-width")] - PageWidth, - /// /// 实际大小 /// @@ -24,20 +18,14 @@ public enum PdfReaderFitMode PageActual, /// - /// 页面高度 - /// - [Description("page-height")] - PageHeight, - - /// - /// 自适应宽高 + /// 页面宽度 /// - [Description("page-fit")] - PageFit, + [Description("page-width")] + PageWidth, /// - /// 自动 + /// 页面高度 /// - [Description("auto")] - Auto + [Description("page-height")] + PageHeight }