Skip to content

Commit 056166f

Browse files
committed
Remove lit, update prebuilt, add viewerPath prop
1 parent 378fe5a commit 056166f

File tree

423 files changed

+36725
-53064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

423 files changed

+36725
-53064
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A web component for [PDF.js viewer](https://mozilla.github.io/pdf.js/web/viewer.html). See [demo](https://alekswebnet.github.io/pdfjs-viewer-element/index.html).
44

5-
⚠️ `pdfjs-viewer-element` uses PDF.js [prebuilt](https://github.com/mozilla/pdf.js/releases/download/v2.15.349/pdfjs-2.15.349-dist.zip), that includes the generic build of PDF.js and the viewer. To use the package you should **extract the prebuilt** file into a public directory of your project.
5+
⚠️ `pdfjs-viewer-element` uses PDF.js [prebuilt](https://github.com/mozilla/pdf.js/releases/download/v3.4.120/pdfjs-3.4.120-dist.zip), that includes the generic build of PDF.js and the viewer. To use the package you should **extract the prebuilt** files into some directory of your project. You may specify the path to this directory with `viewerPath` property (by default is '/pdfjs-3.4.120-dist').
66

77
## Install
88
```
@@ -16,21 +16,21 @@ yarn add pdfjs-viewer-element
1616
```
1717

1818
## Usage
19-
Import to your project as module:
19+
20+
Extract the PDF.js prebuilt. See demo [example](https://github.com/alekswebnet/pdfjs-viewer-element/tree/master/public).
2021

2122
```javascript
2223
import 'pdfjs-viewer-element'
2324
```
2425

25-
Extract the PDF.js prebuilt. See [example](https://github.com/alekswebnet/pdfjs-viewer-element/tree/master/public).
26-
27-
Use the element inside your template:
28-
2926
```javascript
30-
<pdfjs-viewer-element
31-
src="/pdfjs-2.15.349-dist/web/compressed.tracemonkey-pldi-09.pdf"
32-
height="100vh">
33-
</pdfjs-viewer-element>
27+
<pdfjs-viewer-element src="/compressed.tracemonkey-pldi-09.pdf"></pdfjs-viewer-element>
3428
```
29+
30+
## Properties
31+
32+
`src` - path to pdf file.
33+
34+
`viewerPath` - path to viewer prebuilt directory (by default is '/pdfjs-3.4.120-dist').
3535
## License
3636
[MIT](http://opensource.org/licenses/MIT)

index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<script type="module" src="/src/pdfjs-viewer-element.ts"></script>
1010
</head>
1111
<body>
12-
<pdfjs-viewer-element src="/pdfjs-2.15.349-dist/web/compressed.tracemonkey-pldi-09.pdf">
13-
</pdfjs-viewer-element>
12+
<pdfjs-viewer-element src="/compressed.tracemonkey-pldi-09.pdf" style="height: 99vh"></pdfjs-viewer-element>
1413
</body>
1514
</html>

0 commit comments

Comments
 (0)