Skip to content

Commit 7f707cb

Browse files
committed
feat: 增加 PageIndex 参数
1 parent f25fd3d commit 7f707cb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/components/BootstrapBlazor.PdfViewer/PdfViewer.razor.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ public partial class PdfViewer
1717
[Parameter]
1818
public string? Url { get; set; }
1919

20+
/// <summary>
21+
/// Gets or sets the page index of the PDF file.
22+
/// </summary>
23+
[Parameter]
24+
public int PageIndex { get; set; }
25+
2026
/// <summary>
2127
/// Gets or sets the viewer height. Default is null.
2228
/// </summary>
@@ -108,7 +114,7 @@ private string GetAbsoluteUri(string? url)
108114
url ??= string.Empty;
109115
if (string.IsNullOrEmpty(url) || !UseGoogleDocs)
110116
{
111-
return url;
117+
return $"{url}#page={PageIndex}";
112118
}
113119
var uri = NavigationManager.ToAbsoluteUri(url);
114120
return uri.AbsoluteUri;

0 commit comments

Comments
 (0)