This example shows how to integrate PSPDFKit for Web into an ASP.NET backend app.
This example demonstrates both Standalone and Server backend.
- .Net 6.0
- A running PSPDFKit Document Engine (if you wish to use Server backend). Follow the guide here.
PSPDFKit offers support for customers with an active SDK license via https://pspdfkit.com/support/request/
Are you evaluating our SDK? 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://pspdfkit.com/sales/
Clone the repo:
git clone https://github.com/PSPDFKit/pspdfkit-server-example-asp-net.git
cd pspdfkit-server-example-asp-net
If Visual Studio informs you that some packages are missing then click on the "Restore" on the right.
After you have downloaded PSPDFKit for Web, place the contents of the dist directory in /wwwroot/lib/pspdfkit/
.
Make sure your /wwwroot/lib/pspdfkit/
folder contains the file pspdfkit.js
and a pspdfkit-lib
directory with library assets.
You can then build and run the example using dotnet watch run
from the root folder.
You can also follow along with our Getting Started guides for ASP.NET.
The Standalone example does not require a running PSPDFKit Document Engine but the Server example does.
Follow the guide here to set up a running PSPDFKit Document Engine.
Change the server address in /Views/Shared/_Layout.cshtml
to the address of your PSPDFKit Document Engine.
Once you have a running server you will need to generate a JWT and place it in /Views/Home/Index.cshtml
.
Read this guide for more information on this topic.
Upload a document to the server if you haven't already. Get the document id and set it in /Views/Home/Index.cshtml
.
Build the solution and click on the green play icon in the toolbar starting the app and the index page will open in the browser you have specified to launch with.
This software is licensed under a modified BSD license.
Please ensure you have signed our CLA so that we can accept your contributions.