Example Projects
Document Engine offers the following example projects:
These examples demonstrate how to integrate Document Engine with your backend.
To start, set up an instance of Document Engine using the getting started guide that describes the necessary docker-compose.yml
file in detail.
-
Install and run Docker. Refer to the choose a Docker registry guide to learn about all the installation options.
-
Reboot your machine.
-
Verify that Docker works correctly by typing
docker info
in the terminal. Check that the output containsOSType: linux
. Document Engine is a Linux-based container and requires a Docker environment capable of running Linux containers. -
Pull the
pspdfkit
image from Docker Hub:
docker pull pspdfkit/pspdfkit
-
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
If the command doesn’t work, try installing Git first.
-
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
-
Open http://localhost:3000 in a browser. When the website asks your username, type something to proceed. Alternatively, open Document Engine’s dashboard at http://localhost:5000/dashboard and log in with the username
dashboard
and the passwordsecret
.
To stop the container, use the Control-C keyboard shortcut.
-
Optional: To test PSPDFKit for Web on different devices in your local network, edit the
PSPDFKIT_SERVER_EXTERNAL_URL
environment variable in thedocker-compose.yaml
file and set it to an address that’s accessible from your device.
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 thedocker info
command or thesudo docker info
command.
-
Follow the getting started guides for PSPDFKit Instant for Android, iOS, Web, Flutter or React Native.