Skip to content

Commit 0089c65

Browse files
authored
Merge pull request #1354 from syncfusion-content/MyDevelopment
823696 : Hotfix to development merge for PDF Viewer
2 parents 024dd9f + 8c40475 commit 0089c65

24 files changed

+329
-260
lines changed

MAUI/PDF-Viewer/Add-Remove-Modify-Annotations.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ control: SfPdfViewer
77
documentation: ug
88
---
99

10-
# Add, Remove and Edit Annotations
10+
# Add, Remove and Edit Annotations in .NET MAUI PDF Viewer (SfPdfViewer)
1111

1212
This section will go through the various functions available in the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) for adding, removing and editing annotations in a PDF document.
1313

14-
## Add Annotations to a PDF Document
14+
## Add annotations to a PDF document
1515

1616
This section will go through how to add annotations to a PDF document programmatically.
1717

18-
### Add Annotations Programmatically
18+
### Add annotations programmatically
1919

2020
You can add a new annotation to the PDF document programmatically by creating an annotation instance and providing it as a parameter to the `AddAnnotation` method. The following example shows how to create an instance of a circle annotation and add it to the PDF document. Similarly, you can create and add other types of annotation.
2121

@@ -42,7 +42,7 @@ void AddCircleAnnotation()
4242
{% endhighlight %}
4343
{% endtabs %}
4444

45-
### Annotation Added Event
45+
### AnnotationAdded event
4646

4747
The `AnnotationAdded` event occurs when an annotation is added successfully to the PDF document. The following example explains how to wire and handle the event.
4848

@@ -62,11 +62,11 @@ private void OnAnnotationAdded(object sender, AnnotationEventArgs e)
6262
{% endhighlight %}
6363
{% endtabs %}
6464

65-
## Remove Annotations from the PDF Document
65+
## Remove annotations from the PDF document
6666

6767
This section will go through different methods of removing annotations from a PDF document.
6868

69-
### Remove the Selected Annotation
69+
### Remove the selected annotation
7070

7171
You can remove the selected annotation programmatically by providing the selected annotation instance as the parameter to `RemoveAnnotation` method. The selected annotation instance may be obtained from the `AnnotationSelected` event. The following example shows how to remove the selected annotation.
7272

@@ -86,7 +86,7 @@ void RemoveSelectedAnnotation(Annotation selectedAnnotation)
8686

8787
In desktop platforms like macOS and Windows, you can also use the keyboard shortcut `Delete` to remove the selected annotation from the PDF document directly.
8888

89-
### Remove Specific Annotation
89+
### Remove a specific annotation
9090

9191
You can remove an annotation from the document programmatically by providing the specific annotation instance as the parameter to `RemoveAnnotation` method of `SfPdfViewer`. The following example shows how to remove the first annotation in the annotation collection from a PDF document.
9292

@@ -106,7 +106,7 @@ void RemoveFirstAnnotation()
106106
{% endhighlight %}
107107
{% endtabs %}
108108

109-
### Remove all the Annotations
109+
### Remove all the annotations
110110

111111
You can remove all the annotations from a document programmatically by calling `RemoveAllAnnotations` method. The following example shows how to remove all the annotations from a PDF document.
112112

@@ -120,7 +120,7 @@ void RemoveAllAnnotations()
120120
{% endhighlight %}
121121
{% endtabs %}
122122

123-
### Annotation Removed Event
123+
### AnnotationRemoved event
124124

125125
The `AnnotationRemoved` event occurs when an annotation is removed successfully from the PDF document. The following example explains how to wire and handle the event.
126126

@@ -140,11 +140,11 @@ private void OnAnnotationRemoved(object sender, AnnotationEventArgs e)
140140
{% endhighlight %}
141141
{% endtabs %}
142142

143-
## Editing Annotations
143+
## Edit annotations
144144

145145
This section will go through different methods of editing annotations in a PDF document programmatically.
146146

147-
### Editing a Specific Annotation
147+
### Edit a specific annotation
148148

149149
You can edit the properties of an annotation from the document programmatically by accessing the specific annotation instance from the `Annotations` property of the SfPdfViewer. The following example shows how to edit the first annotation in the annotation collection. Similarly, you can modify the other properties also.
150150

