Skip to content

Commit 13a15b9

Browse files
Merge pull request syncfusion-content#118 from Syncfusion-Content/development
DOCINFRA-2341_merged_using_automation
2 parents cef477e + 3e3a0e3 commit 13a15b9

File tree

11 files changed

+71
-32
lines changed

11 files changed

+71
-32
lines changed

wpf-toc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,7 @@
14391439
<li><a href="/wpf/Pdf-Viewer/overview">Overview</a></li>
14401440
<li><a href="/wpf/Pdf-Viewer/getting-started">Getting Started</a></li>
14411441
<li><a href="/wpf/Pdf-Viewer/pdf-rendering-engines">PDF Rendering Engines</a></li>
1442+
<li><a href="/wpf/Pdf-Viewer/text-extraction-engines">Text Extraction Engines</a></li>
14421443
<li><a href="/wpf/Pdf-Viewer/viewing-pdf-files">Viewing PDF Files</a></li>
14431444
<li><a href="/wpf/Pdf-Viewer/password-protected-pdf-files">Viewing Password protected PDF Files</a></li>
14441445
<li><a href="/wpf/Pdf-Viewer/printing-pdf-files">Printing PDF Files</a></li>
Binary file not shown.
40.5 KB
Loading

wpf/Pdf-Viewer/Redaction.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ documentation: ug
1111

1212
Redaction support allows you to remove sensitive/confidential information in text, images, and graphics from a PDF document.
1313

14+
N> From version 19.4.0.48, we have updated our default text extraction engine to PDFium for extracting text information from PDF documents. Based on the text information, we redact text in the PDF documents
15+
1416
## Enable redaction mode
1517

1618
The following code shows how to switch to redaction mode in code behind.

wpf/Pdf-Viewer/Searching-Text.md

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,55 @@
11
---
22
layout: post
3-
title: Searching Text in WPF Pdf Viewer control | Syncfusion
3+
title: Search text in PDF files using WPF PDF Viewer | Syncfusion
44
description: Learn about Searching Text support in Syncfusion Essential Studio WPF Pdf Viewer control, its elements and more.
55
platform: wpf
66
control: PDF Viewer
77
documentation: ug
88
---
99

10-
# Searching Text in WPF Pdf Viewer
10+
# Search text in PDF files using WPF PDF Viewer
1111

12-
Essential PDF Viewer allows you to search and highlight the text in the PDF document. The search box appears when Ctrl+F is pressed and searches the text in the PDF document as displayed in the following screenshot.
12+
The WPF PDF Viewer allows you to search and highlight the text in the PDF files. The search box appears when Ctrl+F is pressed and searches the text in the PDF document as displayed in the following screenshot.
1313

14-
![WPF PDF Viewer Concept and Features](Concept-and-Features_images/wpf-pdf-viewer-concept-and-features.png)
14+
![Search Text using WPF PDF Viewer](Concept-and-Features_images/wpf-pdf-viewer-search-text.png)
1515

16-
N>
17-
* PdfDocumentView is used to view the PDF documents without the toolbar. So, make use of PdfViewerControl to search the text using search box.
16+
N> [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) is used to view the PDF documents without the toolbar. So, make use of [PdfViewerControl](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) to search the text using search box.
1817

