GithubHelp home page GithubHelp logo

radazzouz / pspdfkit-electron-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pspdfkit/pspdfkit-electron-example

0.0 1.0 0.0 546 KB

PSPDFKit for Electron Example Application

Home Page: https://pspdfkit.com/pdf-sdk/electron/

License: Other

HTML 12.22% JavaScript 84.31% CSS 3.47%

pspdfkit-electron-example's Introduction

PSPDFKit for Electron Example App

This example shows how to build a PSPDFKit for Electron application with Electron.

Prerequisites

Getting Started

Clone the repo:

git clone https://github.com/PSPDFKit/pspdfkit-electron-example.git
cd pspdfkit-electron-example

Install the project dependencies with npm:

npm install

Now that everything is installed we need to configure the app to use our PSPDFKit for Web license key.

Edit ./config/license-key and replace the string YOUR_LICENSE_KEY_GOES_HERE with the license key that you'll find following that link.

Important: If you are using Windows, do not use PowerShell. Instead, use Microsoft’s Developer Command Prompt for Visual Studio.

Running the Example

We are ready to launch the app! 🎉

npm run start

The Electron application will automatically start.

To open the developer tools inside Electron, uncomment the following line in index.js:

// Open the DevTools.
mainWindow.webContents.openDevTools();

What's in This Repository

This repository contains an example integration of PSPDFKit for Electron. The project structure is influenced by the default Electron example app and comes with the following files:

Filename Description
src/index.js The main entry point used to create the Electron windows. This file does not contain major changes, with the exception of a validation to make sure that PSPDFKit is properly installed. It is responsible for loading src/index.html.
src/index.html The main HTML entry point. It will set up a simple HTML structure and invoke the JavaScript that runs in the renderer thread: src/renderer.js.
src/renderer.js This file is where we import PSPDFKit and set it up properly. We use it to extend PSPDFKit for Web with custom behavior.

Build Production Packages

We recommend using electron-packager or a similar solution to build the production bundles.

Install electron-packager

npm install -g electron-packager

Build Individual Packages

The following code will only work on macOS. For other platforms, please consult the documentation of electron-packager:

npm run package-mac
npm run package-win (requires Wine: `brew cask install xquartz`, `brew install wine`)
npm run package-linux (requires `apt-get install libgconf-2-4` on target Linux)

License

This software is licensed under a modified BSD license.

Contributing

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

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.