Skip to content

Commit 8edddd3

Browse files
committed
Update readme
1 parent 6eaec11 commit 8edddd3

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
# pdfjs-viewer-element
22

3-
A custom element, based on [PDF.js default viewer](https://mozilla.github.io/pdf.js/web/viewer.html) and . Supported in all [major browsers](https://caniuse.com/custom-elementsv1) and works with most [JS frameworks](https://custom-elements-everywhere.com/). See [examples](https://alekswebnet.github.io/pdfjs-viewer-element/#demo) of usage in Vue, React and Svelte or pure HTML.
3+
A custom element, based on [PDF.js default viewer](https://mozilla.github.io/pdf.js/web/viewer.html) and supported in all [major browsers](https://caniuse.com/custom-elementsv1), works with most used [JS frameworks](https://custom-elements-everywhere.com/).
44

5-
⚠️ `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. To use the package you should [download](http://mozilla.github.io/pdf.js/getting_started/) and **place the prebuilt** files to some directory of your project. Then specify the path to this directory with `viewer-path` property (`/pdfjs` by default).
5+
See [examples](https://alekswebnet.github.io/pdfjs-viewer-element/#demo) of usage in Vue, React and Svelte or static HTML page.
66

7-
You have full access to PDF.js viewer application using `initialize` method.
7+
⚠️ `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.
8+
9+
The prebuilt comes with each PDF.js release. Supported releases:
10+
11+
🚧 [v3.11.174](https://github.com/mozilla/pdf.js/releases/tag/v3.11.174) (partial)
12+
13+
[v3.10.111](https://github.com/mozilla/pdf.js/releases/tag/v3.10.111)
14+
15+
[v3.9.179](https://github.com/mozilla/pdf.js/releases/tag/v3.9.179)
16+
17+
To use the package you should download and **place the prebuilt** files to some directory of your project.
18+
19+
Then specify the path to this directory with `viewer-path` property (`/pdfjs` by default).
820

921
## Status
1022

@@ -65,7 +77,7 @@ Using browser:
6577

6678
`zoom` - Zoom level
6779

68-
`pagemode` - Page mode
80+
`pagemode` - Page mode `thumbs | bookmarks | attachments | layers | none`
6981

7082
`viewer-css-theme` - Apply automatic, light or dark theme `AUTOMATIC | LIGHT | DARK`. Default is `AUTOMATIC`
7183

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
page="2"
2222
style="height: min(500px, 50dvh)">
2323
</pdfjs-viewer-element>
24-
<button onclick="document.querySelector('#hideOpenFileViewer').setAttribute('hide-open-file', true)">Hide open file</button>
25-
<button onclick="document.querySelector('#hideOpenFileViewer').setAttribute('hide-open-file', false)">Show open file</button>
24+
<button onclick="document.querySelector('#hideOpenFileViewer').setAttribute('viewer-extra-styles', '#openFile { display: none }')">Hide open file</button>
25+
<button onclick="document.querySelector('#hideOpenFileViewer').setAttribute('viewer-extra-styles', '')">Show open file</button>
2626
<pdfjs-viewer-element
2727
id="themedViewer"
2828
src="/sample-pdf-10MB.pdf"

0 commit comments

Comments
 (0)