# Foxit PDF SDK for web

## Install

```sh
npm install -S @foxitsoftware/foxit-pdf-sdk-for-web-library
```

## Integration (Based on webpack & babel)

Simplified webpack configuration for copy resources example:

```js
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');

const distPath = path.resolve('dist');
const libraryModulePath = path.resolve('node_modules/@foxitsoftware/foxit-pdf-sdk-for-web-library');
const libPath = path.resolve(libraryModulePath, '');

module.exports = {
    mode: 'development',
    plugins: [
        new CopyWebpackPlugin({
            patterns:[{
                from: libPath,
                to: path.resolve(distPath, 'lib'),
                force: true
            }]
        }),
    ]
};
```

Now you can use it in your code like following:

```js
import * as UIExtension from '@foxitsoftware/foxit-pdf-sdk-for-web-library/lib/UIExtension.full.js';
import '@foxitsoftware/foxit-pdf-sdk-for-web-library/lib/UIExtension.vw.css';

const pdfui = new UIExtension.PDFUI({
    viewerOptions: {
        libPath: '/lib',
        jr: {
            licenseKey: license.licenseKey,
            licenseSN: license.licenseSN,
            enginePath: './jr-engine/gsdk',
            fontPath: 'http://webpdf.foxitsoftware.com/webfonts/'
        }
    },
    renderTo: '#pdf-ui',
    addons: [
        '/lib/uix-addons/path-objects'
    ]
});

pdfui.openPDFByHttpRangeRequest({
    range:{
        url:'/path/to/pdffile.pdf',
    }
},{fileName:'PDF file name.pdf'});

```

Examples can be edited on [CodeSandbox](https://codesandbox.io/s/github/foxitsoftware/FoxitPDFSDKForWeb-examples).

## API Reference

See [API Reference](https://webviewer-demo.foxitsoftware.com/docs/API_Reference/FoxitPDFSDK_API_Reference.html)

## Developer guide

See [Developer guide](https://webviewer-demo.foxitsoftware.com/docs/developer-guide/)
