From 6d611f86d99e3989881e396d1cfd9886f4ed2418 Mon Sep 17 00:00:00 2001 From: SF4524LogeshKumar Date: Fri, 19 Dec 2025 13:47:28 +0530 Subject: [PATCH 1/3] 996399: Text Search Sample --- .../Find Text/.gitignore | 2 + .../Find Text/README.md | 75 ++++++++++++++++++ .../Find Text/e2e/index.spec.js | 0 .../Find Text/e2e/protractor.conf.js | 21 +++++ .../Find Text/gulpfile.js | 62 +++++++++++++++ Text Search and Extraction/Find Text/license | 10 +++ .../Find Text/package.json | 38 +++++++++ .../Find Text/src/app/app.ts | 51 ++++++++++++ .../Find Text/src/index.html | 28 +++++++ .../Find Text/src/resources/favicon.ico | Bin 0 -> 6574 bytes .../Find Text/src/styles/styles.css | 9 +++ .../Find Text/tsconfig.json | 12 +++ .../Find Text/webpack.config.js | 41 ++++++++++ 13 files changed, 349 insertions(+) create mode 100644 Text Search and Extraction/Find Text/.gitignore create mode 100644 Text Search and Extraction/Find Text/README.md create mode 100644 Text Search and Extraction/Find Text/e2e/index.spec.js create mode 100644 Text Search and Extraction/Find Text/e2e/protractor.conf.js create mode 100644 Text Search and Extraction/Find Text/gulpfile.js create mode 100644 Text Search and Extraction/Find Text/license create mode 100644 Text Search and Extraction/Find Text/package.json create mode 100644 Text Search and Extraction/Find Text/src/app/app.ts create mode 100644 Text Search and Extraction/Find Text/src/index.html create mode 100644 Text Search and Extraction/Find Text/src/resources/favicon.ico create mode 100644 Text Search and Extraction/Find Text/src/styles/styles.css create mode 100644 Text Search and Extraction/Find Text/tsconfig.json create mode 100644 Text Search and Extraction/Find Text/webpack.config.js diff --git a/Text Search and Extraction/Find Text/.gitignore b/Text Search and Extraction/Find Text/.gitignore new file mode 100644 index 0000000..1eae0cf --- /dev/null +++ b/Text Search and Extraction/Find Text/.gitignore @@ -0,0 +1,2 @@ +dist/ +node_modules/ diff --git a/Text Search and Extraction/Find Text/README.md b/Text Search and Extraction/Find Text/README.md new file mode 100644 index 0000000..46e0b02 --- /dev/null +++ b/Text Search and Extraction/Find Text/README.md @@ -0,0 +1,75 @@ +# Essential JS 2 QuickStart + +This project is a skeleton application used to create [Essential JS 2](https://www.syncfusion.com/products/essential-js2) web application. + +>This application uses the latest version of the [webpack-cli](https://webpack.js.org/api/cli/#commands). It requires node `v14.15.0` or higher. + +## Getting Started + +To get started you need to clone the `ej2-quickstart` repository and navigate to `ej2-quickstart` location. + +``` +git clone https://github.com/syncfusion/ej2-quickstart.git quickstart +cd quickstart +``` + +## Installing + +We can get all the Essential JS 2 components in a single npm package [`ej2`](https://www.npmjs.com/package/@syncfusion/ej2). + +We already configure the required packages in the `package.json` file. + +You can run the below command to install all dependent packages related to this seed project. + +``` +npm install +``` + +## Testing + +This application is preconfigured with End-to-End testing and the test case is written in Jasmine. + +We run the test scripts with [Protractor](http://www.protractortest.org/#/) end-to-end test runner. The test case file can be found in the `e2e` folder. + +Protractor can interact with our web application and verify the test scripts. + +We have to install WebDriver and also need to ensure it is updated. Open a separate terminal and run the below npm script. + +``` +npm run update-webdriver +``` + +Open another terminal and run the below npm script. It will start web server to serve our application. + +``` +npm run serve +``` + +Once the web server is up and running, we can run the end-to-end tests using the below npm script + +``` +npm run test +``` + +> **Note:** Since Protractor is using the Selenium Standalone Server, the Java Development Kit (JDK) need to be installed in your local machine. + +If JDK is not installed in your local machine, you can download it from [here](http://www.oracle.com/technetwork/java/javase/downloads/index.html). + +## Running + +The application is configured with [webpack-dev-server](https://webpack.js.org/configuration/dev-server/#devserver), so it will serve the web application in your default browser. + +We have used [Webpack](https://github.com/webpack/webpack) for module loading. + +You can use the below npm script to run the web application. + +``` +npm run start +``` + +## Resources + +You can also refer the below resources to know more details about Essential JS 2 components. + +* [Pure JS Demos](http://ej2.syncfusion.com/demos/) +* [Pure JS Documentation](http://ej2.syncfusion.com/documentation/) diff --git a/Text Search and Extraction/Find Text/e2e/index.spec.js b/Text Search and Extraction/Find Text/e2e/index.spec.js new file mode 100644 index 0000000..e69de29 diff --git a/Text Search and Extraction/Find Text/e2e/protractor.conf.js b/Text Search and Extraction/Find Text/e2e/protractor.conf.js new file mode 100644 index 0000000..43eee1b --- /dev/null +++ b/Text Search and Extraction/Find Text/e2e/protractor.conf.js @@ -0,0 +1,21 @@ +exports.config = { + + allScriptsTimeout: 11000, + + capabilities: { + 'browserName': 'chrome' + }, + + framework: 'jasmine', + + jasmineNodeOpts: { + defaultTimeoutInterval: 10000 + }, + directConnect: true, + + onPrepare: function() { + browser.waitForAngularEnabled(false); + }, + + specs: ['./*.spec.js'] +}; \ No newline at end of file diff --git a/Text Search and Extraction/Find Text/gulpfile.js b/Text Search and Extraction/Find Text/gulpfile.js new file mode 100644 index 0000000..6a623f3 --- /dev/null +++ b/Text Search and Extraction/Find Text/gulpfile.js @@ -0,0 +1,62 @@ +'use strict'; + +var gulp = require('gulp'); + +/** + * Compile TypeScript to JS + */ +gulp.task('compile', function (done) { + var webpack = require('webpack'); + var webpackStream = require('webpack-stream'); + gulp.src(['./src/app/app.ts']).pipe(webpackStream({ + config: require('./webpack.config.js') + }, webpack)) + .pipe(gulp.dest('./dist')) + .on('end', function () { + done(); + }); +}); + +/** + * Testing spec files + */ +var protractor = require('gulp-protractor').protractor; +var webdriver_standalone = require('gulp-protractor').webdriver_standalone; +var webdriver_update = require('gulp-protractor').webdriver_update_specific; + +gulp.task('e2e-serve', webdriver_standalone); + +gulp.task('e2e-webdriver-update', webdriver_update({ + webdriverManagerArgs: ['--ie', '--edge'] +})); + +gulp.task('e2e-test', gulp.series('compile', function (done) { + var browserSync = require('browser-sync'); + var bs = browserSync.create('Essential JS 2'); + var options = { + server: { + baseDir: [ + './dist/', + ], + directory: true + }, + ui: false, + open: false, + notify: false + }; + bs.init(options, function () { + gulp.src(['./spec/**/*.spec.js']) + .pipe(protractor({ + configFile: 'e2e/protractor.conf.js' + })) + .on('error', function (e) { + console.error('Error: ' + e.message); + done(); + process.exit(1); + }) + .on('end', function () { + done(); + process.exit(0); + }); + }); +})); \ No newline at end of file diff --git a/Text Search and Extraction/Find Text/license b/Text Search and Extraction/Find Text/license new file mode 100644 index 0000000..111c12a --- /dev/null +++ b/Text Search and Extraction/Find Text/license @@ -0,0 +1,10 @@ +Essential JS 2 library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license. + +To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions. + +Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options. + +Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions. + +The Syncfusion license that contains the terms and conditions can be found at +https://www.syncfusion.com/content/downloads/syncfusion_license.pdf diff --git a/Text Search and Extraction/Find Text/package.json b/Text Search and Extraction/Find Text/package.json new file mode 100644 index 0000000..f108444 --- /dev/null +++ b/Text Search and Extraction/Find Text/package.json @@ -0,0 +1,38 @@ +{ + "name": "ej2-quickstart", + "version": "0.0.1", + "description": "Essential JS 2 typescript quick start application", + "author": "Syncfusion Inc.", + "license": "SEE LICENSE IN license", + "repository": { + "type": "git", + "url": "https://github.com/syncfusion/ej2-quickstart.git" + }, + "scripts": { + "start": "webpack-dev-server --mode development", + "build": "webpack --mode production", + "serve": "gulp e2e-serve", + "test": "gulp e2e-test", + "update-webdriver": "gulp e2e-webdriver-update" + }, + "devDependencies": { + "ajv": "^8.11.2", + "browser-sync": "^2.18.12", + "gulp": "*", + "typescript": "*", + "gulp-protractor": "*", + "gulp-typescript": "*", + "jasmine": "^2.6.0", + "css-loader": "^6.7.2", + "ts-loader": "^9.4.1", + "mini-css-extract-plugin": "^2.7.0", + "html-webpack-plugin": "^5.5.0", + "webpack": "^5.75.0", + "webpack-cli": "^5.0.0", + "webpack-dev-server": "^5.2.1", + "webpack-stream": "^7.0.0" + }, + "dependencies": { + "@syncfusion/ej2": "*" + } +} diff --git a/Text Search and Extraction/Find Text/src/app/app.ts b/Text Search and Extraction/Find Text/src/app/app.ts new file mode 100644 index 0000000..0e52ee0 --- /dev/null +++ b/Text Search and Extraction/Find Text/src/app/app.ts @@ -0,0 +1,51 @@ +// TypeScript +import { + PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, + Magnification, Annotation, FormDesigner, FormFields +} from '@syncfusion/ej2-pdfviewer'; + +// Inject required modules +PdfViewer.Inject( + TextSelection, TextSearch, Print, Navigation, Toolbar, + Magnification, Annotation, FormDesigner, FormFields +); + +// Pick ONE of the two initialisations below ---------------------------------- +// Stand-alone (client-side) viewer +const viewer: PdfViewer = new PdfViewer({ + documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', + resourceUrl: 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib' +}); +// --------------------------------------------------------------------------- +// Server-backed viewer +/* +const viewer: PdfViewer = new PdfViewer({ + documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', + serviceUrl: 'https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer' +}); +*/ +// --------------------------------------------------------------------------- + +viewer.appendTo('#pdfViewer'); + +// Helper to log a label + result +const log = (label: string, value: any) => console.log(label, value); + +// Button wiring -------------------------------------------------------------- +document.getElementById('btn-all')?.addEventListener('click', () => { + log('findText("pdf", false)', viewer.textSearch.findText('pdf', false)); +}); + +document.getElementById('btn-page')?.addEventListener('click', () => { + log('findText("pdf", false, 7)', viewer.textSearch.findText('pdf', false, 7)); +}); + +document.getElementById('btn-list-all')?.addEventListener('click', () => { + log('findText(["adobe","pdf"], false)', + viewer.textSearch.findText(['adobe', 'pdf'], false)); +}); + +document.getElementById('btn-list-page')?.addEventListener('click', () => { + log('findText(["adobe","pdf"], false, 7)', + viewer.textSearch.findText(['adobe', 'pdf'], false, 7)); +}); \ No newline at end of file diff --git a/Text Search and Extraction/Find Text/src/index.html b/Text Search and Extraction/Find Text/src/index.html new file mode 100644 index 0000000..08587d1 --- /dev/null +++ b/Text Search and Extraction/Find Text/src/index.html @@ -0,0 +1,28 @@ + + + + + Essential JS 2 + + + + + + + + + + +
+ + + + + +
+ + +
+ + + \ No newline at end of file diff --git a/Text Search and Extraction/Find Text/src/resources/favicon.ico b/Text Search and Extraction/Find Text/src/resources/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..d8d5c152e7353a07c3e519c9e53ac9328e515fa8 GIT binary patch literal 6574 zcmeHLZ)jUp6o1J}(=>U>YhL@3w0TL>C8MsL+H`gkEVxdkmO9tb;jBuvbG9p5I^2g+ zoQ_RobEu4M#mx^QI7C|n@y`&)zU<3BbPQB*vVCzdnHEGebfLH<{!U+RdizYC2_~~j z1HasR&O7J+&b{}%bKiS{U=c*2x>`UR5q8-GVZ9(Mk>7TV@$vY-_rFZ=hz7$<%I*YLf(BcUQQv$12qd1n5&7W;6a-9p|6b zEhm49g@-KH`gmCjM%xIyj%eKs>3FcY z7n(o3J#i>co_LArxZI=s%9(%6R(@pPpgxCWiu%Ry6DQk0y}gm7yr6rAVRyV~hT>x~ zwUqzFqjN9j0FA-VgT-jp@-Yrp@Q=->eJHEXYL9=tkj!kdk!e*gDhmYScQgOFnb;OE~-vz&&w zQajg1Pn+N~)SZTV{K{q%o6~)<&}%H8s9lI*l^4D+KY9dvo5Ozg=*(Ki>YA>-a|SZ~p!SYpRMR literal 0 HcmV?d00001 diff --git a/Text Search and Extraction/Find Text/src/styles/styles.css b/Text Search and Extraction/Find Text/src/styles/styles.css new file mode 100644 index 0000000..c5d413e --- /dev/null +++ b/Text Search and Extraction/Find Text/src/styles/styles.css @@ -0,0 +1,9 @@ +@import '../../node_modules/@syncfusion/ej2-base/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-buttons/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-dropdowns/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-inputs/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-navigations/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-popups/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css'; +@import "../../node_modules/@syncfusion/ej2-pdfviewer/styles/material.css"; +@import "../../node_modules/@syncfusion/ej2-notifications/styles/material.css"; \ No newline at end of file diff --git a/Text Search and Extraction/Find Text/tsconfig.json b/Text Search and Extraction/Find Text/tsconfig.json new file mode 100644 index 0000000..db9b7c2 --- /dev/null +++ b/Text Search and Extraction/Find Text/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es2016", + "module": "ES6", + "sourceMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "moduleResolution": "node" + } +} diff --git a/Text Search and Extraction/Find Text/webpack.config.js b/Text Search and Extraction/Find Text/webpack.config.js new file mode 100644 index 0000000..f61e596 --- /dev/null +++ b/Text Search and Extraction/Find Text/webpack.config.js @@ -0,0 +1,41 @@ +const HtmlWebpackPlugin = require("html-webpack-plugin"); +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const path = require('path'); + +module.exports = { + entry: ['./src/app/app.ts', './src/styles/styles.css'], + module: { + rules: [ + { + test: /\.ts?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /\.css$/, + use: [ MiniCssExtractPlugin.loader, "css-loader" ] + }, + ], + }, + resolve: { + extensions: ['.ts', '.js'], + }, + output: { + filename: 'bundle.js', + path: path.resolve(__dirname, 'dist'), + }, + plugins: [ + new HtmlWebpackPlugin({ + template: 'src/index.html' + }), + new MiniCssExtractPlugin({ + filename: "bundle.css" + }) + ], + devServer: { + static: path.join(__dirname, "dist"), + compress: true, + port: 4000, + open: true + }, +}; From 307b1c50b9865290213412e5e81fae571b0503cb Mon Sep 17 00:00:00 2001 From: SF4524LogeshKumar Date: Fri, 19 Dec 2025 13:56:58 +0530 Subject: [PATCH 2/3] 996399: Updated Sample for Text Search Events --- .../Text Search Events/.gitignore | 2 + .../Text Search Events/README.md | 75 ++++++++++++++++++ .../Text Search Events/e2e/index.spec.js | 0 .../Text Search Events/e2e/protractor.conf.js | 21 +++++ .../Text Search Events/gulpfile.js | 62 +++++++++++++++ .../Text Search Events/license | 10 +++ .../Text Search Events/package.json | 38 +++++++++ .../Text Search Events/src/app/app.ts | 56 +++++++++++++ .../Text Search Events/src/index.html | 33 ++++++++ .../src/resources/favicon.ico | Bin 0 -> 6574 bytes .../Text Search Events/src/styles/styles.css | 9 +++ .../Text Search Events/tsconfig.json | 12 +++ .../Text Search Events/webpack.config.js | 41 ++++++++++ 13 files changed, 359 insertions(+) create mode 100644 Text Search and Extraction/Text Search Events/.gitignore create mode 100644 Text Search and Extraction/Text Search Events/README.md create mode 100644 Text Search and Extraction/Text Search Events/e2e/index.spec.js create mode 100644 Text Search and Extraction/Text Search Events/e2e/protractor.conf.js create mode 100644 Text Search and Extraction/Text Search Events/gulpfile.js create mode 100644 Text Search and Extraction/Text Search Events/license create mode 100644 Text Search and Extraction/Text Search Events/package.json create mode 100644 Text Search and Extraction/Text Search Events/src/app/app.ts create mode 100644 Text Search and Extraction/Text Search Events/src/index.html create mode 100644 Text Search and Extraction/Text Search Events/src/resources/favicon.ico create mode 100644 Text Search and Extraction/Text Search Events/src/styles/styles.css create mode 100644 Text Search and Extraction/Text Search Events/tsconfig.json create mode 100644 Text Search and Extraction/Text Search Events/webpack.config.js diff --git a/Text Search and Extraction/Text Search Events/.gitignore b/Text Search and Extraction/Text Search Events/.gitignore new file mode 100644 index 0000000..1eae0cf --- /dev/null +++ b/Text Search and Extraction/Text Search Events/.gitignore @@ -0,0 +1,2 @@ +dist/ +node_modules/ diff --git a/Text Search and Extraction/Text Search Events/README.md b/Text Search and Extraction/Text Search Events/README.md new file mode 100644 index 0000000..46e0b02 --- /dev/null +++ b/Text Search and Extraction/Text Search Events/README.md @@ -0,0 +1,75 @@ +# Essential JS 2 QuickStart + +This project is a skeleton application used to create [Essential JS 2](https://www.syncfusion.com/products/essential-js2) web application. + +>This application uses the latest version of the [webpack-cli](https://webpack.js.org/api/cli/#commands). It requires node `v14.15.0` or higher. + +## Getting Started + +To get started you need to clone the `ej2-quickstart` repository and navigate to `ej2-quickstart` location. + +``` +git clone https://github.com/syncfusion/ej2-quickstart.git quickstart +cd quickstart +``` + +## Installing + +We can get all the Essential JS 2 components in a single npm package [`ej2`](https://www.npmjs.com/package/@syncfusion/ej2). + +We already configure the required packages in the `package.json` file. + +You can run the below command to install all dependent packages related to this seed project. + +``` +npm install +``` + +## Testing + +This application is preconfigured with End-to-End testing and the test case is written in Jasmine. + +We run the test scripts with [Protractor](http://www.protractortest.org/#/) end-to-end test runner. The test case file can be found in the `e2e` folder. + +Protractor can interact with our web application and verify the test scripts. + +We have to install WebDriver and also need to ensure it is updated. Open a separate terminal and run the below npm script. + +``` +npm run update-webdriver +``` + +Open another terminal and run the below npm script. It will start web server to serve our application. + +``` +npm run serve +``` + +Once the web server is up and running, we can run the end-to-end tests using the below npm script + +``` +npm run test +``` + +> **Note:** Since Protractor is using the Selenium Standalone Server, the Java Development Kit (JDK) need to be installed in your local machine. + +If JDK is not installed in your local machine, you can download it from [here](http://www.oracle.com/technetwork/java/javase/downloads/index.html). + +## Running + +The application is configured with [webpack-dev-server](https://webpack.js.org/configuration/dev-server/#devserver), so it will serve the web application in your default browser. + +We have used [Webpack](https://github.com/webpack/webpack) for module loading. + +You can use the below npm script to run the web application. + +``` +npm run start +``` + +## Resources + +You can also refer the below resources to know more details about Essential JS 2 components. + +* [Pure JS Demos](http://ej2.syncfusion.com/demos/) +* [Pure JS Documentation](http://ej2.syncfusion.com/documentation/) diff --git a/Text Search and Extraction/Text Search Events/e2e/index.spec.js b/Text Search and Extraction/Text Search Events/e2e/index.spec.js new file mode 100644 index 0000000..e69de29 diff --git a/Text Search and Extraction/Text Search Events/e2e/protractor.conf.js b/Text Search and Extraction/Text Search Events/e2e/protractor.conf.js new file mode 100644 index 0000000..43eee1b --- /dev/null +++ b/Text Search and Extraction/Text Search Events/e2e/protractor.conf.js @@ -0,0 +1,21 @@ +exports.config = { + + allScriptsTimeout: 11000, + + capabilities: { + 'browserName': 'chrome' + }, + + framework: 'jasmine', + + jasmineNodeOpts: { + defaultTimeoutInterval: 10000 + }, + directConnect: true, + + onPrepare: function() { + browser.waitForAngularEnabled(false); + }, + + specs: ['./*.spec.js'] +}; \ No newline at end of file diff --git a/Text Search and Extraction/Text Search Events/gulpfile.js b/Text Search and Extraction/Text Search Events/gulpfile.js new file mode 100644 index 0000000..6a623f3 --- /dev/null +++ b/Text Search and Extraction/Text Search Events/gulpfile.js @@ -0,0 +1,62 @@ +'use strict'; + +var gulp = require('gulp'); + +/** + * Compile TypeScript to JS + */ +gulp.task('compile', function (done) { + var webpack = require('webpack'); + var webpackStream = require('webpack-stream'); + gulp.src(['./src/app/app.ts']).pipe(webpackStream({ + config: require('./webpack.config.js') + }, webpack)) + .pipe(gulp.dest('./dist')) + .on('end', function () { + done(); + }); +}); + +/** + * Testing spec files + */ +var protractor = require('gulp-protractor').protractor; +var webdriver_standalone = require('gulp-protractor').webdriver_standalone; +var webdriver_update = require('gulp-protractor').webdriver_update_specific; + +gulp.task('e2e-serve', webdriver_standalone); + +gulp.task('e2e-webdriver-update', webdriver_update({ + webdriverManagerArgs: ['--ie', '--edge'] +})); + +gulp.task('e2e-test', gulp.series('compile', function (done) { + var browserSync = require('browser-sync'); + var bs = browserSync.create('Essential JS 2'); + var options = { + server: { + baseDir: [ + './dist/', + ], + directory: true + }, + ui: false, + open: false, + notify: false + }; + bs.init(options, function () { + gulp.src(['./spec/**/*.spec.js']) + .pipe(protractor({ + configFile: 'e2e/protractor.conf.js' + })) + .on('error', function (e) { + console.error('Error: ' + e.message); + done(); + process.exit(1); + }) + .on('end', function () { + done(); + process.exit(0); + }); + }); +})); \ No newline at end of file diff --git a/Text Search and Extraction/Text Search Events/license b/Text Search and Extraction/Text Search Events/license new file mode 100644 index 0000000..111c12a --- /dev/null +++ b/Text Search and Extraction/Text Search Events/license @@ -0,0 +1,10 @@ +Essential JS 2 library is available under the Syncfusion Essential Studio program, and can be licensed either under the Syncfusion Community License Program or the Syncfusion commercial license. + +To be qualified for the Syncfusion Community License Program you must have a gross revenue of less than one (1) million U.S. dollars ($1,000,000.00 USD) per year and have less than five (5) developers in your organization, and agree to be bound by Syncfusion’s terms and conditions. + +Customers who do not qualify for the community license can contact sales@syncfusion.com for commercial licensing options. + +Under no circumstances can you use this product without (1) either a Community License or a commercial license and (2) without agreeing and abiding by Syncfusion’s license containing all terms and conditions. + +The Syncfusion license that contains the terms and conditions can be found at +https://www.syncfusion.com/content/downloads/syncfusion_license.pdf diff --git a/Text Search and Extraction/Text Search Events/package.json b/Text Search and Extraction/Text Search Events/package.json new file mode 100644 index 0000000..f108444 --- /dev/null +++ b/Text Search and Extraction/Text Search Events/package.json @@ -0,0 +1,38 @@ +{ + "name": "ej2-quickstart", + "version": "0.0.1", + "description": "Essential JS 2 typescript quick start application", + "author": "Syncfusion Inc.", + "license": "SEE LICENSE IN license", + "repository": { + "type": "git", + "url": "https://github.com/syncfusion/ej2-quickstart.git" + }, + "scripts": { + "start": "webpack-dev-server --mode development", + "build": "webpack --mode production", + "serve": "gulp e2e-serve", + "test": "gulp e2e-test", + "update-webdriver": "gulp e2e-webdriver-update" + }, + "devDependencies": { + "ajv": "^8.11.2", + "browser-sync": "^2.18.12", + "gulp": "*", + "typescript": "*", + "gulp-protractor": "*", + "gulp-typescript": "*", + "jasmine": "^2.6.0", + "css-loader": "^6.7.2", + "ts-loader": "^9.4.1", + "mini-css-extract-plugin": "^2.7.0", + "html-webpack-plugin": "^5.5.0", + "webpack": "^5.75.0", + "webpack-cli": "^5.0.0", + "webpack-dev-server": "^5.2.1", + "webpack-stream": "^7.0.0" + }, + "dependencies": { + "@syncfusion/ej2": "*" + } +} diff --git a/Text Search and Extraction/Text Search Events/src/app/app.ts b/Text Search and Extraction/Text Search Events/src/app/app.ts new file mode 100644 index 0000000..8ad7d77 --- /dev/null +++ b/Text Search and Extraction/Text Search Events/src/app/app.ts @@ -0,0 +1,56 @@ +import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageInfoModel } from '@syncfusion/ej2-pdfviewer'; + +// Inject required modules +PdfViewer.Inject(TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields); + +// ---------- viewer instance ---------- +const viewer: PdfViewer = new PdfViewer({ + documentPath : 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', + resourceUrl: "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib", + + /* ----- 1. fires immediately when search begins ----- */ + textSearchStart: (args: any) => { + console.log('textSearchStart →', args.searchText); + // reset UI + (document.getElementById('resultInfo') as HTMLElement).textContent = 'Searching…'; + }, + + /* ----- 2. for every match that becomes active/visible ----- */ + textSearchHighlight: (args: any) => { + console.log(`Match on page ${args.pageNumber}`, args.bounds); + }, + + /* ----- 3. after whole document scanned for current term ----- */ + textSearchComplete: (args: any) => { + console.log('textSearchComplete →', args); + const label = document.getElementById('resultInfo') as HTMLElement; + if (args.isMatchFound) { + label.textContent = `Found ${args.totalMatches} match(es)`; + } else { + label.textContent = 'No results'; + } + } +}); +viewer.appendTo('#pdfViewer'); + +// ---------- helper to fetch UI values ---------- +function getSearchOptions() { + const term = (document.getElementById('txtSearch') as HTMLInputElement).value; + const mCase = (document.getElementById('chkCase') as HTMLInputElement).checked; + const whole = (document.getElementById('chkWhole') as HTMLInputElement).checked; + return { term, mCase, whole }; +} + +// ---------- wire up buttons ---------- +(document.getElementById('btnSearch') as HTMLButtonElement).onclick = () => { + const o = getSearchOptions(); + viewer.textSearch.searchText(o.term, o.mCase); +}; + +(document.getElementById('btnNext') as HTMLButtonElement).onclick = () => { + viewer.textSearch.searchNext(); +}; + +(document.getElementById('btnPrev') as HTMLButtonElement).onclick = () => { + viewer.textSearch.searchPrevious(); +}; \ No newline at end of file diff --git a/Text Search and Extraction/Text Search Events/src/index.html b/Text Search and Extraction/Text Search Events/src/index.html new file mode 100644 index 0000000..bbad79c --- /dev/null +++ b/Text Search and Extraction/Text Search Events/src/index.html @@ -0,0 +1,33 @@ + + + + + Essential JS 2 + + + + + + + + + + +
+ + + + + + + + + +
+ + +
+ + + + \ No newline at end of file diff --git a/Text Search and Extraction/Text Search Events/src/resources/favicon.ico b/Text Search and Extraction/Text Search Events/src/resources/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..d8d5c152e7353a07c3e519c9e53ac9328e515fa8 GIT binary patch literal 6574 zcmeHLZ)jUp6o1J}(=>U>YhL@3w0TL>C8MsL+H`gkEVxdkmO9tb;jBuvbG9p5I^2g+ zoQ_RobEu4M#mx^QI7C|n@y`&)zU<3BbPQB*vVCzdnHEGebfLH<{!U+RdizYC2_~~j z1HasR&O7J+&b{}%bKiS{U=c*2x>`UR5q8-GVZ9(Mk>7TV@$vY-_rFZ=hz7$<%I*YLf(BcUQQv$12qd1n5&7W;6a-9p|6b zEhm49g@-KH`gmCjM%xIyj%eKs>3FcY z7n(o3J#i>co_LArxZI=s%9(%6R(@pPpgxCWiu%Ry6DQk0y}gm7yr6rAVRyV~hT>x~ zwUqzFqjN9j0FA-VgT-jp@-Yrp@Q=->eJHEXYL9=tkj!kdk!e*gDhmYScQgOFnb;OE~-vz&&w zQajg1Pn+N~)SZTV{K{q%o6~)<&}%H8s9lI*l^4D+KY9dvo5Ozg=*(Ki>YA>-a|SZ~p!SYpRMR literal 0 HcmV?d00001 diff --git a/Text Search and Extraction/Text Search Events/src/styles/styles.css b/Text Search and Extraction/Text Search Events/src/styles/styles.css new file mode 100644 index 0000000..c5d413e --- /dev/null +++ b/Text Search and Extraction/Text Search Events/src/styles/styles.css @@ -0,0 +1,9 @@ +@import '../../node_modules/@syncfusion/ej2-base/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-buttons/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-dropdowns/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-inputs/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-navigations/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-popups/styles/material.css'; +@import '../../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css'; +@import "../../node_modules/@syncfusion/ej2-pdfviewer/styles/material.css"; +@import "../../node_modules/@syncfusion/ej2-notifications/styles/material.css"; \ No newline at end of file diff --git a/Text Search and Extraction/Text Search Events/tsconfig.json b/Text Search and Extraction/Text Search Events/tsconfig.json new file mode 100644 index 0000000..db9b7c2 --- /dev/null +++ b/Text Search and Extraction/Text Search Events/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es2016", + "module": "ES6", + "sourceMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "moduleResolution": "node" + } +} diff --git a/Text Search and Extraction/Text Search Events/webpack.config.js b/Text Search and Extraction/Text Search Events/webpack.config.js new file mode 100644 index 0000000..f61e596 --- /dev/null +++ b/Text Search and Extraction/Text Search Events/webpack.config.js @@ -0,0 +1,41 @@ +const HtmlWebpackPlugin = require("html-webpack-plugin"); +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const path = require('path'); + +module.exports = { + entry: ['./src/app/app.ts', './src/styles/styles.css'], + module: { + rules: [ + { + test: /\.ts?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /\.css$/, + use: [ MiniCssExtractPlugin.loader, "css-loader" ] + }, + ], + }, + resolve: { + extensions: ['.ts', '.js'], + }, + output: { + filename: 'bundle.js', + path: path.resolve(__dirname, 'dist'), + }, + plugins: [ + new HtmlWebpackPlugin({ + template: 'src/index.html' + }), + new MiniCssExtractPlugin({ + filename: "bundle.css" + }) + ], + devServer: { + static: path.join(__dirname, "dist"), + compress: true, + port: 4000, + open: true + }, +}; From 8e8264e867548308cf1d81c5850b0e25e7fee3dc Mon Sep 17 00:00:00 2001 From: SF4524LogeshKumar Date: Fri, 19 Dec 2025 16:33:44 +0530 Subject: [PATCH 3/3] 996399: Updated Sample for Text Search --- .../Text Search Events/src/app/app.ts | 56 ------------------ .../.gitignore | 0 .../README.md | 0 .../e2e/index.spec.js | 0 .../e2e/protractor.conf.js | 0 .../gulpfile.js | 0 .../license | 0 .../package.json | 0 .../src/app/app.ts | 41 +++++++++++++ .../src/index.html | 19 +++--- .../src/resources/favicon.ico | Bin .../src/styles/styles.css | 0 .../tsconfig.json | 0 .../webpack.config.js | 0 14 files changed, 50 insertions(+), 66 deletions(-) delete mode 100644 Text Search and Extraction/Text Search Events/src/app/app.ts rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/.gitignore (100%) rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/README.md (100%) rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/e2e/index.spec.js (100%) rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/e2e/protractor.conf.js (100%) rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/gulpfile.js (100%) rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/license (100%) rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/package.json (100%) create mode 100644 Text Search and Extraction/Text Search Features and Events/src/app/app.ts rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/src/index.html (56%) rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/src/resources/favicon.ico (100%) rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/src/styles/styles.css (100%) rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/tsconfig.json (100%) rename Text Search and Extraction/{Text Search Events => Text Search Features and Events}/webpack.config.js (100%) diff --git a/Text Search and Extraction/Text Search Events/src/app/app.ts b/Text Search and Extraction/Text Search Events/src/app/app.ts deleted file mode 100644 index 8ad7d77..0000000 --- a/Text Search and Extraction/Text Search Events/src/app/app.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { PdfViewer, TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields, PageInfoModel } from '@syncfusion/ej2-pdfviewer'; - -// Inject required modules -PdfViewer.Inject(TextSelection, TextSearch, Print, Navigation, Toolbar, Magnification, Annotation, FormDesigner, FormFields); - -// ---------- viewer instance ---------- -const viewer: PdfViewer = new PdfViewer({ - documentPath : 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', - resourceUrl: "https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib", - - /* ----- 1. fires immediately when search begins ----- */ - textSearchStart: (args: any) => { - console.log('textSearchStart →', args.searchText); - // reset UI - (document.getElementById('resultInfo') as HTMLElement).textContent = 'Searching…'; - }, - - /* ----- 2. for every match that becomes active/visible ----- */ - textSearchHighlight: (args: any) => { - console.log(`Match on page ${args.pageNumber}`, args.bounds); - }, - - /* ----- 3. after whole document scanned for current term ----- */ - textSearchComplete: (args: any) => { - console.log('textSearchComplete →', args); - const label = document.getElementById('resultInfo') as HTMLElement; - if (args.isMatchFound) { - label.textContent = `Found ${args.totalMatches} match(es)`; - } else { - label.textContent = 'No results'; - } - } -}); -viewer.appendTo('#pdfViewer'); - -// ---------- helper to fetch UI values ---------- -function getSearchOptions() { - const term = (document.getElementById('txtSearch') as HTMLInputElement).value; - const mCase = (document.getElementById('chkCase') as HTMLInputElement).checked; - const whole = (document.getElementById('chkWhole') as HTMLInputElement).checked; - return { term, mCase, whole }; -} - -// ---------- wire up buttons ---------- -(document.getElementById('btnSearch') as HTMLButtonElement).onclick = () => { - const o = getSearchOptions(); - viewer.textSearch.searchText(o.term, o.mCase); -}; - -(document.getElementById('btnNext') as HTMLButtonElement).onclick = () => { - viewer.textSearch.searchNext(); -}; - -(document.getElementById('btnPrev') as HTMLButtonElement).onclick = () => { - viewer.textSearch.searchPrevious(); -}; \ No newline at end of file diff --git a/Text Search and Extraction/Text Search Events/.gitignore b/Text Search and Extraction/Text Search Features and Events/.gitignore similarity index 100% rename from Text Search and Extraction/Text Search Events/.gitignore rename to Text Search and Extraction/Text Search Features and Events/.gitignore diff --git a/Text Search and Extraction/Text Search Events/README.md b/Text Search and Extraction/Text Search Features and Events/README.md similarity index 100% rename from Text Search and Extraction/Text Search Events/README.md rename to Text Search and Extraction/Text Search Features and Events/README.md diff --git a/Text Search and Extraction/Text Search Events/e2e/index.spec.js b/Text Search and Extraction/Text Search Features and Events/e2e/index.spec.js similarity index 100% rename from Text Search and Extraction/Text Search Events/e2e/index.spec.js rename to Text Search and Extraction/Text Search Features and Events/e2e/index.spec.js diff --git a/Text Search and Extraction/Text Search Events/e2e/protractor.conf.js b/Text Search and Extraction/Text Search Features and Events/e2e/protractor.conf.js similarity index 100% rename from Text Search and Extraction/Text Search Events/e2e/protractor.conf.js rename to Text Search and Extraction/Text Search Features and Events/e2e/protractor.conf.js diff --git a/Text Search and Extraction/Text Search Events/gulpfile.js b/Text Search and Extraction/Text Search Features and Events/gulpfile.js similarity index 100% rename from Text Search and Extraction/Text Search Events/gulpfile.js rename to Text Search and Extraction/Text Search Features and Events/gulpfile.js diff --git a/Text Search and Extraction/Text Search Events/license b/Text Search and Extraction/Text Search Features and Events/license similarity index 100% rename from Text Search and Extraction/Text Search Events/license rename to Text Search and Extraction/Text Search Features and Events/license diff --git a/Text Search and Extraction/Text Search Events/package.json b/Text Search and Extraction/Text Search Features and Events/package.json similarity index 100% rename from Text Search and Extraction/Text Search Events/package.json rename to Text Search and Extraction/Text Search Features and Events/package.json diff --git a/Text Search and Extraction/Text Search Features and Events/src/app/app.ts b/Text Search and Extraction/Text Search Features and Events/src/app/app.ts new file mode 100644 index 0000000..80fa2fe --- /dev/null +++ b/Text Search and Extraction/Text Search Features and Events/src/app/app.ts @@ -0,0 +1,41 @@ +import { + PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, + ThumbnailView, BookmarkView, TextSelection, TextSearch +} from '@syncfusion/ej2-pdfviewer'; + +// Register required modules +PdfViewer.Inject( + Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, + ThumbnailView, BookmarkView, TextSelection, TextSearch +); + +// Initialise viewer +const pdfviewer: PdfViewer = new PdfViewer({ + enableTextSearch: true, + documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf', + resourceUrl: 'https://cdn.syncfusion.com/ej2/31.1.23/dist/ej2-pdfviewer-lib' +}); +pdfviewer.appendTo('#PdfViewer'); + +// --------- UI bindings --------- +const txtSearch = document.getElementById('txtSearch') as HTMLInputElement; +const chkMatchCase = document.getElementById('chkMatchCase') as HTMLInputElement; + +(document.getElementById('btnSearch') as HTMLButtonElement).onclick = () => { + pdfviewer.textSearch.searchText( + txtSearch.value, + chkMatchCase.checked + ); +}; + +(document.getElementById('btnNext') as HTMLButtonElement).onclick = () => { + pdfviewer.textSearch.searchNext(); +}; + +(document.getElementById('btnPrev') as HTMLButtonElement).onclick = () => { + pdfviewer.textSearch.searchPrevious(); +}; + +(document.getElementById('btnCancel') as HTMLButtonElement).onclick = () => { + pdfviewer.textSearch.cancelTextSearch(); +}; \ No newline at end of file diff --git a/Text Search and Extraction/Text Search Events/src/index.html b/Text Search and Extraction/Text Search Features and Events/src/index.html similarity index 56% rename from Text Search and Extraction/Text Search Events/src/index.html rename to Text Search and Extraction/Text Search Features and Events/src/index.html index bbad79c..68de3f9 100644 --- a/Text Search and Extraction/Text Search Events/src/index.html +++ b/Text Search and Extraction/Text Search Features and Events/src/index.html @@ -12,21 +12,20 @@ - +
- - - + + + - - - - + + +
- -
+ +
diff --git a/Text Search and Extraction/Text Search Events/src/resources/favicon.ico b/Text Search and Extraction/Text Search Features and Events/src/resources/favicon.ico similarity index 100% rename from Text Search and Extraction/Text Search Events/src/resources/favicon.ico rename to Text Search and Extraction/Text Search Features and Events/src/resources/favicon.ico diff --git a/Text Search and Extraction/Text Search Events/src/styles/styles.css b/Text Search and Extraction/Text Search Features and Events/src/styles/styles.css similarity index 100% rename from Text Search and Extraction/Text Search Events/src/styles/styles.css rename to Text Search and Extraction/Text Search Features and Events/src/styles/styles.css diff --git a/Text Search and Extraction/Text Search Events/tsconfig.json b/Text Search and Extraction/Text Search Features and Events/tsconfig.json similarity index 100% rename from Text Search and Extraction/Text Search Events/tsconfig.json rename to Text Search and Extraction/Text Search Features and Events/tsconfig.json diff --git a/Text Search and Extraction/Text Search Events/webpack.config.js b/Text Search and Extraction/Text Search Features and Events/webpack.config.js similarity index 100% rename from Text Search and Extraction/Text Search Events/webpack.config.js rename to Text Search and Extraction/Text Search Features and Events/webpack.config.js