Skip to content

Commit b4ab9d2

Browse files
984373: Update the mobile toolbar section
1 parent 451880a commit b4ab9d2

File tree

3 files changed

+100
-5
lines changed

3 files changed

+100
-5
lines changed
24.9 KB
Loading
25.3 KB
Loading

Document-Processing/PDF/PDF-Viewer/blazor/toolbar/mobile-toolbar.md

Lines changed: 100 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,55 @@ The SfPdfViewer includes a built-in, responsive primary toolbar that provides qu
1818
The primary toolbar includes the following options:
1919

2020
* Open PDF File
21-
* Text search
22-
* Comments panel
23-
* Download
2421
* Undo and Redo
2522
* Annotation tools
2623
* Form designer tools
2724
* Redaction tools
28-
* Bookmark panel
25+
* Text search
26+
27+
Reorder the [MobileToolbarItems](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerToolbarSettings.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerToolbarSettings_MobileToolbarItems) list to control the display order. The toolbar renders items in the order they appear in the collection.
28+
29+
Use the following code snippet to add the redaction toolbar to the PDF Viewer.
30+
31+
```cshtml
32+
33+
@page "/";
34+
35+
<SfPdfViewer2 @ref="SfPdfViewer2" Height="640px" Width="100%" DocumentPath="@DocumentPath">
36+
<PdfViewerToolbarSettings MobileToolbarItems="MobileToolbarItems"></PdfViewerToolbarSettings>
37+
</SfPdfViewer2>
38+
@code {
39+
SfPdfViewer2? SfPdfViewer2;
40+
bool redactionToolbar;
41+
private string DocumentPath { get; set; } = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
42+
public List<ToolbarItem>? ToolbarItems { get; set; }
43+
public List<MobileToolbarItem>? MobileToolbarItems { get; set; }
44+
protected override void OnInitialized()
45+
{
46+
MobileToolbarItems = new List<MobileToolbarItem>()
47+
{
48+
MobileToolbarItem.Open,
49+
MobileToolbarItem.UndoRedo,
50+
MobileToolbarItem.EditAnnotation,
51+
MobileToolbarItem.Redaction,
52+
MobileToolbarItem.FormDesigner,
53+
MobileToolbarItem.Search
54+
};
55+
}
56+
}
57+
58+
```
2959

30-
![Blazor PDF Viewer primary toolbar with customized items](../images/primary-toolbar-mobile-view.png)
60+
![Blazor PDF Viewer primary toolbar in mobile view](../images/primary-toolbar-mobile-view.png)
61+
62+
### More options menu
63+
64+
Open the overflow (three-dots) menu to access additional actions such as:
65+
66+
- Download: Download the currently opened PDF document.
67+
- Bookmark: View and navigate bookmarks within the document.
68+
69+
![More options menu showing additional actions like download and bookmark](../images/moreOptions.png)
3170

3271
## Annotation toolbar in mobile mode
3372

@@ -66,3 +105,59 @@ The redaction toolbar provides tools to mark and permanently remove sensitive co
66105
* Close
67106

68107
![Blazor PDF Viewer primary toolbar with customized items](../images/mobile-redaction-toolbar.png)
108+
109+
## Enable desktop mode on mobile
110+
111+
Enable the desktop toolbar on mobile devices with the [EnableDesktopMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_EnableDesktopMode) API. This replaces the mobile toolbar with the desktop layout and provides access to additional actions and controls.
112+
113+
```cshtml
114+
@using Syncfusion.Blazor.SfPdfViewer
115+
116+
<SfPdfViewer2 DocumentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
117+
Height="100%"
118+
Width="100%" EnableDesktopMode="true">
119+
</SfPdfViewer2>
120+
```
121+
122+
[View sample in GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Toolbar)
123+
124+
## Modern navigation panel in mobile view
125+
126+
On mobile devices, the navigation toolbar collapses into a toggle menu to save space. Any custom items added appear at the beginning of this menu.
127+
128+
![Modern navigation in mobile view](../images/ModernNavigation-mobile.png)
129+
130+
Enable the modern navigation panel by setting [EnableNavigationPanel](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_EnableNavigationPanel) to true.
131+
132+
```cshtml
133+
@using Syncfusion.Blazor.SfPdfViewer
134+
135+
<SfPdfViewer2 DocumentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
136+
Height="100%"
137+
Width="100%" EnableNavigationPanel="true">
138+
</SfPdfViewer2>
139+
```
140+
[View sample in GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Toolbar)
141+
142+
## Enable scrolling in desktop mode with touch gestures
143+
144+
For smooth scrolling of PDF documents on mobile while in desktop mode, disable text selection (set [EnableTextSelection](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_EnableTextSelection) to false) to allow touch panning.
145+
146+
```cshtml
147+
@using Syncfusion.Blazor.SfPdfViewer
148+
149+
<SfPdfViewer2 DocumentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
150+
Height="100%"
151+
Width="100%" EnableDesktopMode="true" EnableTextSelection="false">
152+
</SfPdfViewer2>
153+
```
154+
[View sample in GitHub](https://github.com/SyncfusionExamples/blazor-pdf-viewer-examples/tree/master/Toolbar)
155+
156+
## Print option availability
157+
158+
The Print option is not available in mobile mode by default. To use printing on mobile, enable the desktop toolbar with the [EnableDesktopMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerBase.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerBase_EnableDesktopMode) API. Availability and behavior may vary by mobile browser.
159+
160+
## See also
161+
162+
- [Annotations in mobile view](../annotation/annotations-in-mobile-view)
163+
- [Form designer in mobile view](../form-designer/form-designer-in-mobile-view)

0 commit comments

Comments
 (0)