feat(PdfReader): add TwoPagesOnView function (#7182)

This commit is contained in:
Argo Zhang
2025-11-26 10:10:15 +08:00
committed by GitHub
parent c4e567cf79
commit 26c6bfd0a7
2 changed files with 9 additions and 86 deletions

View File

@@ -62,7 +62,7 @@
<PackageReference Include="BootstrapBlazor.OfficeViewer" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.OnScreenKeyboard" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.OpcDa" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.PdfReader" Version="10.0.1-beta03" />
<PackageReference Include="BootstrapBlazor.PdfReader" Version="10.0.1-beta04" />
<PackageReference Include="BootstrapBlazor.PdfViewer" Version="10.0.0" />
<PackageReference Include="BootstrapBlazor.Player" Version="10.0.1" />
<PackageReference Include="BootstrapBlazor.RDKit" Version="10.0.0" />

View File

@@ -7,90 +7,13 @@
<PackageTips Name="BootstrapBlazor.PdfReader" />
<DemoBlock Title="@Localizer["PdfReaderNormalText"]" Introduction="@Localizer["PdfReaderNormalIntro"]" Name="Normal">
<section ignore class="row form-inline g3">
<div class="col-12 col-sm-6">
<BootstrapInputGroup>
<BootstrapInputGroupLabel>ShowTwoPagesOnView</BootstrapInputGroupLabel>
<Switch @bind-Value="_options.ShowTwoPagesOnViewButton"></Switch>
</BootstrapInputGroup>
</div>
</section>
<PdfReader Options="_options"></PdfReader>
</DemoBlock>
@* <DemoBlock Title="@Localizer["PdfReaderStreamModeText"]" Introduction="@Localizer["PdfReaderStreamModeIntro"]" Name="StreamMode">
<div>
<div class="row g-3">
<div class="col-12">
<BootstrapInputGroup>
<BootstrapInput @bind-Value="@FilenameStream" />
<Button Color="Color.Primary" OnClick="ApplyFilenameStream">Go!</Button>
</BootstrapInputGroup>
</div>
</div>
<PdfReader @ref="PdfReader" FileName="@FilenameStream" StreamMode="true" Height="500px" />
</div>
</DemoBlock>
<DemoBlock Title="@Localizer["PdfReaderCompatibilityModeText"]" Introduction="@Localizer["PdfReaderCompatibilityModeIntro"]" Name="CompatibilityMode">
<Tips>
<div>@((MarkupString)Localizer["PdfReaderCompatibilityModeTips"].Value)</div>
</Tips>
<h6>CompatibilityMode</h6>
<h6>CompatibilityMode</h6>
<PdfReader FileName=@FileName CompatibilityMode Height="300px" />
<h6>CompatibilityNoneES5</h6>
<PdfReader FileName=@FileName CompatibilityNoneES5 Height="300px" />
</DemoBlock>
<DemoBlock Title="@Localizer["PdfReaderAdvancedText"]" Introduction="@Localizer["PdfReaderAdvancedIntro"]" Name="Advanced">
<div>
<div class="row mb-3">
<div class="col-12">
<BootstrapInputGroup>
<Button Color="Color.Primary" OnClick="ApplyZoom">@Localizer["PdfReaderAdvancedViewMode"]</Button>
<Button Color="Color.Primary" OnClick="ApplyPageMode">@Localizer["PdfReaderAdvancedPageMode"]</Button>
<Button Color="Color.Primary" OnClick="ApplyPagePrevious">@Localizer["PdfReaderAdvancedPagePrevious"]</Button>
<Button Color="Color.Primary" OnClick="ApplyPageNext">@Localizer["PdfReaderAdvancedPageNext"]</Button>
<BootstrapInput @bind-Value="@Page" />
<Button OnClick="ApplyPage">@Localizer["PdfReaderAdvancedGoToPage"]</Button>
</BootstrapInputGroup>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
<BootstrapInputGroup>
<BootstrapInputGroupLabel @bind-Value="@Search" DisplayText="@Localizer["PdfReaderAdvancedSearchLabel"]" />
<BootstrapInput @bind-Value="@Search" OnEnterAsync="_ => ApplySearch()" OnEscAsync="_ => Clear()" />
<Button Icon="fa-solid fa-magnifying-glass" OnClick="ApplySearch"></Button>
</BootstrapInputGroup>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
<BootstrapInputGroup>
<BootstrapInputGroupLabel @bind-Value="@Filename" DisplayText="@Localizer["PdfReaderAdvancedFilenameLabel"]" />
<BootstrapInput @bind-Value="@Filename" />
<Button Color="Color.Primary" OnClick="ApplySearch">@Localizer["PdfReaderAdvancedRefreshPage"]</Button>
</BootstrapInputGroup>
</div>
</div>
<div class="row mb-3 form-inline">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto">
<Switch @bind-Value="@StreamMode" ShowLabel="true" DisplayText="@Localizer["PdfReaderAdvancedStreamModeLabel"]" />
</div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto">
<Switch @bind-Value="@ReadOnly" ShowLabel="true" DisplayText="@Localizer["PdfReaderAdvancedReadOnlyLabel"]" ShowLabelTooltip="true" OnValueChanged="_ => ApplySearch()" />
</div>
<BootstrapInput @bind-Value="@Watermark" DisplayText="@Localizer["PdfReaderAdvancedWatermarkLabel"]" />
</div>
<PdfReader @ref="AdvancedPdfReader"
FileName="@(StreamMode?FilenameStream:Filename)"
StreamMode="StreamMode"
Page=@Page
Zoom=@Zoom
Pagemode=@PageMode
Search=@Search
Width="80%"
Height="500px" />
</div>
</DemoBlock>
<AttributeTable Items="@GetAttributes()" />
<a href="https://gitee.com/LongbowEnterprise/BootstrapBlazor/issues/I66LXV">@Localizer["PdfReaderIssue"]</a> *@