Skip to content

Commit 045af16

Browse files
committed
add document viewer advance configuration
1 parent 8ec6605 commit 045af16

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

content/en/docs/marketplace/platform-supported-content/widgets/document-viewer.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ These are the dimension configurations for document viewer:
4545
* **Maximum Height** — Determines the maximum size for the custom charts container.
4646
* **Vertical Overflow** — If maximum height is set, vertical overflow will determine the widget's behavior to show overflowing content if that content exceeded the maximum height allowed.
4747

48+
## Advanced {#advanced}
49+
50+
The **Advanced** tab allows you to configure settings for features that is beyond the normal configurations.
51+
52+
* **PDF.js worker URL** — Configure the path for pdfjs worker script. This worker script is needed to render PDF type document using [pdfjs](https://github.com/mozilla/pdf.js?tab=readme-ov-file#including-via-a-cdn) library.
53+
* If left empty, the document viewer widget will retrieve pdfjs from CDN `http://unpkg.com/pdfjs-dist@4.8.69/build/pdf.worker.min.mjs`.
54+
* Alternatively, user can grab `pdf.worker.mjs` from `[Local Development Project Folder]/deployment/web/widgets/com/mendix/shared/pdfjs/pdf.worker.mjs` and put it into their own `App Module -> Styling/web/js/pdf.worker.mjs` and set "`./js/pdf.worker.mjs`" as the worker URL configurations. This is recommended practice to support [CSP](/howto/security/csp/).
55+
56+
4857
### Common Tab
4958

5059
For more information, see [Common Section](/refguide/common-widget-properties/#common-properties) in *Properties Common in the Page Editor*.

content/en/docs/marketplace/platform-supported-content/widgets/security/_index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ You can enable `allowlist` CSP for [Color Picker](/appstore/widgets/color-picker
3535
style-src 'self' 'unsafe-inline';
3636
```
3737

38+
### Document viewer
39+
40+
You can enable CSP for document viewer by setting up pdfjs worker url to local path.
41+
See document viewer [advanced](/appstore/widgets/document-viewer/#advanced) configuration for more detail.
42+
3843
### HTML/JavaScript Snippet
3944

4045
For information on HTML/JavaScript Snippet widget CSP configurations, see [HTML/JavaScript Snippet CSP](/appstore/widgets/security/content-security-policy/html-javascript-snippet-csp/).

0 commit comments

Comments
 (0)