19-
The PDF Viewer control also supports searching text in the PDF document using the following API. The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_String_System_Collections_Generic_Dictionary_System_Int32_System_Collections_Generic_List_System_Drawing_RectangleF____) method returns true when the text given is found in the document. The dictionary contains the page index and the list of rectangular coordinates of the text found in that page. The following code example explains how text search can be achieved after [creating the control from the code](https://help.syncfusion.com/wpf/pdf-viewer/getting-started#creating-pdfviewercontrol-from-code) and handled in the Loaded event of the [application's MainWindow](https://docs.microsoft.com/en-us/dotnet/api/system.windows.application.mainwindow?view=netframework-4.8).
18+
## Search text in PDF programmatically
19+
20+
The WPF PDF Viewer also supports searching text in the PDF programmatically using the following API. The [FindText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_FindText_System_String_System_Collections_Generic_Dictionary_System_Int32_System_Collections_Generic_List_System_Drawing_RectangleF____) method returns true when the text given is found in the document. The dictionary contains the page index and the list of rectangular coordinates of the text found in that page. The following code example explains how text search can be achieved after [creating the control from the code](https://help.syncfusion.com/wpf/pdf-viewer/getting-started#creating-pdfviewercontrol-from-code) and handled in the Loaded event of the [application's MainWindow](https://docs.microsoft.com/en-us/dotnet/api/system.windows.application.mainwindow?view=netframework-4.8).
2021

2122
{% tabs %}
2223
{% highlight c# %}
23-
private void Window_Loaded(object sender, RoutedEventArgs e)
24-
{
25-
26-
bool IsMatchFound;
27-
28-
//Load the PDF.
29-
30-
pdfViewerControl1.Load("../../Data/Barcode.pdf");
24+
private void Window_Loaded(object sender, RoutedEventArgs e)
25+
{
26+
bool isMatchFound;
3127

32-
//Get the occurrences of the target text and location.
28+
//Load the PDF.
29+
pdfViewer.Load("../../Data/Barcode.pdf");
3330

34-
Dictionary<int, List<RectangleF>>
31+
//Get the occurrences of the target text and location.
32+
Dictionary<int, List<RectangleF>> textSearch = new Dictionary<int, List<RectangleF>>();
3533

36-
textSearch = new Dictionary<int, List<RectangleF>>();
37-
38-
IsMatchFound = pdfViewerControl1.FindText("targetText", out textSearch);
39-
40-
}
34+
isMatchFound = pdfViewer.FindText("targetText", out textSearch);
35+
}
4136

4237
{% endhighlight %}
43-
4438
{% highlight vbnet %}
4539

4640
Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs)
4741

48-
Dim IsMatchFound As Boolean
42+
Dim isMatchFound As Boolean
4943

5044
'Load the PDF.
5145

52-
pdfViewerControl1.Load("../../Data/Barcode.pdf")
46+
pdfViewer.Load("../../Data/Barcode.pdf")
5347

5448
'Get the occurrences of the target text and location.
5549

5650
Dim textSearch As New Dictionary(Of Integer, List(Of RectangleF))()
5751

58-
IsMatchFound = pdfViewerControl1.FindText("targetText", textSearch)
52+
isMatchFound = pdfViewer.FindText("targetText", textSearch)
5953

6054
End Sub
6155

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
---
22
layout: post
3-
title: Select and Copy Text in WPF Pdf Viewer control | Syncfusion
3+
title: Select and Copy Text in PDF files using WPF PDF Viewer | Syncfusion
44
description: Learn about Select and Copy Text support in Syncfusion Essential Studio WPF Pdf Viewer control, its elements and more.
55
platform: wpf
66
control: PDF Viewer
77
documentation: ug
88
---
99

10-
# Select and Copy Text in WPF Pdf Viewer
10+
# Select and Copy Text in PDF files using WPF PDF Viewer
1111

1212
In PDF Viewer, text can be selected by clicking the mouse left button and dragging the mouse pointer over the text in any direction.
1313

14+
N> From version 19.4.0.48, we have updated our default text extraction engine to PDFium for extracting text information from PDF documents. Based on the text information, we select text in the PDF documents.
15+
1416
## Detecting the completion of text selection
1517

16-
When the text selection is completed, the [TextSelectionCompleted](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) event will be raised. The selected text can be retrieved as string from the `args` parameter of the event handler.
18+
When the text selection is completed, the [TextSelectionCompleted](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html) event will be raised. Refer to the following code snippet for wiring the event.
19+
20+
{% tabs %}
21+
{% highlight c# %}
22+
23+
pdfViewer.TextSelectionCompleted += PdfViewer_TextSelectionCompleted;
24+
25+
{% endhighlight %}
26+
{% endtabs %}
27+
28+
The selected text can be retrieved as string from the [TextSelectionCompletedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.TextSelectionCompletedEventArgs.html) of the event handler.
1729

1830
{% tabs %}
1931
{% highlight c# %}
@@ -22,7 +34,7 @@ private void PdfViewer_TextSelectionCompleted(object sender, TextSelectionComple
2234
{
2335
//Get the whole selected text
2436
string selectedText = args.SelectedText;
25-
//Get the selected text and its rectangular bounds for each page separately if the selection is made on multiple pages
37+
//Get the selected text and its rectangular bounds for each page separately if the selection is made on multiple pages
2638
Dictionary<int, Dictionary<string, Rectangle>> selectedTextInformation = args.SelectedTextInformation;
2739
}
2840

@@ -35,7 +47,6 @@ The selected text can be copied by clicking the copy from the context menu, whic
3547

3648
![WPF PDF Viewer Copying the Selected Text](Select_and_copy_text_images/wpf-pdf-viewer-copying-the-selected-text.png)
3749

38-
The selected text can also be copied using the keyboard shortcut Ctrl + C.
39-
50+
The selected text can also be copied using the keyboard shortcut `Ctrl + C`.
4051

4152
N> You can refer to our [WPF PDF Viewer](https://www.syncfusion.com/wpf-controls/pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [WPF PDF Viewer example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the pdfviewer.
-9.34 KB
Loading

wpf/Pdf-Viewer/Working-with-Annotations/Highlight-Annotation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ To enable the mode from UI, click the below icon in the default toolbar of [PdfV
1717

1818
If you are using [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) control, or your own toolbar, or if you want enable the mode programmatically, change the [AnnotationMode](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_AnnotationMode) property of PDF Viewer to **Highlight**, as shown in the below code example.
1919

20+
N> From version 19.4.0.48, we have updated our default text extraction engine to PDFium for extracting text information from PDF documents. Based on the text information, we create text markup annotations in the PDF documents.
21+
2022
{% tabs %}
2123
{% highlight C# %}
2224

wpf/Pdf-Viewer/Working-with-Annotations/Strikethrough-Annotation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ To enable the mode from UI, click the below icon in the default toolbar of [PdfV
1717

1818
If you are using [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) control, or your own toolbar, or if you want enable the mode programmatically, change the [AnnotationMode](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_AnnotationMode) property of PDF Viewer to **Strikethrough**, as shown in the below code example.
1919

20+
N> From version 19.4.0.48, we have updated our default text extraction engine to PDFium for extracting text information from PDF documents. Based on the text information, we create text markup annotations in the PDF documents.
21+
2022
{% tabs %}
2123
{% highlight C# %}
2224

wpf/Pdf-Viewer/Working-with-Annotations/Underline-Annotation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ To enable the mode from UI, click the below icon in the default toolbar of [PdfV
1717

1818
If you are using [PdfDocumentView](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfDocumentView.html) control, or your own toolbar, or if you want enable the mode programmatically, change the [AnnotationMode](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_PdfViewer_PdfViewerControl_AnnotationMode) property of PDF Viewer to **Underline**, as shown in the below code example.
1919

20+
N> From version 19.4.0.48, we have updated our default text extraction engine to PDFium for extracting text information from PDF documents. Based on the text information, we create text markup annotations in the PDF documents.
21+
2022
{% tabs %}
2123
{% highlight C# %}
2224

0 commit comments

Comments
 (0)