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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>10.0.7</Version>
<Version>10.0.8</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
17 changes: 16 additions & 1 deletion src/components/BootstrapBlazor.PdfReader/Locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@
"TwoPageView": "Two pages on view",
"PresentationMode": "Presentation mode",
"DocumentProperty": "Document properties",
"CloseButtonText": "Close"
"CloseButtonText": "Close",
"DocumentProperties": "Document properties",
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

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

The key 'DocumentProperties' has the same value as the existing 'DocumentProperty' key (line 15). This creates duplicate localization entries with identical values. Consider removing the duplicate 'DocumentProperties' entry and using 'DocumentProperty' consistently, or clarify if they serve different purposes.

Suggested change
"DocumentProperties": "Document properties",

Copilot uses AI. Check for mistakes.
"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:"
}
}
17 changes: 16 additions & 1 deletion src/components/BootstrapBlazor.PdfReader/Locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@
"TwoPageView": "双页视图",
"PresentationMode": "演示模式",
"DocumentProperty": "文档属性",
"CloseButtonText": "关闭"
"CloseButtonText": "关闭",
"DocumentProperties": "文档属性",
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

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

The key 'DocumentProperties' has the same value as the existing 'DocumentProperty' key (line 15). This creates duplicate localization entries with identical values. Consider removing the duplicate 'DocumentProperties' entry and using 'DocumentProperty' consistently, or clarify if they serve different purposes.

Suggested change
"DocumentProperties": "文档属性",

Copilot uses AI. Check for mistakes.
"DocumentFileName": "文件名:",
"DocumentFileSize": "文件大小:",
"DocumentTitle": "标题:",
"DocumentAuthor": "作者:",
"DocumentSubject": "主题:",
"DocumentKeywords": "关键字:",
"DocumentCreationDate": "创建时间:",
"DocumentModificationDate": "修改时间:",
"DocumentApplication": "应用程序:",
"DocumentProducer": "PDF 生成器:",
"DocumentVersion": "PDF 版本:",
"DocumentPageCount": "页数:",
"DocumentPageSize": "页面尺寸:",
"DocumentFastWebView": "Fast web view:"
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

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

The 'DocumentFastWebView' localization value in the Chinese (zh.json) file is not translated and remains in English. It should be translated to Chinese for consistency. Consider translating to something like '快速网页浏览:' or '快速 Web 视图:' to match the localization pattern used for other fields.

Suggested change
"DocumentFastWebView": "Fast web view:"
"DocumentFastWebView": "快速网页浏览:"

Copilot uses AI. Check for mistakes.
}
}
52 changes: 26 additions & 26 deletions src/components/BootstrapBlazor.PdfReader/PdfReader.razor
Original file line number Diff line number Diff line change
Expand Up @@ -101,70 +101,70 @@
<div class="bb-view-pdf-info">
<div class="bb-view-pdf-backdrop"></div>
<div class="bb-view-pdf-dialog">
<div class="bb-view-pdf-dialog-title mb-3">Document properties</div>
<div class="bb-view-pdf-dialog-title mb-3">@Localizer["DocumentProperties"]</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">File name:</div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentFileName"]</div>
<div class="bb-view-pdf-dialog-filename"></div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">File size:</div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentFileSize"]</div>
<div class="bb-view-pdf-dialog-filesize"></div>
</div>
<div class="divider">
<div class="divider-mask"></div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">Title:</div>
<div class="bb-view-pdf-dialog-title"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentTitle"]</div>
<div class="bb-view-pdf-dialog-title">-</div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">Author:</div>
<div class="bb-view-pdf-dialog-author"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentAuthor"]</div>
<div class="bb-view-pdf-dialog-author">-</div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">Subject:</div>
<div class="bb-view-pdf-dialog-subject"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentSubject"]</div>
<div class="bb-view-pdf-dialog-subject">-</div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">Keywords:</div>
<div class="bb-view-pdf-dialog-keywords"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentKeywords"]</div>
<div class="bb-view-pdf-dialog-keywords">-</div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">Created:</div>
<div class="bb-view-pdf-dialog-created"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentCreationDate"]</div>
<div class="bb-view-pdf-dialog-created">-</div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">Modified:</div>
<div class="bb-view-pdf-dialog-modified"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentModificationDate"]</div>
<div class="bb-view-pdf-dialog-modified">-</div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">Application:</div>
<div class="bb-view-pdf-dialog-application"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentApplication"]</div>
<div class="bb-view-pdf-dialog-application">-</div>
</div>
<div class="divider">
<div class="divider-mask"></div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">PDF producer:</div>
<div class="bb-view-pdf-dialog-producer"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentProducer"]</div>
<div class="bb-view-pdf-dialog-producer">-</div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">PDF version:</div>
<div class="bb-view-pdf-dialog-version"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentVersion"]</div>
<div class="bb-view-pdf-dialog-version">-</div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">Page count:</div>
<div class="bb-view-pdf-dialog-count"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentPageCount"]</div>
<div class="bb-view-pdf-dialog-count">-</div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">Page size:</div>
<div class="bb-view-pdf-dialog-size"></div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentPageSize"]</div>
<div class="bb-view-pdf-dialog-size">-</div>
</div>
<div class="divider">
<div class="divider-mask"></div>
</div>
<div class="bb-view-pdf-dialog-item">
<div class="bb-view-pdf-dialog-label">Fast web view:</div>
<div class="bb-view-pdf-dialog-label">@Localizer["DocumentFastWebView"]</div>
<div class="bb-view-pdf-dialog-webview">No</div>
</div>
<div class="bb-view-pdf-dialog-close">
Expand Down
7 changes: 7 additions & 0 deletions src/components/BootstrapBlazor.PdfReader/PdfReader.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public partial class PdfReader
private string? _dropdownItemDefaultIcon;
private bool _enableThumbnails = true;
private bool _showToolbar = true;
private PdfReaderFitMode _fitMode;

/// <summary>
/// <inheritdoc/>
Expand Down Expand Up @@ -175,6 +176,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
_currentPage = CurrentPage;
_enableThumbnails = EnableThumbnails;
_showToolbar = ShowToolbar;
_fitMode = FitMode;
}

if (_url != Url)
Expand Down Expand Up @@ -203,6 +205,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
await InvokeVoidAsync("resetThumbnails", Id);
}
}
if (_fitMode != FitMode)
{
_fitMode = FitMode;
await SetFitMode(_fitMode);
}
}

/// <summary>
Expand Down
24 changes: 6 additions & 18 deletions src/components/BootstrapBlazor.PdfReader/PdfReaderFitMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,21 @@ namespace BootstrapBlazor.Components;
/// </summary>
public enum PdfReaderFitMode
{
/// <summary>
/// 页面宽度
/// </summary>
[Description("page-width")]
PageWidth,

/// <summary>
/// 实际大小
/// </summary>
[Description("page-actual")]
PageActual,

/// <summary>
/// 页面高度
/// </summary>
[Description("page-height")]
PageHeight,

/// <summary>
/// 自适应宽高
/// 页面宽度
/// </summary>
[Description("page-fit")]
PageFit,
[Description("page-width")]
PageWidth,

/// <summary>
/// 自动
/// 页面高度
/// </summary>
[Description("auto")]
Auto
[Description("page-height")]
PageHeight
}
Loading