@@ -173,7 +173,7 @@ void EditFirstAnnotation()
173173
{% endhighlight %}
174174
{% endtabs %}
175175

176-
### Editing the Selected Annotation
176+
### Edit the selected annotation
177177

178178
You can edit the properties of the selected annotation programmatically by accessing the selected annotation instance. The selected annotation instance may be obtained from the `AnnotationSelected` event. The following example shows how to edit the selected annotation assuming that the annotation is a circle type.
179179

@@ -200,7 +200,7 @@ void EditSelectedAnnotation(Annotation selectedAnnotation)
200200
{% endhighlight %}
201201
{% endtabs %}
202202

203-
### Annotation Edited Event
203+
### AnnotationEdited event
204204

205205
The `AnnotationEdited` event occurs when an annotation is edited in the PDF document. The following example explains how to wire and handle the event.
206206

MAUI/PDF-Viewer/Annotation-Collection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ control: SfPdfViewer
77
documentation: ug
88
---
99

10-
# Annotation Collection
10+
# Annotation Collection in .NET MAUI PDF Viewer (SfPdfViewer)
1111

1212
The existing annotations in a PDF document can be accessed using the `Annotations` property of the [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html). This read only property will have the annotation collection information as soon as the document is loaded into the PDF Viewer. The following example explains how to use the property to obtain the information about a square annotation that is the first on a specific document.
1313

MAUI/PDF-Viewer/Annotations-Overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ control: SfPdfViewer
77
documentation: ug
88
---
99

10-
# Annotations
10+
# Annotations in .NET MAUI PDF Viewer (SfPdfViewer)
1111

1212
The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) allows you to add, remove and modify annotations in the PDF documents. This section will go through the various annotation types available in PDF Viewer.
1313

MAUI/PDF-Viewer/Document-Link-Annotations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ control: SfPdfViewer
77
documentation: ug
88
---
99

10-
# Document link navigation
10+
# Document Link Navigation in .NET MAUI PDF Viewer (SfPdfViewer)
1111

1212
The PDF viewer allows navigating from one part of the PDF document to another using document link annotations. When a document link annotation is tapped, the PDF viewer scrolls to its destination. This type of link annotations is most often used to represent the table of contents of a PDF document.
1313

MAUI/PDF-Viewer/DocumentLoadNotifications.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
layout: post
3-
title: Document Load Notifications in .NET MAUI PDF Viewer control | Syncfusion
3+
title: Document Load Events in .NET MAUI PDF Viewer control | Syncfusion
44
description: Learn here all about events that notifies whether the document has been opened or not opened in the Syncfusion .NET MAUI PDF Viewer (SfPdfViewer).
55
platform: MAUI
66
control: SfPdfViewer
77
documentation: ug
88
---
99

10-
# Document Load Notifications in .NET MAUI PDF Viewer (SfPdfViewer)
10+
# Document Load Events in .NET MAUI PDF Viewer (SfPdfViewer)
1111

