Skip to content

Commit f6e7d97

Browse files
authored
doc(EmbedPDF): add documentation (#7515)
* doc: 更新文档 * chore: bump version 10.0.0-beta04
1 parent 6ecdd4e commit f6e7d97

3 files changed

Lines changed: 19 additions & 21 deletions

File tree

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<PackageReference Include="BootstrapBlazor.Dom2Image" Version="10.0.1" />
3939
<PackageReference Include="BootstrapBlazor.DriverJs" Version="10.0.1" />
4040
<PackageReference Include="BootstrapBlazor.ElementIcon" Version="10.0.0" />
41-
<PackageReference Include="BootstrapBlazor.EmbedPDF" Version="10.0.0-beta02" />
41+
<PackageReference Include="BootstrapBlazor.EmbedPDF" Version="10.0.0-beta04" />
4242
<PackageReference Include="BootstrapBlazor.FileViewer" Version="10.0.0" />
4343
<PackageReference Include="BootstrapBlazor.FluentSystemIcon" Version="10.0.0" />
4444
<PackageReference Include="BootstrapBlazor.FontAwesome" Version="10.0.0" />

src/BootstrapBlazor.Server/Components/Samples/EmbedPdfs.razor

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,30 @@
1717
<div class="row form-inline g-3">
1818
<div class="col-12 col-sm-6">
1919
<BootstrapInputGroup>
20-
<BootstrapInputGroupLabel>TabBarMode</BootstrapInputGroupLabel>
21-
<Select @bind-Value="_tabBarMode"></Select>
20+
<BootstrapInputGroupLabel>Language</BootstrapInputGroupLabel>
21+
<Select @bind-Value="_language" Items="_languages"></Select>
2222
</BootstrapInputGroup>
2323
</div>
2424
<div class="col-12 col-sm-6">
2525
<BootstrapInputGroup>
26-
<BootstrapInputGroupLabel>Theme</BootstrapInputGroupLabel>
27-
<Select @bind-Value="_theme"></Select>
26+
<BootstrapInputGroupLabel>TabBarMode</BootstrapInputGroupLabel>
27+
<Select @bind-Value="_tabBarMode"></Select>
2828
</BootstrapInputGroup>
2929
</div>
3030
<div class="col-12 col-sm-6">
3131
<BootstrapInputGroup>
32-
<BootstrapInputGroupLabel>EnableThumbnails</BootstrapInputGroupLabel>
33-
<Switch @bind-Value="_enableThumbnails"></Switch>
32+
<BootstrapInputGroupLabel>Theme</BootstrapInputGroupLabel>
33+
<Select @bind-Value="_theme"></Select>
3434
</BootstrapInputGroup>
3535
</div>
3636
<div class="col-12 col-sm-6">
3737
<BootstrapInputGroup>
38-
<BootstrapInputGroupLabel>ShowPrint</BootstrapInputGroupLabel>
39-
<Switch @bind-Value="_showPrint"></Switch>
38+
<BootstrapInputGroupLabel>ScrollStrategy</BootstrapInputGroupLabel>
39+
<Select @bind-Value="_strategy"></Select>
4040
</BootstrapInputGroup>
4141
</div>
42-
<div class="col-12">
43-
<Button Color="Color.Primary" OnClick="@(() => _url = "./samples/sample.pdf")" class="me-2">sample-Url</Button>
44-
<Button Color="Color.Primary" OnClick="@(() => _url = "./samples/ebook.pdf")" class="me-2">ebook-Url</Button>
45-
<Button Color="Color.Danger" OnClick="GetSampleStream" class="me-2">Sample-Stream</Button>
46-
<Button Color="Color.Danger" OnClick="GetTestStream">Sample2-Stream</Button>
47-
</div>
4842
</div>
4943
</section>
50-
<EmbedPDF Url="@_url" ViewHeight="600px" TabBarMode="_tabBarMode" Theme="_theme"></EmbedPDF>
44+
<EmbedPDF Url="@_url" ViewHeight="600px" Language="@_language"
45+
TabBarMode="_tabBarMode" Theme="_theme" ScrollStrategy="_strategy"></EmbedPDF>
5146
</DemoBlock>

src/BootstrapBlazor.Server/Components/Samples/EmbedPdfs.razor.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@ public partial class EmbedPdfs
1616
[Inject, NotNull]
1717
private DownloadService? DownloadService { get; set; }
1818

19-
private bool _showTwoPagesOneView = true;
20-
private bool _showPrint = true;
21-
private bool _enableThumbnails = true;
22-
private bool _showDownload = true;
2319
private EmbedPDFTabBarMode _tabBarMode = EmbedPDFTabBarMode.Always;
2420
private EmbedPDFTheme _theme = EmbedPDFTheme.System;
25-
private bool _showFileName = true;
21+
private EmbedPDFScrollStrategy _strategy = EmbedPDFScrollStrategy.Vertical;
2622
private string _url = "./samples/sample.pdf";
2723
private string _streamFileName = "";
24+
private string _language = "";
25+
26+
private List<SelectedItem> _languages = new List<SelectedItem>() {
27+
new SelectedItem("", "Auto"),
28+
new SelectedItem("en", "en-US"),
29+
new SelectedItem("zh-CN", "zh-CN")
30+
};
2831

2932
private async Task<Stream> OnGetStreamAsync()
3033
{

0 commit comments

Comments
 (0)