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 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
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 }