From 85e309be4e1a2c760fc7259356adf2cfb24c7778 Mon Sep 17 00:00:00 2001 From: GiriSF4292 Date: Fri, 20 Sep 2024 12:55:30 +0530 Subject: [PATCH 1/2] 897679: committed the changes regarding text search sample --- How to/TextSearch/index.html | 39 ++++++++++++++++++++++++++++++++++++ How to/TextSearch/index.js | 17 ++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 How to/TextSearch/index.html create mode 100644 How to/TextSearch/index.js diff --git a/How to/TextSearch/index.html b/How to/TextSearch/index.html new file mode 100644 index 0000000..925dfa1 --- /dev/null +++ b/How to/TextSearch/index.html @@ -0,0 +1,39 @@ + + EJ2 PDF Viewer + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + + \ No newline at end of file diff --git a/How to/TextSearch/index.js b/How to/TextSearch/index.js new file mode 100644 index 0000000..0f11757 --- /dev/null +++ b/How to/TextSearch/index.js @@ -0,0 +1,17 @@ +var pdfviewer = new ej.pdfviewer.PdfViewer({ + documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', + // resourceUrl:'https://cdn.syncfusion.com/ej2/24.2.3/dist/ej2-pdfviewer-lib' +}); +ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, + ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer); +pdfviewer.appendTo('#PdfViewer'); +document.getElementById('textbounds').addEventListener('click', function () { + // Find and get the bounds of a text + console.log(pdfviewer.textSearch.findText('adobe', false)); + // Find and get the bounds of a text on the desired page + console.log(pdfviewer.textSearch.findText('adobe', false, 7)); + // Find and get the bounds of the list of text + console.log(pdfviewer.textSearch.findText(['adobe', 'pdf'], false)); + // Find and get the bounds of the list of text on desired page + console.log(pdfviewer.textSearch.findText(['adobe', 'pdf'], false, 7)); +}); \ No newline at end of file From 151d249fa9135cae7b3071486e9fa85833b2ecda Mon Sep 17 00:00:00 2001 From: GiriSF4292 Date: Wed, 25 Sep 2024 18:19:36 +0530 Subject: [PATCH 2/2] 897679: used the latest version --- How to/TextSearch/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/How to/TextSearch/index.js b/How to/TextSearch/index.js index 0f11757..687a262 100644 --- a/How to/TextSearch/index.js +++ b/How to/TextSearch/index.js @@ -1,6 +1,6 @@ var pdfviewer = new ej.pdfviewer.PdfViewer({ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - // resourceUrl:'https://cdn.syncfusion.com/ej2/24.2.3/dist/ej2-pdfviewer-lib' + resourceUrl:'https://cdn.syncfusion.com/ej2/27.1.48/dist/ej2-pdfviewer-lib' }); ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields, ej.pdfviewer.PageOrganizer);