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
Expand Up @@ -30,6 +30,11 @@
<Demo Type="typeof(PdfViewer_Demo_03_Base64String)" Tabs="true" />
</Section>

<Section Size="HeadingSize.H2" Name="RTL doc" PageUrl="@pageUrl" Link="rtl-doc">
<Callout HideHeading="true">Below screenshot is added for demo purposes only. For additional info, refer to this <a href="https://github.com/vikramlearning/blazorbootstrap/issues/919">link</a>.</Callout>
<Image Src="https://github.com/user-attachments/assets/2a2afd0d-9065-456c-9866-db10f81b7780" Alt="Blazor Bootstrap: Blazor PDF Viewer Component - RTL doc"/>
</Section>

@code {
private const string pageUrl = RouteConstants.Demos_PDFViewer_Documentation;
private const string pageTitle = "Blazor PDF Viewer";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<p>@eventLog</p>

<PdfViewer Class="mb-3"
Url="_content/BlazorBootstrap.Demo.RCL/docs/persian-sample-doc-919.pdf"
OnDocumentLoaded="OnDocumentLoaded"
OnPageChanged="OnPageChanged" />

@code {
private string eventLog { get; set; } = $"Last event: ..., CurrentPage: 0, TotalPages: 0";

private void OnDocumentLoaded(PdfViewerEventArgs args)
=> eventLog = $"Last event: OnDocumentLoaded, CurrentPage: {args.CurrentPage}, TotalPages: {args.TotalPages}";

private void OnPageChanged(PdfViewerEventArgs args)
=> eventLog = $"Last event: OnPageChanged, CurrentPage: {args.CurrentPage}, TotalPages: {args.TotalPages}";
}
Binary file not shown.
33 changes: 30 additions & 3 deletions docs/docs/05-components/pdf-viewer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The Blazor PDF Viewer component allows users to view PDF files directly in the b
}
```

[See demo here.](https://demos.blazorbootstrap.com/pagination#examples)
[See demo here.](https://demos.blazorbootstrap.com/pdf-viewer#examples)

### Orientation

Expand Down Expand Up @@ -85,7 +85,7 @@ Set the `Orientation` parameter to `Orientation.Landscape` to change the default
}
```

[See demo here.](https://demos.blazorbootstrap.com/pagination#orientation)
[See demo here.](https://demos.blazorbootstrap.com/pdf-viewer#orientation)

### Base64String

Expand Down Expand Up @@ -120,4 +120,31 @@ Pdf Viewer component supports **base64** string as a URL.
}
```

[See demo here.](https://demos.blazorbootstrap.com/pagination#base64-string)
[See demo here.](https://demos.blazorbootstrap.com/pdf-viewer#base64-string)

### RTL doc

<img src="https://github.com/user-attachments/assets/2a2afd0d-9065-456c-9866-db10f81b7780" alt="Blazor Bootstrap: Blazor PDF Viewer Component - RTL doc" />

:::info
Below screenshot is added for demo purposes only. For additional info, refer to this <a href="https://github.com/vikramlearning/blazorbootstrap/issues/919">link</a>.
:::

```cshtml {} showLineNumbers
<p>@eventLog</p>

<PdfViewer Class="mb-3"
Url="_content/BlazorBootstrap.Demo.RCL/docs/persian-sample-doc-919.pdf"
OnDocumentLoaded="OnDocumentLoaded"
OnPageChanged="OnPageChanged" />

@code {
private string eventLog { get; set; } = $"Last event: ..., CurrentPage: 0, TotalPages: 0";

private void OnDocumentLoaded(PdfViewerEventArgs args)
=> eventLog = $"Last event: OnDocumentLoaded, CurrentPage: {args.CurrentPage}, TotalPages: {args.TotalPages}";

private void OnPageChanged(PdfViewerEventArgs args)
=> eventLog = $"Last event: OnPageChanged, CurrentPage: {args.CurrentPage}, TotalPages: {args.TotalPages}";
}
```
Loading