Skip to content

Commit 6e4346a

Browse files
committed
Add Svelte example for PSPDFKit integration
- Created a new Svelte example project demonstrating the integration of PSPDFKit for Web. - Added essential files including package.json, README.md, and rollup.config.js for build configuration. - Implemented a basic HTML structure with a PDF viewer using PSPDFKit. - Included scripts for verifying installation and copying necessary PSPDFKit files. - Configured development and production build processes using Rollup. - Added sample assets including a PDF document and favicon for demonstration. - Implemented file upload functionality to open PDF documents dynamically.
1 parent 957dd7a commit 6e4346a

File tree

16 files changed

+1984
-0
lines changed

16 files changed

+1984
-0
lines changed

examples/svelte/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/node_modules/
2+
/public/build/
3+
/public/pspdfkit.js
4+
.DS_Store
5+
/public/pspdfkit-lib

examples/svelte/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 © 2019-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/svelte/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Nutrient Web SDK Example - Svelte
2+
3+
This example shows how to integrate [Nutrient Web SDK](https://www.nutrient.io/web/) into a [Svelte](https://svelte.dev) 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-svelte.git
21+
cd pspdfkit-web-example-svelte
22+
```
23+
24+
Install the project dependencies with `npm`:
25+
26+
```bash
27+
npm install
28+
```
29+
30+
In order to make the Nutrient Web SDK's library available for building, we have to copy the `pspdfkit-lib/` directory from `node_modules/pspdfkit/dist/` into the `public/` directory. This is done in the `package.json` script `verify-installation` which is executed by `dev` script.
31+
32+
## Running the Example
33+
34+
We are ready to launch the app! 🎉
35+
36+
```bash
37+
npm run dev
38+
```
39+
40+
You can now open http://localhost:3000/ in your browser and enjoy!
41+
42+
## License
43+
44+
This software is licensed under a [modified BSD license](LICENSE).
45+
46+
## Contributing
47+
48+
Please ensure
49+
[you have signed our CLA](https://www.nutrient.io/guides/web/current/miscellaneous/contributing/) so that we can
50+
accept your contributions.

0 commit comments

Comments
 (0)