Skip to content

Commit 6c09235

Browse files
authored
Update Custom-Bookmark.md
1 parent f5cda77 commit 6c09235

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

MAUI/PDF-Viewer/Custom-Bookmark.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
layout: post
3-
title: Custom Bookmark in .NET MAUI PDF Viewer control | Syncfusion
3+
title: Custom Bookmarks in .NET MAUI PDF Viewer control | Syncfusion
44
description: Learn here about the custom bookmark navigation in Syncfusion<sup>®</sup> .NET MAUI PDF Viewer (SfPdfViewer) control.
55
platform: MAUI
66
control: SfPdfViewer
77
documentation: ug
88
---
99

10-
# Custom bookmark in .NET MAUI PDF Viewer
10+
# Custom Bookmarks in .NET MAUI PDF Viewer
1111

1212
A PDF document may optionally have custom bookmarks that allow the user to bookmark pages and navigate to them. The PDF viewer control displays these custom bookmarks in outline view.
1313

14-
## Showing/hiding the custom bookmark
14+
## Showing/Hiding the Custom Bookmarks Pane
1515

16-
The PDF viewer's built-in custom bookmark view, which displays the custom bookmarks, can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. Its default value is `false`.
16+
The PDF Viewer's built-in custom bookmark view, which displays the custom bookmarks, can be shown or hidden using the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property. Its default value is `false`.
1717

1818
{% tabs %}
1919
{% highlight XAML %}
@@ -28,7 +28,7 @@ pdfViewer.IsOutlineViewVisible = true;
2828
{% endhighlight %}
2929
{% endtabs %}
3030

31-
## Accessing the custom bookmarks collection
31+
## Accessing the Custom Bookmarks Collection
3232

3333
To access the custom bookmarks, you can use the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection. This property provides the list of custom bookmarks in the PDF.
3434

@@ -40,17 +40,17 @@ var customBookmarks = pdfViewer.CustomBookmarks;
4040
{% endhighlight %}
4141
{% endtabs %}
4242

43-
## Add, edit, and remove custom bookmarks
43+
## Add, Edit, and Remove Custom Bookmarks
4444

4545
To add, edit, or remove custom bookmarks in a PDF viewer, you can use the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection. This property provides access to the collection of custom bookmarks that can be manipulated to modify the bookmarks displayed in the viewer's bookmark view.
4646

47-
### Add custom bookmarks using the bookmark pane
47+
### Add Custom Bookmarks from UI
4848

4949
Custom bookmarks can be added using the floating button in the bookmark pane.
5050

5151
![Custom bookmark floating button](Images\custom-bookmark.png)
5252

53-
### Adding a Custom Bookmark programmatically
53+
### Add a Custom Bookmark Programmatically
5454

5555
To add a custom bookmark, you can create a new instance of Bookmark and add it to the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection:
5656

@@ -69,7 +69,7 @@ pdfViewer.CustomBookmarks.Add(newBookmark);
6969
{% endhighlight %}
7070
{% endtabs %}
7171

72-
### Tracking Addition of Custom Bookmark:
72+
### Tracking Addition of Custom Bookmark
7373

7474
In the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) event handler, subscribe to the [CollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1.collectionchanged?view=net-9.0) event of the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection to track changes while addition of custom bookmark in it. Within the [CollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1.collectionchanged?view=net-9.0) event handler, you use the [NotifyCollectionChangedAction](https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.notifycollectionchangedaction?view=net-9.0) enum to determine if the action is `Add`. If so, you iterate through all items in e.NewItems to track the addition of custom bookmark.
7575

@@ -102,13 +102,12 @@ private void Bookmarks_CollectionChanged(object? sender, NotifyCollectionChanged
102102
{% endhighlight %}
103103
{% endtabs %}
104104

105-
### Rename custom bookmarks using the bookmark context menu
105+
### Rename Custom Bookmarks using Context Menu
106106

107107
Tap the context menu button on the custom bookmark to be edited and choose Rename and enter the desired name.
108-
109108
![Custom bookmark context menu](Images\custom-bookmark-contextmenu.png)
110109

111-
### Rename a Custom Bookmark programmatically
110+
### Rename a Custom Bookmark Programmatically
112111

113112
To rename an existing custom bookmark, you can retrieve the bookmark from the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection and modify its properties:
114113

@@ -190,11 +189,11 @@ private void Bookmark_PropertyChanged(object? sender, PropertyChangedEventArgs e
190189
{% endhighlight %}
191190
{% endtabs %}
192191

193-
### Remove custom bookmarks using the bookmark context menu
192+
### Remove Custom Bookmarks using Context Menu
194193

195194
Tap the context menu button on the custom bookmark to be removed and tap `Delete`.
196195

197-
### Removing a Custom Bookmark programmatically
196+
### Remove a Custom Bookmark Programmatically
198197

199198
To remove a custom bookmark, you can remove it directly from the [CustomBookmarks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_CustomBookmarks) collection:
200199

@@ -211,7 +210,7 @@ if (bookmarkToRemove != null)
211210
{% endhighlight %}
212211
{% endtabs %}
213212

214-
### Tracking Removal of Custom Bookmark:
213+
### Tracking Removal of Custom Bookmark
215214

216215
In the [CollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1.collectionchanged?view=net-9.0) event handler, you can use the [NotifyCollectionChangedAction](https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.notifycollectionchangedaction?view=net-9.0) enum to determine if the action is `Remove`. If it is, you iterate through all items in e.OldItems to track the removal of custom bookmark.
217216

@@ -234,15 +233,15 @@ private void Bookmarks_CollectionChanged(object? sender, NotifyCollectionChanged
234233
{% endhighlight %}
235234
{% endtabs %}
236235

237-
## Navigating to a custom bookmark
236+
## Navigation to a Custom Bookmark
238237

239-
### Navigating using UI
238+
### Navigation using UI
240239

241240
As mentioned above, you can show the outline view by setting the [IsOutlineViewVisible](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_IsOutlineViewVisible) property to `true`. When the outline view is showing, you can tap on any bookmark to navigate to the destination pointed to that bookmark.
242241

243242
![Custom bookmark in .NET MAUI PDF Viewer](Images\custom-bookmark.png)
244243

245-
### Navigating programmatically
244+
### Navigation to a Custom Bookmark Programmatically
246245

247246
The PDF viewer allows the users to navigate to an custom bookmark using the [GoToBookmark](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_GoToBookmark_Syncfusion_Maui_PdfViewer_Bookmark_) method. The below code snippet illustrates the same.
248247

@@ -256,4 +255,4 @@ if (customBookmark != null)
256255
pdfViewer.GoToBookmark(customBookmark);
257256

258257
{% endhighlight %}
259-
{% endtabs %}
258+
{% endtabs %}

0 commit comments

Comments
 (0)