Instant Doc Viewer

Content Type: Widget
Categories: Utility,User Interface

Overview

The Instant Doc Viewer widget is a versatile file viewer designed for seamless integration into Mendix applications. It allows users to preview and render various file types, including images, PDFs, Excel sheets, and Word documents, directly within the application without requiring external downloads.

Key Features:

  • Multi-File Support: View .docx, .xlsx, .pdf, .png, .jpg, and more.
  • In-App File Rendering: Displays documents and spreadsheets in a clean, responsive interface.
  • Excel to PDF Conversion: Converts Excel files into PDF format for consistent rendering.
  • Word Document Parsing: Handles paragraphs, images, and tables while preserving content sequence.
  • Optimized for Performance: Leverages modern libraries for smooth document processing.
  • Customizable Layout: Adjustable width and height for embedding in various page designs.

This widget is ideal for scenarios where quick document previewing is essential, such as dashboards, user portals, or file management systems.

Documentation

Typical usage scenario

The Instant Doc Viewer widget is ideal for applications where users need to preview files quickly without downloading them. It is perfect for document management systems, employee or customer portals, and workflow automation, enabling seamless viewing of files like Word documents, Excel sheets, PDFs, and images directly within the app. This widget enhances productivity and simplifies file handling in dashboards, educational platforms, and administrative tools.

Features and limitations

Features

  • Multi-File Support: View .docx, .xlsx, .pdf, .png, and .jpg files directly in the app.
  • Excel to PDF Conversion: Converts Excel files into PDF format for consistent rendering.
  • Word Document Parsing: Preserves the sequence of paragraphs, images, and tables in .docx files.
  • Responsive Design: Adjustable width and height for seamless integration into any layout.
  • In-App File Rendering: Eliminates the need for external viewers by displaying files within the application

Limitations

  • Advanced Formatting: May not fully support complex .docx formatting, such as custom fonts or nested tables.
  • File Size Limitations: Files larger than [X MB] may cause slower rendering.
  • Unsupported File Types: Does not currently support .pptx or audio files.

Dependencies

To successfully integrate and use the Instant Doc Viewer widget in your Mendix applications, ensure the following dependencies are installed:

  1. External Libraries (Bundled in the widget):

    • jsPDF: For PDF creation and rendering.
    • XLSX (SheetJS): For reading and processing Excel files.
    • docx,mammoth: For parsing and handling .docx files.
  2. Mendix Requirements:

    • Mendix Version: Compatible with Mendix 9.x or higher.
    • File Entity: The widget requires a file entity generalized from System.FileDocument to store and fetch files.

ConfigurationĀ 

Follow these steps to configure the Instant Doc Viewer widget in your Mendix application:

  1. Add the Widget to Your Page:

    • Drag and drop the Instant Doc Viewer widget from the toolbox onto your desired page.
  2. Set the Data Source:

    • Bind the widget's Data Source property to an entity generalized from System.FileDocument.
  3. Configure File Properties:

    • Map the File Name attribute to the file name in your data model.
    • Set optional properties like Width and Height to define the widget's dimensions.
  4. Testing:

    • Upload files (e.g., .docx, .xlsx, .pdf, .png, or .jpg) to the bound entity.
    • Open the page and ensure the files render correctly within the widget.
  5. Optional:

    • Adjust CSS styles in the FileViewer.css file for further customization.

That's it! Your Instant Doc Viewer widget is ready for use.

Releases

Version: 1.1.0
Framework Version: 9.24.31
Release Notes: What's New: - Updated the implementation to handle large excel files.
Version: 1.0.0
Framework Version: 9.24.31
Release Notes: What's New: - Multi-File Support: Preview multiple file types, including: Documents: .docx ,txt Spreadsheets: .xlsx Images: .png, .jpg PDFs: .pdf videos : mp4 Excel to PDF Conversion: Seamlessly convert Excel sheets to PDFs for easy viewing. Word Document Parsing: View .docx files that contains text type contentl Responsive Design: Adjustable dimensions for smooth integration into Mendix applications. In-App File Rendering: Avoids the need for external downloads, keeping users within the application. Key Features: 1) Supports rendering for files stored in Mendix file entities. 2 ) Uses jsPDF for rendering and converting documents. 3 ) Uses xlsx library for converting excel file into pdf. 4 ) Uses mamoth for rendering into docx file and converting into pdf 5) Fully responsive and customizable layout. 6 ) Lightweight and optimized for fast performance. Known Limitations:- 1) Complex .docx files with advanced formatting (e.g., custom fonts or nested tables) may not render perfectly. 2) Does not currently support .pptx or video file types. 3) File size exceeding 10MB may cause slower rendering. Upcoming Features :- 1) Support for additional file types (e.g., .pptx, .csv). 2) Enhanced rendering for documents with advanced formatting.