Skip to content

Commit 59cdd68

Browse files
committed
Add support for PDF.js releases 4.0.269, 4.0.379. Fix tests and docs.
1 parent b1a0cb8 commit 59cdd68

File tree

982 files changed

+206878
-193114
lines changed

Some content is hidden

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

982 files changed

+206878
-193114
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ See [examples](https://alekswebnet.github.io/pdfjs-viewer-element/#demo) of usag
1111

1212
The prebuilt comes with each PDF.js release. Supported releases:
1313

14-
[v4.0.189](https://github.com/mozilla/pdf.js/releases/tag/v4.0.189)
14+
[v4.0.379](https://github.com/mozilla/pdf.js/releases/tag/v4.0.379)
15+
16+
[v4.0.269](https://github.com/mozilla/pdf.js/releases/tag/v4.0.269)
1517

16-
[v3.11.174](https://github.com/mozilla/pdf.js/releases/tag/v3.11.174)
18+
[v4.0.189](https://github.com/mozilla/pdf.js/releases/tag/v4.0.189)
1719

18-
[v3.10.111](https://github.com/mozilla/pdf.js/releases/tag/v3.10.111)
1920

2021
To use the package you should download and **place the prebuilt** files to some directory of your project.
2122

@@ -105,11 +106,11 @@ Use `viewer-css-theme` attribute to set light or dark theme manually:
105106
You can add your own CSS rules to the viewer application using `viewer-extra-styles` attribute:
106107

107108
```html
108-
<!-- Hide open file button -->
109+
<!-- Remove download button from viewer toolbar -->
109110
<pdfjs-viewer-element
110111
src="/file.pdf"
111112
viewer-path="/path-to-viewer"
112-
viewer-extra-styles="#openFile { display: none }">
113+
viewer-extra-styles="#download { display: none }">
113114
</pdfjs-viewer-element>
114115
```
115116

index.html

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@
1010
<body style="margin: 0">
1111
<pdfjs-viewer-element
1212
src="/fake-file.pdf"
13-
viewer-path="/pdfjs-4.0.189-dist"
14-
style="height: min(500px, 50dvh)">
13+
viewer-path="/pdfjs-4.0.379-dist"
14+
style="height: clamp(600px, 600px, 80dvh)">
1515
</pdfjs-viewer-element>
1616
<pdfjs-viewer-element
1717
id="hideOpenFileViewer"
1818
src="/sample-pdf-with-images.pdf"
19-
viewer-path="/pdfjs-4.0.189-dist"
19+
viewer-path="/pdfjs-4.0.379-dist"
2020
locale="de"
2121
page="2"
22-
style="height: min(500px, 50dvh)">
22+
style="height: clamp(600px, 600px, 80dvh)">
2323
</pdfjs-viewer-element>
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>
24+
<button onclick="document.querySelector('#hideOpenFileViewer').setAttribute('viewer-extra-styles', '#download { display: none }')">Hide download button</button>
25+
<button onclick="document.querySelector('#hideOpenFileViewer').setAttribute('viewer-extra-styles', '')">Show download button</button>
2626
<pdfjs-viewer-element
2727
id="themedViewer"
2828
src="/sample-pdf-10MB.pdf"
29-
viewer-path="/pdfjs-4.0.189-dist"
29+
viewer-path="/pdfjs-4.0.379-dist"
3030
viewer-css-theme="DARK"
3131
locale="es"
32-
style="height: min(500px, 50dvh)">
32+
style="height: clamp(600px, 600px, 80dvh)">
3333
</pdfjs-viewer-element>
3434

3535
<button onclick="document.querySelector('#themedViewer').setAttribute('viewer-css-theme', 'LIGHT')">Change theme</button>
@@ -47,19 +47,10 @@
4747

4848
<pdfjs-viewer-element
4949
id="base-viewer"
50-
viewer-path="/pdfjs-4.0.189-dist"
50+
viewer-path="/pdfjs-4.0.379-dist"
5151
locale="uk"
52-
viewer-extra-styles="#openFile { display: none; } #print { display: none } #download { display: none } #download + .verticalToolbarSeparator { display: none }"
53-
style="height: min(500px, 50dvh)">
52+
style="height: clamp(600px, 600px, 80dvh)">
5453
</pdfjs-viewer-element>
55-
56-
<button onclick="document.querySelector('#base-viewer').setAttribute('viewer-css-theme', 'DARK')">Change theme</button>
57-
<button onclick="document.querySelector('#base-viewer').setAttribute('viewer-css-theme', 'AUTOMATIC')">Reset theme</button>
58-
<button onclick="document.querySelector('#base-viewer').setAttribute('page', '2')">Change page</button>
59-
<button onclick="document.querySelector('#base-viewer').setAttribute('page', '1')">Reset page</button>
60-
<button onclick="document.querySelector('#base-viewer').setAttribute('locale', 'de')">Change locale</button>
61-
<button onclick="document.querySelector('#base-viewer').setAttribute('locale', 'uk')">Reset locale</button>
62-
<button onclick="document.querySelector('#base-viewer').setAttribute('viewer-extra-styles', '')">Remove extra styles</button>
6354
</body>
6455

6556
<script>

public/pdfjs-3.10.111-dist/build/pdf.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/pdfjs-3.10.111-dist/build/pdf.sandbox.js

Lines changed: 0 additions & 280 deletions
This file was deleted.

public/pdfjs-3.10.111-dist/build/pdf.sandbox.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/pdfjs-3.10.111-dist/build/pdf.worker.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/pdfjs-3.10.111-dist/web/images/loading-dark.svg

Lines changed: 0 additions & 24 deletions
This file was deleted.

public/pdfjs-3.10.111-dist/web/locale/ach/viewer.properties

Lines changed: 0 additions & 203 deletions
This file was deleted.

0 commit comments

Comments
 (0)