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..687a262 --- /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/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); +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