# MuPDF WebViewer

**A customizable PDF Viewer Component for the Web.**

**MuPDF WebViewer** is an easy to use drop-in UI component for web pages which allows for in-context PDF viewing, data extraction, customization and more.

This README is a short overview. For the full documentation, see the [Docs](https://webviewer-docs.mupdf.com).

## Quick links
- Docs: [WebViewer Developer Documentation](https://webviewer-docs.mupdf.com)
- Homepage: [webviewer.mupdf.com](https://webviewer.mupdf.com)
- Samples:
  - Vanilla JS: [mupdf-webviewer-vanilla-js-sample](https://github.com/ArtifexSoftware/mupdf-webviewer-vanilla-js-sample)
  - React: [mupdf-webviewer-react-sample](https://github.com/ArtifexSoftware/mupdf-webviewer-react-sample)
  - Vue: [mupdf-webviewer-vue-sample](https://github.com/ArtifexSoftware/mupdf-webviewer-vue-sample)
  - Angular: [mupdf-webviewer-angular-sample](https://github.com/ArtifexSoftware/mupdf-webviewer-angular-sample)
- Changelog: [Changelog](https://webviewer-docs.mupdf.com/api-reference/changelog)

## Installation

```bash
npm install mupdf-webviewer
```

## Quick start

```html
<div id="viewer"></div>
```
```js
import { initMuPDFWebViewer } from 'mupdf-webviewer'

initMuPDFWebViewer('#viewer', 'sample.pdf')
```

`initMuPDFWebViewer()` returns a `Promise<MuPDFWebViewer>` (use it if you need to access the viewer instance/API).

## Common options
- `libraryPath`: Base URL for viewer runtime resources (see Docs)
- `licenseKey`: License key for trial/commercial usage

## [API Reference](https://webviewer-docs.mupdf.com/api-reference)

## [License](https://webviewer.mupdf.com/pricing)

- Free License (v0.6.0+): view-only (with restrictions)
- Trial/Commercial: full features
- **Local Environment (development) (v0.11.0+)**
  - License verification calls are disabled on `localhost` (including `127.0.0.1`, `*.test`) to eliminate unnecessary network I/O during local development. This reduces startup latency and allows offline development. This behavior is available in `v0.11.0+` only.

## Support
- Issues/Bugs: webviewer@artifex.com