1212
The [SfPdfViewer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html) supports the [DocumentLoaded](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoaded) and [DocumentLoadFailed](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfViewer.SfPdfViewer.html#Syncfusion_Maui_PdfViewer_SfPdfViewer_DocumentLoadFailed) events to notify whether the document has been opened and displayed in the view or not.
1313

@@ -62,17 +62,17 @@ The [DocumentLoadFailedEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion
6262
{% tabs %}
6363
{% highlight XAML hl_lines="3" %}
6464

65-
<syncfusion:SfPdfViewer
66-
x:Name="PdfViewer"
67-
DocumentLoadFailed="PdfViewer_DocumentLoadFailed"/>
65+
<syncfusion:SfPdfViewer
66+
x:Name="PdfViewer"
67+
DocumentLoadFailed="PdfViewer_DocumentLoadFailed"/>
6868

6969
{% endhighlight %}
7070
{% highlight C# %}
7171

72-
private void PdfViewer_DocumentLoadFailed(object sender, DocumentLoadFailedEventArgs e)
73-
{
74-
DisplayAlert( e.Message, e.Exception.StackTrace, "OK");
75-
}
72+
private void PdfViewer_DocumentLoadFailed(object sender, DocumentLoadFailedEventArgs e)
73+
{
74+
DisplayAlert( e.Message, e.Exception.StackTrace, "OK");
75+
}
7676

7777
{% endhighlight %}
7878
{% endtabs %}
@@ -84,24 +84,24 @@ The `DocumentLoadFailed` event allows you to handle the load failures at the app
8484
{% tabs %}
8585
{% highlight XAML hl_lines="3" %}
8686

87-
<syncfusion:SfPdfViewer
88-
x:Name="PdfViewer"
89-
DocumentLoadFailed="PdfDocumentLoadFailed"/>
87+
<syncfusion:SfPdfViewer
88+
x:Name="PdfViewer"
89+
DocumentLoadFailed="PdfDocumentLoadFailed"/>
9090

9191
{% endhighlight %}
9292
{% highlight C# hl_lines="4" %}
9393

94-
public MainPage()
95-
{
96-
InitializeComponent();
97-
PdfViewer.DocumentLoadFailed += PdfDocumentLoadFailed;
98-
}
99-
100-
private void PdfDocumentLoadFailed(object sender, DocumentLoadFailedEventArgs e)
101-
{
102-
e.Handled = true;
103-
// Handle your logic here.
104-
}
94+
public MainPage()
95+
{
96+
InitializeComponent();
97+
PdfViewer.DocumentLoadFailed += PdfDocumentLoadFailed;
98+
}
99+
100+
private void PdfDocumentLoadFailed(object sender, DocumentLoadFailedEventArgs e)
101+
{
102+
e.Handled = true;
103+
// Handle your logic here.
104+
}
105105

106106
{% endhighlight %}
107107
{% endtabs %}

MAUI/PDF-Viewer/Gesture-Events.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
layout: post
3+
title: Gesture events in .NET MAUI PDF Viewer control | Syncfusion
4+
description: This guide discusses about the gesture events provided by Syncfusion .NET MAUI PDF Viewer (SfPdfViewer) control.
5+
platform: MAUI
6+
control: SfPdfViewer
7+
documentation: ug
8+
---
9+
10+
# Gesture Events in .NET MAUI PDF Viewer (SfPdfViewer)
11+
12+
## Tapped event
13+
14+
The `SfPdfViewer` provides a `Tapped` event that occurs when a tap gesture is detected in the control and allows you to perform custom actions when a tap occurs. This event provides information about the page number and position at the tapped location through the `GestureEventArgs`.
15+
The following code example demonstrates how to subscribe to the `Tapped` event.
16+
17+
{% tabs %}
18+
{% highlight xaml %}
19+
<syncfusion:SfPdfViewer x:Name="PdfViewer" Tapped="PdfViewer_Tapped"/>
20+
{% endhighlight %}
21+
22+
{% highlight c# %}
23+
SfPdfViewer PdfViewer = new SfPdfViewer();
24+
PdfViewer.Tapped += PdfViewer_Tapped;
25+
{% endhighlight %}
26+
{% endtabs %}
27+
28+
In the above example, the `PdfViewer_Tapped` method is registered as the event handler for the Tapped event of the `SfPdfViewer`. The `PdfViewer_Tapped` method will be invoked whenever a tap occurs on the PDF Viewer. You can handle the custom action in the method as demonstrated in the following code example.
29+
30+
{% tabs %}
31+
{% highlight c# %}
32+
private void PdfViewer_Tapped(object sender, GestureEventArgs e)
33+
{
34+
// Handle the tap event here.
35+
}
36+
{% endhighlight %}
37+
{% endtabs %}
38+
39+
### GestureEventArgs
40+
41+
The `GesturEventArgs` provides information available on the tapped location and it includes the following properties.
42+
43+
1.`PageNumber` – This property returns the page number on which the tap took place. The value ranges from 1 to the total number of pages in the PDF document. If the tap occurs outside of any PDF page boundaries, the result will be -1.
44+
2.`PagePositon` – The property returns the page’s tapped position in the PDF coordinates. The coordinates have their origin at the top-left of the page. The number of the tapped page is identified by the `PageNumber` property. If the tap occurs outside of any PDF page boundaries, the result will be (-1, -1).
45+
3.`Position` – This property returns the tapped position on the PDF Viewer control. The coordinate space starts at the top left of the control.
46+
47+
The following code example that demonstrates how to retrieve information from the `GestureEventArgs` and handle the tapped event.
48+
49+
{% tabs %}
50+
{% highlight c# %}
51+
private void PdfViewer_Tapped(object sender, GestureEventArgs e)
52+
{
53+
// To get the pointer position on the control where the tap occurred.
54+
var pointerPosition = e.Position;
55+
// To get the page number where the tap occurred.
56+
var pageNumber = e.PageNumber;
57+
// To get the page position where the tap occurred.
58+
var pagePoistion = e.PagePosition;
59+
60+
// Handle the tap event here with the above information if required.
61+
}
62+
{% endhighlight %}
63+
{% endtabs %}

MAUI/PDF-Viewer/Hyperlink-Navigation.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ The [HyperlinkClicked](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.PdfVi
1818
{% tabs %}
1919
{% highlight XAML hl_lines="3" %}
2020

21-
<syncfusion:SfPdfViewer
22-
x:Name="PdfViewer"
23-
HyperlinkClicked="PdfHyperlinkClicked"/>
21+
<syncfusion:SfPdfViewer
22+
x:Name="PdfViewer"
23+
HyperlinkClicked="PdfHyperlinkClicked"/>
2424

2525
{% endhighlight %}
2626
{% highlight C# hl_lines="4" %}
2727

28-
public MainPage()
29-
{
30-
InitializeComponent();
31-
PdfViewer.HyperlinkClicked += PdfHyperlinkClicked;
32-
}
33-
34-
private async void PdfHyperlinkClicked(object sender, HyperlinkClickedEventArgs e)
35-
{
36-
e.Handled = true;
37-
await Browser.Default.OpenAsync(e.Uri, BrowserLaunchMode.SystemPreferred);
38-
}
28+
public MainPage()
29+
{
30+
InitializeComponent();
31+
PdfViewer.HyperlinkClicked += PdfHyperlinkClicked;
32+
}
33+
34+
private async void PdfHyperlinkClicked(object sender, HyperlinkClickedEventArgs e)
35+
{
36+
e.Handled = true;
37+
await Browser.Default.OpenAsync(e.Uri, BrowserLaunchMode.SystemPreferred);
38+
}
3939

4040
{% endhighlight %}
4141
{% endtabs %}
@@ -47,14 +47,14 @@ Enable or disable the recognition of hyperlinks in PDF documents using the [Enab
4747
{% tabs %}
4848
{% highlight XAML %}
4949

50-
<syncfusion:SfPdfViewer
51-
x:Name="PdfViewer"
52-
EnableHyperlinkNavigation="False"/>
50+
<syncfusion:SfPdfViewer
51+
x:Name="PdfViewer"
52+
EnableHyperlinkNavigation="False"/>
5353

5454
{% endhighlight %}
5555
{% highlight C# %}
5656

57-
PdfViewer.EnableHyperlinkNavigation = false;
57+
PdfViewer.EnableHyperlinkNavigation = false;
5858

5959
{% endhighlight %}
6060
{% endtabs %}
440 KB
Loading
3.71 MB
Loading

MAUI/PDF-Viewer/Import-Export-Annotations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ control: SfPdfViewer
77
documentation: ug
88
---
99

10-
# Import and Export Annotations
10+
# Import and Export Annotations in .NET MAUI PDF Viewer (SfPdfViewer)
1111

1212
This section will go through the various functions available in the `SfPdfViewer` to import and export annotations in a PDF document.
1313

14-
## Import Annotations
14+
## Import annotations
1515

1616
You can add annotations to a PDF document by importing them from FDF and XFDF files by using the `ImportAnnotations` method. You need to provide the stream of the file containing the annotations and the data format information as parameters to the method. The following example explains how to import annotations from an XFDF file, assuming that the file is in the application’s data directory.
1717

@@ -90,4 +90,4 @@ void ExportSpecificAnnotations()
9090
{% endhighlight %}
9191
{% endtabs %}
9292

93-
* Similarly, you may export specific list of annotations into an FDF file.
93+
* Similarly, you may export specific list of annotations into an FDF file.

0 commit comments

Comments
 (0)