@@ -22,35 +22,36 @@ The following code snippet shows how to get the bounds of the specified text:
2222{% tabs %}
2323{% highlight ts tabtitle="Standalone" %}
2424
25- import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
26- TextSelection, TextSearch, Print, Annotation,FormFields,FormDesigner, PageOrganizer} from "../src/index";
25+ import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageInfoModel } from '@syncfusion/ej2-pdfviewer ';
2726
28- PdfViewer. Inject(Toolbar,Magnification,Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
29- TextSelection, TextSearch, Print, Annotation,FormFields, FormDesigner, PageOrganizer );
27+ // Inject required modules
28+ PdfViewer.Inject( TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields );
3029
31- let viewer: PdfViewer = new PdfViewer();
32- viewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
33- document.getElementById('textbounds').addEventListener('click', function() {
34- console.log(viewer.textSearch.findText('pdf', false));
35- });
36- viewer.appendTo("#pdfViewer");
30+ const viewer: PdfViewer = new PdfViewer({
31+ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf ',
32+ resourceUrl: "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib ",
33+ });
34+ viewer.appendTo("#pdfViewer");
35+ document.getElementById('textbounds')?.addEventListener('click', function() {
36+ console.log(viewer.textSearch.findText('pdf', false));
37+ });
3738
3839{% endhighlight %}
3940{% highlight ts tabtitle="Server-backed" %}
4041
41- import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
42- TextSelection, TextSearch, Print, Annotation,FormFields,FormDesigner, PageOrganizer} from "../src/index";
42+ import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageInfoModel } from '@syncfusion/ej2-pdfviewer ';
4343
44- PdfViewer. Inject(Toolbar,Magnification,Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
45- TextSelection, TextSearch, Print, Annotation,FormFields, FormDesigner, PageOrganizer );
44+ // Inject required modules
45+ PdfViewer.Inject( TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields );
4646
47- let viewer: PdfViewer = new PdfViewer();
48- viewer.serviceUrl = "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer";
49- viewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
50- document.getElementById('textbounds').addEventListener('click', function() {
51- console.log(viewer.textSearch.findText('pdf', false));
52- });
53- viewer.appendTo("#pdfViewer");
47+ const viewer: PdfViewer = new PdfViewer({
48+ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf ',
49+ serviceUrl: "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer ",
50+ });
51+ viewer.appendTo("#pdfViewer");
52+ document.getElementById('textbounds')?.addEventListener('click', function() {
53+ console.log(viewer.textSearch.findText('pdf', false));
54+ });
5455
5556{% endhighlight %}
5657{% endtabs %}
@@ -66,35 +67,36 @@ The following code snippet shows how to retrieve bounds for the specified text o
6667{% tabs %}
6768{% highlight ts tabtitle="Standalone" %}
6869
69- import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
70- TextSelection, TextSearch, Print, Annotation,FormFields,FormDesigner, PageOrganizer} from "../src/index";
70+ import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageInfoModel } from '@syncfusion/ej2-pdfviewer ';
7171
72- PdfViewer. Inject(Toolbar,Magnification,Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
73- TextSelection, TextSearch, Print, Annotation,FormFields, FormDesigner, PageOrganizer );
72+ // Inject required modules
73+ PdfViewer.Inject( TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields );
7474
75- let viewer: PdfViewer = new PdfViewer();
76- viewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
77- document.getElementById('textbounds').addEventListener('click', function() {
75+ const viewer: PdfViewer = new PdfViewer({
76+ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf ',
77+ resourceUrl: "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib ",
78+ });
79+ viewer.appendTo("#pdfViewer");
80+ document.getElementById('textbounds')?.addEventListener('click', function() {
7881 console.log(viewer.textSearch.findText('pdf', false, 7));
79- });
80- viewer.appendTo("#pdfViewer");
82+ });
8183
8284{% endhighlight %}
8385{% highlight ts tabtitle="Server-backed" %}
8486
85- import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
86- TextSelection, TextSearch, Print, Annotation,FormFields,FormDesigner, PageOrganizer} from "../src/index";
87+ import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageInfoModel } from '@syncfusion/ej2-pdfviewer ';
8788
88- PdfViewer. Inject(Toolbar,Magnification,Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
89- TextSelection, TextSearch, Print, Annotation,FormFields, FormDesigner, PageOrganizer );
89+ // Inject required modules
90+ PdfViewer.Inject( TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields );
9091
91- let viewer: PdfViewer = new PdfViewer();
92- viewer.serviceUrl = "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer";
93- viewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
94- document.getElementById('textbounds').addEventListener('click', function() {
92+ const viewer: PdfViewer = new PdfViewer({
93+ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf ',
94+ serviceUrl: "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer ",
95+ });
96+ viewer.appendTo("#pdfViewer");
97+ document.getElementById('textbounds')?.addEventListener('click', function() {
9598 console.log(viewer.textSearch.findText('pdf', false, 7));
96- });
97- viewer.appendTo("#pdfViewer");
99+ });
98100
99101{% endhighlight %}
100102{% endtabs %}
@@ -109,35 +111,36 @@ Searches for an array of strings within the document and returns the bounding re
109111{% tabs %}
110112{% highlight ts tabtitle="Standalone" %}
111113
112- import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
113- TextSelection, TextSearch, Print, Annotation,FormFields,FormDesigner, PageOrganizer} from "../src/index";
114+ import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageInfoModel } from '@syncfusion/ej2-pdfviewer ';
114115
115- PdfViewer. Inject(Toolbar,Magnification,Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
116- TextSelection, TextSearch, Print, Annotation,FormFields, FormDesigner, PageOrganizer );
116+ // Inject required modules
117+ PdfViewer.Inject( TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields );
117118
118- let viewer: PdfViewer = new PdfViewer();
119- viewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
120- document.getElementById('textbounds').addEventListener('click', function() {
121- console.log(viewer.textSearch.findText(['adobe', 'pdf'], false));
122- });
123- viewer.appendTo("#pdfViewer");
119+ const viewer: PdfViewer = new PdfViewer({
120+ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf ',
121+ resourceUrl: "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib ",
122+ });
123+ viewer.appendTo("#pdfViewer");
124+ document.getElementById('textbounds')?.addEventListener('click', function() {
125+ console.log(viewer.textSearch.findText([ 'adobe', 'pdf'] , false));
126+ });
124127
125128{% endhighlight %}
126129{% highlight ts tabtitle="Server-backed" %}
127130
128- import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
129- TextSelection, TextSearch, Print, Annotation,FormFields,FormDesigner, PageOrganizer} from "../src/index";
131+ import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageInfoModel } from '@syncfusion/ej2-pdfviewer ';
130132
131- PdfViewer. Inject(Toolbar,Magnification,Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
132- TextSelection, TextSearch, Print, Annotation,FormFields, FormDesigner, PageOrganizer );
133+ // Inject required modules
134+ PdfViewer.Inject( TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields );
133135
134- let viewer: PdfViewer = new PdfViewer();
135- viewer.serviceUrl = "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer";
136- viewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
137- document.getElementById('listTextbounds').addEventListener('click', function() {
138- console.log(viewer.textSearch.findText(['adobe', 'pdf'], false));
139- });
140- viewer.appendTo("#pdfViewer");
136+ const viewer: PdfViewer = new PdfViewer({
137+ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf ',
138+ serviceUrl: "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer ",
139+ });
140+ viewer.appendTo("#pdfViewer");
141+ document.getElementById('textbounds')?.addEventListener('click', function() {
142+ console.log(viewer.textSearch.findText([ 'adobe', 'pdf'] , false));
143+ });
141144
142145{% endhighlight %}
143146{% endtabs %}
@@ -152,35 +155,46 @@ Searches for an array of strings within the document and returns the bounding re
152155{% tabs %}
153156{% highlight ts tabtitle="Standalone" %}
154157
155- import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
156- TextSelection, TextSearch, Print, Annotation,FormFields,FormDesigner, PageOrganizer} from "../src/index";
158+ import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageInfoModel } from '@syncfusion/ej2-pdfviewer ';
157159
158- PdfViewer. Inject(Toolbar,Magnification,Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
159- TextSelection, TextSearch, Print, Annotation,FormFields, FormDesigner, PageOrganizer );
160+ // Inject required modules
161+ PdfViewer.Inject( TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields );
160162
161- let viewer: PdfViewer = new PdfViewer();
162- viewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
163- document.getElementById('textbounds').addEventListener('click', function() {
163+ const viewer: PdfViewer = new PdfViewer({
164+ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf ',
165+ resourceUrl: "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib ",
166+ });
167+ viewer.appendTo("#pdfViewer");
168+ document.getElementById('textbounds')?.addEventListener('click', function() {
164169 console.log(viewer.textSearch.findText([ 'adobe', 'pdf'] , false, 7));
165170 });
166- viewer.appendTo("#pdfViewer");
167171
168172{% endhighlight %}
169173{% highlight ts tabtitle="Server-backed" %}
170174
171- import { PdfViewer, Toolbar, Magnification, Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
172- TextSelection, TextSearch, Print, Annotation,FormFields,FormDesigner, PageOrganizer} from "../src/index";
175+ import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageInfoModel } from '@syncfusion/ej2-pdfviewer ';
173176
174- PdfViewer. Inject(Toolbar,Magnification,Navigation, LinkAnnotation,ThumbnailView,BookmarkView,
175- TextSelection, TextSearch, Print, Annotation,FormFields, FormDesigner, PageOrganizer );
177+ // Inject required modules
178+ PdfViewer.Inject( TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields );
176179
177- let viewer: PdfViewer = new PdfViewer();
178- viewer.serviceUrl = "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer";
179- viewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
180- document.getElementById('listTextbounds').addEventListener('click', function() {
180+ const viewer: PdfViewer = new PdfViewer({
181+ documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf ',
182+ serviceUrl: "https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer ",
183+ });
184+ viewer.appendTo("#pdfViewer");
185+ document.getElementById('textbounds')?.addEventListener('click', function() {
181186 console.log(viewer.textSearch.findText([ 'adobe', 'pdf'] , false, 7));
182187 });
183- viewer.appendTo("#pdfViewer");
184188
185189{% endhighlight %}
186190{% endtabs %}
191+
192+ [ View Sample in GitHub] ( https://github.com/SyncfusionExamples/typescript-pdf-viewer-examples )
193+
194+ ## See Also
195+
196+ [ Text Search Features] ( ./text-search-features )
197+ [ Text Search Events] ( ./text-search-events )
198+ [ Extract Text] ( ../how-to/extract-text-ts )
199+ [ Extract Text Options] ( ../how-to/extract-text-option-ts )
200+ [ Extract Text Completed] ( ../how-to/extract-text-completed-ts )
0 commit comments