Skip to content

Commit c507f68

Browse files
authored
feat(PdfViewer): add UseGoogleDocs parameter (#6170)
* chore: bump version 9.0.1 * feat: 增加 UseGoogleDocs 参数
1 parent 16b02fe commit c507f68

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<PackageReference Include="BootstrapBlazor.OctIcon" Version="9.0.4" />
5959
<PackageReference Include="BootstrapBlazor.OnScreenKeyboard" Version="9.0.1" />
6060
<PackageReference Include="BootstrapBlazor.PdfReader" Version="9.0.1" />
61-
<PackageReference Include="BootstrapBlazor.PdfViewer" Version="9.0.0" />
61+
<PackageReference Include="BootstrapBlazor.PdfViewer" Version="9.0.1" />
6262
<PackageReference Include="BootstrapBlazor.Player" Version="9.0.1" />
6363
<PackageReference Include="BootstrapBlazor.RDKit" Version="9.0.2" />
6464
<PackageReference Include="BootstrapBlazor.SignaturePad" Version="9.0.1" />

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88
<PackageTips Name="BootstrapBlazor.PdfViewer" />
99

1010
<DemoBlock Title="@Localizer["PdfViewerNormalTitle"]" Introduction="@Localizer["PdfViewerNormalIntro"]" Name="Normal">
11+
<section ignore>
12+
<div class="row g-3">
13+
<div class="col-12 col-sm-6">
14+
<BootstrapInputGroup>
15+
<BootstrapInputGroupLabel DisplayText="UseGoogleDocs"></BootstrapInputGroupLabel>
16+
<Switch @bind-Value="@_useGoogleDocs"></Switch>
17+
</BootstrapInputGroup>
18+
</div>
19+
</div>
20+
</section>
1121
<PdfViewer Url="./samples/pdf-viewer.pdf" Height="620px"
12-
NotSupportCallback="NotSupportCallback" OnLoaded="OnLoaded"></PdfViewer>
22+
NotSupportCallback="NotSupportCallback" OnLoaded="OnLoaded"
23+
UseGoogleDocs="@_useGoogleDocs"></PdfViewer>
1324
</DemoBlock>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public partial class PdfViewers
1515
[Inject, NotNull]
1616
private ToastService? ToastService { get; set; }
1717

18+
private bool _useGoogleDocs = true;
19+
1820
private Task OnLoaded() => ToastService.Success("Pdf Viewer", Localizer["PdfViewerToastSuccessfulContent"]);
1921

2022
private Task NotSupportCallback() => ToastService.Error("PdfViewer", Localizer["PdfViewerToastNotSupportContent"]);

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6161,7 +6161,7 @@
61616161
"PdfViewerTitle": "PDFViewer",
61626162
"PdfViewerDescription": "Open the PDF file in the component to read its contents",
61636163
"PdfViewerNormalTitle": "Basic usage",
6164-
"PdfViewerNormalIntro": "Load a PDF file by setting the <code>Url</code> parameter",
6164+
"PdfViewerNormalIntro": "Load a PDF file by setting the <code>Url</code> parameter. Set <code>UseGoogleDocs</code> to use docs.google.com preview",
61656165
"PdfViewerToastSuccessfulContent": "PDF document loaded successfully.",
61666166
"PdfViewerToastNotSupportContent": "The browser does not support inline viewing of PDF files."
61676167
},

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6161,7 +6161,7 @@
61616161
"PdfViewerTitle": "PDFViewer PDF 阅读器",
61626162
"PdfViewerDescription": "在组件中打开 Pdf 文件阅读其内容",
61636163
"PdfViewerNormalTitle": "基础用法",
6164-
"PdfViewerNormalIntro": "通过设置 <code>Url</code> 参数加载 Pdf 文件",
6164+
"PdfViewerNormalIntro": "通过设置 <code>Url</code> 参数加载 Pdf 文件,设置 <code>UseGoogleDocs</code> 使用 docs.google.com 预览",
61656165
"PdfViewerToastSuccessfulContent": "PDF 文档加载成功",
61666166
"PdfViewerToastNotSupportContent": "当前浏览器不支持 Pdf 文档预览功能"
61676167
},

0 commit comments

Comments
 (0)