Skip to content

Commit 3877daa

Browse files
committed
Version 2.1.5
## Version 2.1.5 - April 25, 2025 - **Fixed:** Keyboard shortcuts were not respecting the denied permissions. Especially CTRL + P for print and CTRL + S for save. - **Fixed:** Pages outline color when focused. - **Improved:** Added and used ObjectUtil.override method which is more suitable than ObjectUtil.apply, for overriding a class instance/object; it can apply property getters, property setters, functions etc.
1 parent dcbd93b commit 3877daa

File tree

10 files changed

+217
-9
lines changed

10 files changed

+217
-9
lines changed

README.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,110 @@ Note that the NPM package contains a ES6 module `pdfjskit.min.mjs`, we also prov
5454

5555
- [Using PdfJsKit in plain JS projects with Vite](https://github.com/GleamTech/PdfJsKit/tree/main/examples/pdfjskit-vite-example)
5656

57+
Here is a list of all the options with the default values, that can be passed to the `PdfViewer` constructor (they are already documented in API Docs):
58+
```js
59+
{
60+
id: "pdfViewer",
61+
hidden: false,
62+
width: 960,
63+
height: 720,
64+
border: true,
65+
resizable: true,
66+
libraryPath: null, //specify PdfJsKit libraryPath e.g. "/PdfJsKit" if not specified directory of current calling script will be used
67+
language: "en-US", //L10n will resolve this to "en-US" but for custom translations we use generic culture "en"
68+
license: null,
69+
70+
documentUrl: "",
71+
documentData: null,
72+
documentPassword: null,
73+
documentSize: null,
74+
75+
zoomMode: "", //unknown (history) starts with "auto"
76+
scrollMode: "unknown", //unknown (history) starts with "vertical"
77+
spreadMode: "unknown", //unknown (history) starts with "none"
78+
sidebarView: "unknown", //unknown (history) starts with "none"
79+
cursorTool: "select",
80+
rotationMode: "all-pages", //or "current-page" or "currentpage"
81+
rememberViewHistory: true, //for each document, remembers page number, zoom level, scroll position, rotation, sidebarView, scrollMode, spreadMode
82+
83+
toolbarVisible: true,
84+
sidebarVisible: true,
85+
verticalToolbarVisible: true,
86+
toolbarAtBottom: false,
87+
theme: "slate, classic-dark", //if multiple values, second is dark mode (auto switched)
88+
mobileMode: "on-any", //onPhone, onTablet, never
89+
debugMode: false,
90+
91+
events: {
92+
loaded: null,
93+
failed: null,
94+
documentLoaded: null,
95+
pageChanged: null,
96+
pageRendered: null,
97+
rotationChanged: null,
98+
downloading: null,
99+
printing: null,
100+
printed: null,
101+
textSelected: null,
102+
textCopied: null,
103+
},
104+
105+
permissions: {
106+
viewThumbnails: true,
107+
viewOutlines: true,
108+
viewAttachments: true,
109+
viewLayers: true,
110+
navigatePages: true,
111+
zoom: true,
112+
changeZoomMode: true,
113+
find: true,
114+
downloadOriginal: false,
115+
save: true,
116+
print: true,
117+
open: true,
118+
goFullScreen: true,
119+
goPresentationMode: true,
120+
viewProperties: true,
121+
selectText: true,
122+
pan: true,
123+
rotate: true,
124+
changeScrollMode: true,
125+
changeSpreadMode: true,
126+
127+
viewAnnotations: true,
128+
fillForms: true
129+
},
130+
131+
searchOptions: {
132+
term: "",
133+
matchCase: false,
134+
matchDiacritics: false,
135+
matchWholeWord: false,
136+
matchAnyWord: false,
137+
highlightColor: "#FFFF00",
138+
activeHighlightColor: "#FFA500",
139+
highlightAll: true
140+
},
141+
142+
printOptions: {
143+
resolution: 150,
144+
autoRotate: true
145+
},
146+
147+
translations: {
148+
"en": {
149+
"preparing-document": "Preparing document...",
150+
"cover-sheet": "Cover Sheet",
151+
"rotation-mode": "Rotation Mode",
152+
"rotation-mode-title": "Rotation Mode (rotate current page or all pages)",
153+
"full-screen": "Full Screen",
154+
"download-original": "Download Original",
155+
"any-word": "Any Word"
156+
}
157+
}
158+
}
159+
```
160+
57161
## Documentation
58162

59163
- [Html API Docs](https://gleamtech.github.io/PdfJsKit/dist/docs/)

dist/docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset='utf-8'>
5-
<title>pdfjskit 2.1.2 | Documentation</title>
5+
<title>pdfjskit 2.1.5 | Documentation</title>
66
<meta name='description' content='PdfJsKit is a PDF Viewer built on top of PDF.js, with modern UI and new features which supports integration for all JS frameworks.'>
77
<meta name='viewport' content='width=device-width,initial-scale=1'>
88
<link href='assets/bass.css' rel='stylesheet'>
@@ -16,7 +16,7 @@
1616
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
1717
<div class='py1 px2'>
1818
<h3 class='mb0 no-anchor'>pdfjskit</h3>
19-
<div class='mb1'><code>2.1.2</code></div>
19+
<div class='mb1'><code>2.1.5</code></div>
2020
<input
2121
placeholder='Filter'
2222
id='filter-input'

dist/pdfjskit/pdfjskit.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pdfjskit/pdfjskit.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pdfjskit/pdfjskit.min.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/pdfjskit/sample.pdf

472 KB
Binary file not shown.

examples/pdfjskit-vite-example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"vite": "^5.4.8"
1313
},
1414
"dependencies": {
15-
"pdfjskit": "^2.1.2"
15+
"pdfjskit": "^2.1.5"
1616
}
1717
}

