Git Product home page Git Product logo

pspdfkit-web-examples-catalog's Introduction

PSPDFKit for Web Examples Catalog

Prerequisites

Before you get started, make sure to check out this repository locally:

$ git clone https://github.com/PSPDFKit/pspdfkit-web-examples-catalog.git
$ cd pspdfkit-web-examples-catalog

Getting Started with Docker

Prerequisites

We recommend you use Docker to get all components up and running quickly.

The provided docker-compose.yml and Dockerfile will allow you to edit the example app on your host and it will live-reload.

  1. Open the docker-compose.yml file in an editor of your choice and replace the YOUR_LICENSE_KEY_GOES_HERE placeholder with your standalone license key.

  2. Start environment with your PSPDFKit Server activation key.

    $ ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE docker-compose up

    If you are using Windows make sure to set the environment variables accordingly. For this replace the line starting with ACTIVATION_KEY="... with:

    $ SET "ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE"
    $ docker-compose up

    Make sure to replace YOUR_ACTIVATION_KEY_GOES_HERE with your PSPDFKit Server activation key. You only have to provide the activation key once, after that the server will remain activated until you reset it.

  3. The examples catalog is now running on http://localhost:3000. You can access the PSPDFKit Server dashboard at http://localhost:5000/dashboard using dashboard // secret.

Resetting the environment

You can reset the environment by first tearing down its containers and volumes and then recreating them.

$ docker-compose down --volumes
$ ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE docker-compose up

If you are using Windows make sure to set the environment variables accordingly. For this replace the line starting with ACTIVATION_KEY="... with:

$ SET "ACTIVATION_KEY=YOUR_ACTIVATION_KEY_GOES_HERE"
$ docker-compose up

Notes

If an example sets options within PSPDFKit.Options, the page should be refreshed when switching to/from the example, since PSPDFKit.load() freezes the options object. Currently only the Form Designer example does this, but if any others qualify, the refreshExamples constant should be updated at _app.js:10.

Troubleshooting

Occasionally running the docker-compose scripts will result in errors because some containers are in a broken state. To resolve this, you can reset all containers and their attached volumes by running the following command:

docker-compose down --volumes

If you have further troubles, you can always reach out to us via our support platform.

Upload a new pdf file to the catalog examples

To upload a pdf to our catalog we need to update the examples in the Web Repo. Each example uses an example.pdf included in the same folder. In order to change it, you only need to name the new PDF example.pdf and replace (or rename) the old one.

Forcing a specific backend

Regardless of the current backend chosen, you can force a specific backend to be selected when accessing the catalog by following a URL by appending the mode query param and setting it to either "standalone" or "server", for example: https://web-examples.pspdfkit.com/hello?mode=standalone will open the Standalone version of the hello example, even if the default backend is Server.

License

This software is licensed under a modified BSD license.

Contributing

Please ensure you signed our CLA so we can accept your contributions.

pspdfkit-web-examples-catalog's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.