Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to documentation #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1 @@
FileDocumentViewer [![Support](https://img.shields.io/badge/Mendix%20Support%3A-Platform-green.svg)](https://docs.mendix.com/community/app-store/app-store-content-support)
==================

This widget allows to embed and view any System.FileDocument object inside a form. In the modeler, using microflows or the file downloader, documents can be opened as download or inside a new window. With this widget however, files can be opened inside dataviews.

Please take note that this will only work for Documents that can normally be viewed in the browser. We support viewing PDF either natively (Chrome, Firefox) or through PDF.js. Files like Word or Excel are usually not viewable in the browser. If you try this with the FileDocumentViewer, the browser will not view the document, but download it.

## Contributing
For more information on contributing to this repository visit [Contributing to a GitHub repository](https://world.mendix.com/display/howto50/Contributing+to+a+GitHub+repository)!

## Configuration
Add the widget to a dataview. The context object should inherit from the System.FileDocument entity.

## Features
The widget tries to display a document inside a form, however it might fail to do this (in which case a download popup is opened) since the browser settings determine whether it is allowed or not to open a document inside a form. For example IE might succeed in opening a .doc file inside a form and fail in opening a .png image inside a form, while exactly the opposite might be true for FireFox.

## Properties

* `Title` - String attribute of which the contents will be set in the header.
* `Show header` - Determines whether or not a header will be rendered.

## PDFJS support

In the Modeler there is the option `Use PDF js`. This will take over the rendering of the PDF, because native rendering is not supported on Android. That is why we include [PDF.js](https://mozilla.github.io/pdf.js/), created by Mozilla (PDF.js is actually a part of Firefox). Make sure the documents you are trying to view are PDF files, otherwise the widget will fail to show the document. Use this option if you are having trouble viewing the documents on mobile devices for example.
Please see [Document Viewer](https://docs.mendix.com/appstore/widgets/document-viewer) in the Mendix documentation for details.