You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom element that embeds [PDF.js default viewer](https://mozilla.github.io/pdf.js/web/viewer.html) using the `iframe`.
5
4
6
-
The simplest integration of [PDF.js default viewer](https://mozilla.github.io/pdf.js/web/viewer.html) using the `iframe` element and web component.
7
5
The package provides a custom element, based on PDF.js [viewer options](https://github.com/mozilla/pdf.js/wiki/Viewer-options) and [URL parameters](https://github.com/mozilla/pdf.js/wiki/Debugging-PDF.js#url-parameters) API.
6
+
8
7
Supported in all [major browsers](https://caniuse.com/custom-elementsv1), and works with most [JS frameworks](https://custom-elements-everywhere.com/).
9
8
10
-
See [demo pages](https://github.com/alekswebnet/pdfjs-viewer-element/tree/master/demo) for various usecases.
11
-
See [live examples](https://alekswebnet.github.io/pdfjs-viewer-element/#demo) of usage with frameworks.
[](https://www.webcomponents.org/element/pdfjs-viewer-element)
12
+
13
+

12
14
13
15
## Features
14
16
15
17
- Simple PDF.js viewer integration to any web application
16
-
- PDF.js viewer options and parameters support, access to the viewer application instance
17
-
- Ability to customize viewer styles and themes
18
-
19
-
## How it works
18
+
- PDF.js viewer options and parameters support, access the viewer application instance
19
+
- Customize viewer styles and themes
20
20
21
-
**⚠️ This is an important part, please read this FIRST !!!**
22
-
23
-
**You should download and place the PDF.js prebuilt files in the project.**
24
-
25
-
`pdfjs-viewer-element` requires PDF.js [prebuilt](http://mozilla.github.io/pdf.js/getting_started/), that includes the generic build of PDF.js and the viewer.
21
+
## Docs
26
22
27
-
The prebuilt comes with each PDF.js release.
28
-
All v4 and v3 [releases](https://github.com/mozilla/pdf.js/releases) are supported.
Then specify the path to the directory with the `viewer-path` property (`/pdfjs` by default) and PDF file URL with `src` property (should refer to the [same origin](https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#can-i-load-a-pdf-from-another-server-cross-domain-request)).
[](https://www.webcomponents.org/element/pdfjs-viewer-element)
**You should download and place the PDF.js prebuilt files in the project.**
44
+
45
+
`pdfjs-viewer-element` requires PDF.js [prebuilt](http://mozilla.github.io/pdf.js/getting_started/), that includes the generic build of PDF.js and the viewer.
Then specify the path to the directory with the `viewer-path` property (`/pdfjs` by default) and PDF file URL with `src` property (should refer to the [same origin](https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#can-i-load-a-pdf-from-another-server-cross-domain-request)).
0 commit comments