Example Projects

Information

PSPDFKit Server has been deprecated and replaced by PSPDFKit Document Engine. All PSPDFKit Server and PSPDFKit for Web Server-Backed licenses will work as before and be supported until 15 May 2024 (we will contact you about license migration). To start using Document Engine, refer to the migration guide. With Document Engine, you’ll have access to robust new capabilities (read the blog for more information).

PSPDFKit Server offers the following example projects:

These examples demonstrate how to integrate PSPDFKit Server with your backend.

To integrate PSPDFKit Server with your backend, set up an instance of PSPDFKit Server using the getting started guide that describes the necessary docker-compose.yml file in detail.

  1. Install and run Docker. Refer to the Choose a Docker Registry guide to learn about all the installation options.

  2. Reboot your machine.

  3. Verify that Docker works correctly by typing docker info in the terminal. Check that the output contains OSType: linux. PSPDFKit Server is a Linux-based container and requires a Docker environment capable of running Linux containers.

  4. Pull the pspdfkit image from Docker Hub:

docker pull pspdfkit/pspdfkit
  1. Use one of the following example projects:

The examples provide Dockerfile and docker-compose.yml files that work without additional configuration. To clone an example to your machine and switch to its directory, run one of the following commands:

git clone https://github.com/PSPDFKit/pspdfkit-server-example-nodejs.git
cd pspdfkit-server-example-nodejs
git clone https://github.com/PSPDFKit/pspdfkit-server-example-rails.git
cd pspdfkit-server-example-rails
Information

If the command doesn’t work, try installing Git first.

  1. If you have an activation key (also called a license key), add it to Docker using the code below. It’ll remain activated until you reset it. To start in trial mode without an activation key, skip this step.

ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE docker-compose up
set ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE
docker-compose up
$env:ACTIVATION_KEY='YOUR_ACTIVATION_KEY_GOES_HERE'
docker-compose up
  1. Open http://localhost:3000 in a browser. When the website asks your username, type something to proceed. Alternatively, open PSPDFKit Server’s dashboard at http://localhost:5000/dashboard and log in with the username dashboard and the password secret.

Information

To stop the container, use the Control-C keyboard shortcut.

  1. Optional: To test PSPDFKit for Web on different devices in your local network, edit the PSPDFKIT_SERVER_EXTERNAL_URL environment variable in the docker-compose.yaml file and set it to an address that’s accessible from your device.

Warning

If you get an error, try installing docker-compose.yaml separately.

The following message might appear:

ERROR: Couldn’t connect to Docker daemon at http+docker://localunixsocket - is it running?

If so, check if the service is running using the docker info command or the sudo docker info command.

  1. Follow the getting started guides for PSPDFKit Instant for Android, iOS, or Web.