package/README.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,110 @@ Note that the NPM package contains a ES6 module `pdfjskit.min.mjs`, we also prov
5454

5555
- [Using PdfJsKit in plain JS projects with Vite](https://github.com/GleamTech/PdfJsKit/tree/main/examples/pdfjskit-vite-example)
5656

57+
Here is a list of all the options with the default values, that can be passed to the `PdfViewer` constructor (they are already documented in API Docs):
58+
```js
59+
{
60+
id: "pdfViewer",
61+
hidden: false,
62+
width: 960,
63+
height: 720,
64+
border: true,
65+
resizable: true,
66+
libraryPath: null, //specify PdfJsKit libraryPath e.g. "/PdfJsKit" if not specified directory of current calling script will be used
67+
language: "en-US", //L10n will resolve this to "en-US" but for custom translations we use generic culture "en"
68+
license: null,
69+
70+
documentUrl: "",
71+
documentData: null,
72+
documentPassword: null,
73+
documentSize: null,
74+
75+
zoomMode: "", //unknown (history) starts with "auto"
76+
scrollMode: "unknown", //unknown (history) starts with "vertical"
77+
spreadMode: "unknown", //unknown (history) starts with "none"
78+
sidebarView: "unknown", //unknown (history) starts with "none"
79+
cursorTool: "select",
80+
rotationMode: "all-pages", //or "current-page" or "currentpage"
81+
rememberViewHistory: true, //for each document, remembers page number, zoom level, scroll position, rotation, sidebarView, scrollMode, spreadMode
82+
83+
toolbarVisible: true,
84+
sidebarVisible: true,
85+
verticalToolbarVisible: true,
86+
toolbarAtBottom: false,
87+
theme: "slate, classic-dark", //if multiple values, second is dark mode (auto switched)
88+
mobileMode: "on-any", //onPhone, onTablet, never
89+
debugMode: false,
90+
91+
events: {
92+
loaded: null,
93+
failed: null,
94+
documentLoaded: null,
95+
pageChanged: null,
96+
pageRendered: null,
97+
rotationChanged: null,
98+
downloading: null,
99+
printing: null,
100+
printed: null,
101+
textSelected: null,
102+
textCopied: null,
103+
},
104+
105+
permissions: {
106+
viewThumbnails: true,
107+
viewOutlines: true,
108+
viewAttachments: true,
109+
viewLayers: true,
110+
navigatePages: true,
111+
zoom: true,
112+
changeZoomMode: true,
113+
find: true,
114+
downloadOriginal: false,
115+
save: true,
116+
print: true,
117+
open: true,
118+
goFullScreen: true,
119+
goPresentationMode: true,
120+
viewProperties: true,
121+
selectText: true,
122+
pan: true,
123+
rotate: true,
124+
changeScrollMode: true,
125+
changeSpreadMode: true,
126+
127+
viewAnnotations: true,
128+
fillForms: true
129+
},
130+
131+
searchOptions: {
132+
term: "",
133+
matchCase: false,
134+
matchDiacritics: false,
135+
matchWholeWord: false,
136+
matchAnyWord: false,
137+
highlightColor: "#FFFF00",
138+
activeHighlightColor: "#FFA500",
139+
highlightAll: true
140+
},
141+
142+
printOptions: {
143+
resolution: 150,
144+
autoRotate: true
145+
},
146+
147+
translations: {
148+
"en": {
149+
"preparing-document": "Preparing document...",
150+
"cover-sheet": "Cover Sheet",
151+
"rotation-mode": "Rotation Mode",
152+
"rotation-mode-title": "Rotation Mode (rotate current page or all pages)",
153+
"full-screen": "Full Screen",
154+
"download-original": "Download Original",
155+
"any-word": "Any Word"
156+
}
157+
}
158+
}
159+
```
160+
57161
## Documentation
58162

59163
- [Html API Docs](https://gleamtech.github.io/PdfJsKit/dist/docs/)

package/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pdfjskit",
3-
"version": "2.1.2",
3+
"version": "2.1.5",
44
"description": "PdfJsKit is a PDF Viewer built on top of PDF.js, with modern UI and new features which supports integration for all JS frameworks.",
55
"keywords": [
66
"pdf-viewer",

0 commit comments

Comments
 (0)