Skip to content

Commit 2042d58

Browse files
committed
Update Vite example configuration and add new components
- Modified Playwright configuration to change the server command and URL for end-to-end testing. - Added a new `start:e2e` script in the Angular package.json for running the application on port 3000. - Introduced a new Vite example with a complete setup including package.json, README.md, and Vite configuration. - Created a PDF viewer component using PSPDFKit integrated with React. - Added CSS styles for the application layout and components. - Included sample PDF documents and SVG assets for demonstration. - Updated load tests to reflect the new server URL for testing the viewer functionality.
1 parent 55591e0 commit 2042d58

File tree

19 files changed

+2557
-4
lines changed

19 files changed

+2557
-4
lines changed

examples/angular/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"start": "ng serve",
77
"build": "ng build",
88
"watch": "ng build --watch --configuration development",
9-
"test": "ng test"
9+
"test": "ng test",
10+
"start:e2e": "ng serve --port 3000"
1011
},
1112
"private": true,
1213
"dependencies": {

examples/vite/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
public/pspdfkit-lib

examples/vite/LICENSE

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
The PSPDFKit Sample applications are licensed with a modified BSD
2+
license. In plain language: you're allowed to do whatever you wish
3+
with the code, modify, redistribute, embed in your products (free or
4+
commercial), but you must include copyright, terms of usage and
5+
disclaimer as stated in the license.
6+
7+
You will require a commercial PSPDFKit License to run these examples
8+
in non-demo mode. Please refer to [email protected] for details.
9+
10+
Copyright © 2017-present PSPDFKit GmbH.
11+
All rights reserved.
12+
13+
Redistribution and use in source or binary forms,
14+
with or without modification, are permitted provided
15+
that the following conditions are met:
16+
17+
- Redistributions of source code must retain the above copyright
18+
notice, this list of conditions and the following disclaimer.
19+
20+
- Redistributions in binary form must reproduce the above copyright
21+
notice, this list of conditions and the following disclaimer in the
22+
documentation and/or other materials provided with the
23+
distribution.
24+
25+
- Redistributions of PSPDFKit Samples must include attribution to
26+
PSPDFKit, either in documentation or other appropriate media.
27+
28+
- Neither the name of the PSPDFKit, PSPDFKit GmbH, nor its developers
29+
may be used to endorse or promote products derived from
30+
this software without specific prior written permission.
31+
32+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
39+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
42+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

examples/vite/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Nutrient Web SDK Example – Vite.js
2+
3+
This example shows how to integrate [PSPDFKit for Web](https://www.nutrient.io/web/) into a [Vite.js](https://vitejs.dev/) with React app.
4+
5+
## Prerequisites
6+
7+
- [Node.js](http://nodejs.org/)
8+
9+
## Support, Issues and License Questions
10+
11+
PSPDFKit offers support for customers with an active SDK license via https://www.nutrient.io/support/request/
12+
13+
Are you [evaluating our SDK](https://www.nutrient.io/try/)? That's great, we're happy to help out! To make sure this is fast, please use a work email and have someone from your company fill out our sales form: https://www.nutrient.io/sales/
14+
15+
## Getting Started
16+
17+
Clone the repo:
18+
19+
```bash
20+
git clone https://github.com/PSPDFKit/pspdfkit-web-example-vite.git
21+
cd pspdfkit-web-example-vite
22+
```
23+
24+
Install the project dependencies:
25+
26+
```shell script
27+
npm install
28+
```
29+
30+
## Running the Example
31+
32+
We are ready to launch the app! 🎉
33+
34+
```shell script
35+
npm run dev
36+
```
37+
38+
You can now open http://localhost:5173 in your browser and enjoy!
39+
40+
To create a production build of the app and serve it:
41+
42+
```shell script
43+
npm run build
44+
npm run preview
45+
```
46+
47+
You can now preview your build http://localhost:4173 in your browser.
48+
49+
Enjoy 🍕
50+
51+
## React Component
52+
53+
The React component which implements the PSPDFKit for Web integration can be found at `src/components/PdfViewerComponent.jsx`.
54+
55+
In order to make the PSPDFKit SDK assets available they have to be copied from the `node_modules/pspdfkit/dist` folder to `public/pspdfkit-lib` folder. For that purpose this example uses a copy plugin which you can find at `vite.config.js`.
56+
57+
## License
58+
59+
This software is licensed under a [modified BSD license](LICENSE).
60+
61+
## Contributing
62+
63+
Please ensure
64+
[you have signed our CLA](https://www.nutrient.io/guides/web/current/miscellaneous/contributing/) so that we can accept your contributions.

examples/vite/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Nutrient Web SDK Example – Vite.js</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.jsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)