Skip to content

Commit bd6ba98

Browse files
authored
Merge pull request #10138 from gjulivan/development2
Add document viewer advance configuration
2 parents 772f55a + 45e3d9b commit bd6ba98

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

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 beyond the normal configurations:
51+
52+
* **PDF.js worker URL** — Configures the path for PDF.js worker script. This worker script is needed to render PDF type document using a [PDF.js](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 PDF.js from CDN `http://unpkg.com/[email protected]/build/pdf.worker.min.mjs`.
54+
* Alternatively, users can grab `pdf.worker.mjs` from `{LOCAL DEV PROJECT FOLDER HERE}/deployment/web/widgets/com/mendix/shared/pdfjs/pdf.worker.mjs`, put it into their own `App Module -> Styling/web/js/pdf.worker.mjs` file, and then set `./js/pdf.worker.mjs` as the worker URL configuration. This is the 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ You can enable `allowlist` CSP for [Color Picker](/appstore/widgets/color-picker
3535
style-src 'self' 'unsafe-inline';
3636
```
3737

38+
### Document Viewer {#document-viewer}
39+
40+
You can enable CSP for document viewer by setting the PDF.js worker URL to the local path. For more configuration information, see the [Advanced](/appstore/widgets/document-viewer/#advanced) section of *Document Viewer*.
41+
3842
### HTML/JavaScript Snippet
3943

4044
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)