invenio-previewer 3.4.2__py2.py3-none-any.whl → 3.5.0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- invenio_previewer/__init__.py +1 -1
- invenio_previewer/config.py +15 -0
- invenio_previewer/static/js/open_pdf.js +5 -0
- invenio_previewer/templates/invenio_previewer/pdfjs.html +1 -0
- {invenio_previewer-3.4.2.dist-info → invenio_previewer-3.5.0.dist-info}/METADATA +8 -1
- {invenio_previewer-3.4.2.dist-info → invenio_previewer-3.5.0.dist-info}/RECORD +11 -11
- {invenio_previewer-3.4.2.dist-info → invenio_previewer-3.5.0.dist-info}/WHEEL +0 -0
- {invenio_previewer-3.4.2.dist-info → invenio_previewer-3.5.0.dist-info}/entry_points.txt +0 -0
- {invenio_previewer-3.4.2.dist-info → invenio_previewer-3.5.0.dist-info}/licenses/AUTHORS.rst +0 -0
- {invenio_previewer-3.4.2.dist-info → invenio_previewer-3.5.0.dist-info}/licenses/LICENSE +0 -0
- {invenio_previewer-3.4.2.dist-info → invenio_previewer-3.5.0.dist-info}/top_level.txt +0 -0
invenio_previewer/__init__.py
CHANGED
|
@@ -352,6 +352,6 @@ Now define the priority for all previewers by adding the newly created
|
|
|
352
352
|
from .ext import InvenioPreviewer
|
|
353
353
|
from .proxies import current_previewer
|
|
354
354
|
|
|
355
|
-
__version__ = "3.
|
|
355
|
+
__version__ = "3.5.0"
|
|
356
356
|
|
|
357
357
|
__all__ = ("__version__", "current_previewer", "InvenioPreviewer")
|
invenio_previewer/config.py
CHANGED
|
@@ -38,6 +38,21 @@ PREVIEWER_ZIP_MAX_FILES = 1000
|
|
|
38
38
|
PREVIEWER_PDF_JS_ENABLE_SCRIPTING = False
|
|
39
39
|
"""Enable JavaScript execution in PDF files (disabled by default for security)."""
|
|
40
40
|
|
|
41
|
+
PREVIEWER_PDF_JS_DOCUMENT_INIT_PARAMS = None
|
|
42
|
+
"""Additional DocumentInitParameters passed to pdfjsLib.getDocument().
|
|
43
|
+
|
|
44
|
+
See https://mozilla.github.io/pdf.js/api/draft/module-pdfjsLib.html for the full
|
|
45
|
+
list of available options.
|
|
46
|
+
|
|
47
|
+
Example (disable range requests, streaming, and auto-fetching)::
|
|
48
|
+
|
|
49
|
+
PREVIEWER_PDF_JS_DOCUMENT_INIT_PARAMS = {
|
|
50
|
+
"disableStream": True,
|
|
51
|
+
"disableRange": True,
|
|
52
|
+
"disableAutoFetch": True,
|
|
53
|
+
}
|
|
54
|
+
"""
|
|
55
|
+
|
|
41
56
|
PREVIEWER_PREFERENCE = [
|
|
42
57
|
"csv_papaparsejs",
|
|
43
58
|
"simple_image",
|
|
@@ -38,6 +38,10 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
38
38
|
const ENABLE_SCRIPTING = enableScriptingElement ? enableScriptingElement.value === "true" : false;
|
|
39
39
|
const SANDBOX_BUNDLE_SRC = "/static/js/pdfjs/build/pdf.sandbox.min.mjs";
|
|
40
40
|
|
|
41
|
+
// Get additional document init params from config (defaults to empty object)
|
|
42
|
+
const documentInitParamsElement = document.getElementById("pdf-document-init-params");
|
|
43
|
+
const DOCUMENT_INIT_PARAMS = documentInitParamsElement ? JSON.parse(documentInitParamsElement.value || '{}') : {};
|
|
44
|
+
|
|
41
45
|
const container = document.getElementById("viewerContainer");
|
|
42
46
|
const nextPageButton = document.getElementById("next");
|
|
43
47
|
const prevPageButton = document.getElementById("previous");
|
|
@@ -149,6 +153,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
149
153
|
cMapPacked: CMAP_PACKED,
|
|
150
154
|
wasmUrl: WASM_URL,
|
|
151
155
|
enableXfa: ENABLE_XFA,
|
|
156
|
+
...DOCUMENT_INIT_PARAMS,
|
|
152
157
|
});
|
|
153
158
|
(async function () {
|
|
154
159
|
const pdfDocument = await loadingTask.promise;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
{%- block page_body %}
|
|
30
30
|
<input id="pdf-file-uri" type="hidden" value="{{ file.uri }}" />
|
|
31
31
|
<input id="pdf-enable-scripting" type="hidden" value="{{ config.PREVIEWER_PDF_JS_ENABLE_SCRIPTING|default(false)|lower }}" />
|
|
32
|
+
<input id="pdf-document-init-params" type="hidden" value="{{ config.PREVIEWER_PDF_JS_DOCUMENT_INIT_PARAMS|default({})|tojson }}" />
|
|
32
33
|
|
|
33
34
|
<div id="outerContainer">
|
|
34
35
|
<div id="mainContainer">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: invenio-previewer
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.5.0
|
|
4
4
|
Summary: Invenio module for previewing files.
|
|
5
5
|
Home-page: https://github.com/inveniosoftware/invenio-previewer
|
|
6
6
|
Author: CERN
|
|
@@ -96,6 +96,13 @@ available at: https://github.com/webrecorder/replayweb.page
|
|
|
96
96
|
Changes
|
|
97
97
|
=======
|
|
98
98
|
|
|
99
|
+
Version v3.5.0 (released 2025-11-12)
|
|
100
|
+
|
|
101
|
+
- feat(pdfjs): allow passing parameters to document init
|
|
102
|
+
* Adds a new `PREVIEWER_PDF_JS_DOCUMENT_INIT_PARAMS` config to allow
|
|
103
|
+
passing init parameters to `pdfjsLib.getDocument()`.
|
|
104
|
+
- docs: add config section in API reference
|
|
105
|
+
|
|
99
106
|
Version v3.4.2 (released 2025-11-04)
|
|
100
107
|
|
|
101
108
|
- fix(pdfjs): specify Wasm URL parameter for OpenJPEG decoding
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
invenio_previewer/__init__.py,sha256=
|
|
1
|
+
invenio_previewer/__init__.py,sha256=LfePbqHmkb3MDjzDjK59K9ddMMK9ExKJKgnm2UCX31c,12292
|
|
2
2
|
invenio_previewer/api.py,sha256=ntblD3P-nAlVmL6gTx4tJHJmoJp4tOFwoVz8gMh6T5U,1708
|
|
3
|
-
invenio_previewer/config.py,sha256=
|
|
3
|
+
invenio_previewer/config.py,sha256=7QCbs8zJhVGyaBFo0UPW-w9HX_nPxsEqdltv-eTQt1Q,2627
|
|
4
4
|
invenio_previewer/ext.py,sha256=lWGOZXP78qv2PaA0lnrWkEGZ6C0kz9Mx1ioxcpnKfho,4559
|
|
5
5
|
invenio_previewer/proxies.py,sha256=vzcZDzP4MlKJAXJu2u6Las0o4fxSJ2qOmtREszPkmxM,479
|
|
6
6
|
invenio_previewer/utils.py,sha256=dj1ZAgRLs05Xiali7BHaNJR1oSm_98YbZVuH8gQ_tDw,1970
|
|
@@ -51,7 +51,7 @@ invenio_previewer/static/images/pdfjs/next.svg,sha256=s8cVHIiKmueVrJclJ-guEFe_76
|
|
|
51
51
|
invenio_previewer/static/images/pdfjs/plus.svg,sha256=jHVi4RtaGnJAeMHeTZ6fsysRx568VzbFFvraL9PmCyY,1490
|
|
52
52
|
invenio_previewer/static/images/pdfjs/previous.svg,sha256=zC_FFUD9qeGmieo3UwaekoU3L8aTgxp2WTHLOT3HvDE,577
|
|
53
53
|
invenio_previewer/static/js/fullscreen.js,sha256=1FIvn_zJSgCkrzy8NZTQ3jNUrnaCUfzZOyaFCFzY_vc,1845
|
|
54
|
-
invenio_previewer/static/js/open_pdf.js,sha256=
|
|
54
|
+
invenio_previewer/static/js/open_pdf.js,sha256=etxTvTbPiNnG3gxL3TPc37jTNKdOVeYIHppkUwvhxcA,5858
|
|
55
55
|
invenio_previewer/templates/invenio_previewer/abstract_previewer.html,sha256=oeiYsCclUn_uu_NXa42IifG63ilhOYxPXWXOa1J-C-A,563
|
|
56
56
|
invenio_previewer/templates/invenio_previewer/base.html,sha256=SnDtG7ru1USS6ihU9By_VN-Lv1SW5Wu_Z1rAdUFGTL8,803
|
|
57
57
|
invenio_previewer/templates/invenio_previewer/bottom.html,sha256=TcHhwCwyhMJKISw1FG7kzhJxw5qlyQdTfkvJncGhu7k,2190
|
|
@@ -61,7 +61,7 @@ invenio_previewer/templates/invenio_previewer/ipynb.html,sha256=UACHV9vaGYnnZ5gu
|
|
|
61
61
|
invenio_previewer/templates/invenio_previewer/json_prismjs.html,sha256=RT54rrIgDUltgm6Ud0zz3QhgBU1ruZg4cKkABmVOe1Q,387
|
|
62
62
|
invenio_previewer/templates/invenio_previewer/macros.html,sha256=_ES1RvdaXYhOnIUBVn-YFhbuW4KhRduZrSOpez6PR_0,2519
|
|
63
63
|
invenio_previewer/templates/invenio_previewer/mistune.html,sha256=DPWzm079QlLhmw1l6mtvGsggznwYoton43oJBQItTs0,483
|
|
64
|
-
invenio_previewer/templates/invenio_previewer/pdfjs.html,sha256=
|
|
64
|
+
invenio_previewer/templates/invenio_previewer/pdfjs.html,sha256=Hsg0hVDkddTUw8pK2M9uUPa5r8ICjyR6i8yn0t0MGVM,7108
|
|
65
65
|
invenio_previewer/templates/invenio_previewer/simple_image.html,sha256=yCbmWrGgrZ--I8ZbKWSJvlNLzzEqV2ay4_Klzon-cBw,391
|
|
66
66
|
invenio_previewer/templates/invenio_previewer/top.html,sha256=8Ry8B0BXv2hxLjPCp1XwJssL7M0r7ENwZTzMb29vC5Q,682
|
|
67
67
|
invenio_previewer/templates/invenio_previewer/txt.html,sha256=yiStQx2nGoVvNpFWXW3SihjwyleL8ffu1HFTWIIBePE,511
|
|
@@ -146,10 +146,10 @@ invenio_previewer/translations/zh_CN/LC_MESSAGES/messages.mo,sha256=F75XtB6vrlNO
|
|
|
146
146
|
invenio_previewer/translations/zh_CN/LC_MESSAGES/messages.po,sha256=YKEqdgACVuwj7DroAVz4b60ZeiDx3nLfB5RzXHpTF74,16227
|
|
147
147
|
invenio_previewer/translations/zh_TW/LC_MESSAGES/messages.mo,sha256=uMZNBr5-xusB4mmh8075J9LAp0lYDvILQcMwxGlhATc,807
|
|
148
148
|
invenio_previewer/translations/zh_TW/LC_MESSAGES/messages.po,sha256=S8o0foNsG4pLH8VwXu8Fq51ngLQIBkhpJ1Nfa3CEZbU,15485
|
|
149
|
-
invenio_previewer-3.
|
|
150
|
-
invenio_previewer-3.
|
|
151
|
-
invenio_previewer-3.
|
|
152
|
-
invenio_previewer-3.
|
|
153
|
-
invenio_previewer-3.
|
|
154
|
-
invenio_previewer-3.
|
|
155
|
-
invenio_previewer-3.
|
|
149
|
+
invenio_previewer-3.5.0.dist-info/licenses/AUTHORS.rst,sha256=wcFhv9iJlZPq0MkvNHDVBEn5iXZGsVfC32yjS2jW9CQ,486
|
|
150
|
+
invenio_previewer-3.5.0.dist-info/licenses/LICENSE,sha256=p3bBZtg1gwhzibgFe4OuiiUStzewJS5TD6MC5Vu1uSM,1067
|
|
151
|
+
invenio_previewer-3.5.0.dist-info/METADATA,sha256=ghLnS-FBPU63Jt5Ac9fPm6eEco7zZUWoozPfKzb0spM,9503
|
|
152
|
+
invenio_previewer-3.5.0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
153
|
+
invenio_previewer-3.5.0.dist-info/entry_points.txt,sha256=gYe4eWC5Pul52jSjV_sdeIffYCm6KzwHhNkUsxrm7vc,916
|
|
154
|
+
invenio_previewer-3.5.0.dist-info/top_level.txt,sha256=BwA4Jo3Wv0rLjDkEuCEIR2W-lz1EXRc7h9jzDwaMK3o,18
|
|
155
|
+
invenio_previewer-3.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{invenio_previewer-3.4.2.dist-info → invenio_previewer-3.5.0.dist-info}/licenses/AUTHORS.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|