Skip to content

Commit fc7357f

Browse files
committed
897679: committed the changes regarding text search sample
1 parent 489b971 commit fc7357f

File tree

12 files changed

+260
-0
lines changed

12 files changed

+260
-0
lines changed

How to/TextSearch/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
6+
# local env files
7+
.env.local
8+
.env.*.local
9+
10+
# Log files
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# Editor directories and files
17+
.idea
18+
.vscode
19+
*.suo
20+
*.ntvs*
21+
*.njsproj
22+
*.sln
23+
*.sw?

How to/TextSearch/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# quickstart
2+
3+
## Project setup
4+
```
5+
npm install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
npm run serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
npm run build
16+
```
17+
18+
### Lints and fixes files
19+
```
20+
npm run lint
21+
```
22+
23+
### Customize configuration
24+
See [Configuration Reference](https://cli.vuejs.org/config/).

How to/TextSearch/babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

How to/TextSearch/jsconfig.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "esnext",
5+
"baseUrl": "./",
6+
"moduleResolution": "node",
7+
"paths": {
8+
"@/*": [
9+
"src/*"
10+
]
11+
},
12+
"lib": [
13+
"esnext",
14+
"dom",
15+
"dom.iterable",
16+
"scripthost"
17+
]
18+
}
19+
}

How to/TextSearch/package.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "quickstart",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"lint": "vue-cli-service lint"
9+
},
10+
"dependencies": {
11+
"@syncfusion/ej2-vue-pdfviewer": "*",
12+
"core-js": "^3.8.3",
13+
"vue": "^2.7.16"
14+
},
15+
"devDependencies": {
16+
"@babel/core": "^7.12.16",
17+
"@babel/eslint-parser": "^7.12.16",
18+
"@vue/cli-plugin-babel": "~5.0.0",
19+
"@vue/cli-plugin-eslint": "~5.0.0",
20+
"@vue/cli-service": "~5.0.0",
21+
"eslint": "^7.32.0",
22+
"eslint-plugin-vue": "^8.0.3",
23+
"vue-template-compiler": "^2.7.16"
24+
},
25+
"eslintConfig": {
26+
"root": true,
27+
"env": {
28+
"node": true
29+
},
30+
"extends": [
31+
"plugin:vue/essential",
32+
"eslint:recommended"
33+
],
34+
"parserOptions": {
35+
"parser": "@babel/eslint-parser"
36+
},
37+
"rules": {}
38+
},
39+
"browserslist": [
40+
"> 1%",
41+
"last 2 versions",
42+
"not dead"
43+
]
44+
}

How to/TextSearch/public/favicon.ico

4.19 KB
Binary file not shown.

How to/TextSearch/public/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title><%= htmlWebpackPlugin.options.title %></title>
9+
</head>
10+
<body>
11+
<noscript>
12+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13+
</noscript>
14+
<br><br><br>
15+
<div id="app"></div>
16+
<!-- built files will be auto injected -->
17+
</body>
18+
</html>

How to/TextSearch/src/App.vue

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<template>
2+
<div id="app">
3+
<button v-on:click="findTextBounds">FindTextBounds</button>
4+
<ejs-pdfviewer
5+
id="pdfViewer"
6+
ref="pdfviewer"
7+
:documentPath="documentPath"
8+
:resourceUrl="resourceUrl">
9+
</ejs-pdfviewer>
10+
</div>
11+
</template>
12+
13+
<script>
14+
import Vue from 'vue';
15+
import { PdfViewerPlugin, Toolbar, Magnification, Navigation,
16+
LinkAnnotation, BookmarkView, Annotation, ThumbnailView,
17+
Print, TextSelection, TextSearch, FormFields, FormDesigner,PageOrganizer } from '@syncfusion/ej2-vue-pdfviewer';
18+
Vue.use(PdfViewerPlugin);
19+
20+
export default {
21+
name: 'app',
22+
data () {
23+
return {
24+
resourceUrl:"https://cdn.syncfusion.com/ej2/24.1.41/dist/ej2-pdfviewer-lib",
25+
documentPath:"https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
26+
};
27+
},
28+
provide: {
29+
PdfViewer: [ Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, Annotation,
30+
ThumbnailView, Print, TextSelection, TextSearch, FormFields, FormDesigner, PageOrganizer ]},
31+
32+
methods: {
33+
findTextBounds: function () {
34+
var viewer = this.$refs.pdfviewer.ej2Instances;
35+
// Find and get the bounds of a text
36+
console.log(viewer.textSearch.findText('adobe', false));
37+
// Find and get the bounds of a text on the desired page
38+
console.log(viewer.textSearch.findText('adobe', false, 7));
39+
// Find and get the bounds of the list of text
40+
console.log(viewer.textSearch.findText(['adobe', 'pdf'], false));
41+
// Find and get the bounds of the list of text on desired page
42+
console.log(viewer.textSearch.findText(['adobe', 'pdf'], false, 7));
43+
}
44+
}
45+
}
46+
</script>
47+
48+
<style>
49+
@import "../node_modules/@syncfusion/ej2-base/styles/material.css";
50+
@import "../node_modules/@syncfusion/ej2-buttons/styles/material.css";
51+
@import "../node_modules/@syncfusion/ej2-dropdowns/styles/material.css";
52+
@import "../node_modules/@syncfusion/ej2-inputs/styles/material.css";
53+
@import "../node_modules/@syncfusion/ej2-navigations/styles/material.css";
54+
@import "../node_modules/@syncfusion/ej2-popups/styles/material.css";
55+
@import "../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css";
56+
@import "../node_modules/@syncfusion/ej2-vue-pdfviewer/styles/material.css";
57+
</style>

How to/TextSearch/src/assets/logo.png

6.69 KB
Loading
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<template>
2+
<div class="hello">
3+
<h1>{{ msg }}</h1>
4+
<p>
5+
For a guide and recipes on how to configure / customize this project,<br>
6+
check out the
7+
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
8+
</p>
9+
<h3>Installed CLI Plugins</h3>
10+
<ul>
11+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
12+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
13+
</ul>
14+
<h3>Essential Links</h3>
15+
<ul>
16+
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
17+
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
18+
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
19+
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
20+
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
21+
</ul>
22+
<h3>Ecosystem</h3>
23+
<ul>
24+
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
25+
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
26+
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
27+
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
28+
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
29+
</ul>
30+
</div>
31+
</template>
32+
33+
<script>
34+
export default {
35+
name: 'HelloWorld',
36+
props: {
37+
msg: String
38+
}
39+
}
40+
</script>
41+
42+
<!-- Add "scoped" attribute to limit CSS to this component only -->
43+
<style scoped>
44+
h3 {
45+
margin: 40px 0 0;
46+
}
47+
ul {
48+
list-style-type: none;
49+
padding: 0;
50+
}
51+
li {
52+
display: inline-block;
53+
margin: 0 10px;
54+
}
55+
a {
56+
color: #42b983;
57+
}
58+
</style>

How to/TextSearch/src/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Vue from 'vue'
2+
import App from './App.vue'
3+
4+
Vue.config.productionTip = false
5+
6+
new Vue({
7+
render: h => h(App),
8+
}).$mount('#app')

How to/TextSearch/vue.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const { defineConfig } = require('@vue/cli-service')
2+
module.exports = defineConfig({
3+
transpileDependencies: true
4+
})

0 commit comments

Comments
 (0)