PDF Document Generation Installation and Configuration

Last modified: January 6, 2026

Installation

Follow the instructions in How to Use Marketplace Content to import the Documentation Generation module into your app.

Configuration

  1. In the App Explorer, open the App section, double-click Settings, then go to the Runtime tab, and configure the ASu_DocumentGeneration_Initialize microflow for the After startup property. If there is already an after startup microflow set, add the ASu_DocumentGeneration_Initialize microflow as an action in the existing microflow.

  2. In the App Explorer, double-click Security in the App section, and then set the Security level to Prototype/demo or Production.

  3. In the App Explorer, double-click Security in the App section again, then go to the User roles tab and perform the following steps:

    1. Add the module role User from the DocumentGeneration module to all app user roles that should be able to generate a document.
    2. Add the module role Administrator from the DocumentGeneration module to all app user roles that should be able to register the app environments on Mendix Cloud.
  4. To clean up old document requests, enable the scheduled event SE_DocumentRequest_Cleanup in the _UseMe folder of the DocumentGeneration module. This will automatically remove expired DocumentRequest objects after a configured offset in days. The offset is configured using the constant DocumentGeneration.RequestCleanupOffsetInDays (the default value is 7 days). The scheduled event runs daily at 03:00 UTC.

  5. To test the module locally, perform the procedure as described in the Running locally from Studio Pro section.

  6. When deploying your app, consider that we currently support two types of deployments:

    1. Running on Mendix Cloud using the PDF Service in the Mendix Public Platform. This option is available for apps that are deployed to the following environments:

    2. Running on self-hosted for airgapped and on-premises using a self-hosted version of the PDF Service:

Running Locally from Studio Pro

To be able to test PDF document generation when using Run Locally inside Studio Pro, you need to have Chrome or Chromium installed on your local machine.

Chrome

The PDF Document Generation module automatically tries to find the Chrome executable (chrome.exe) in the default installation paths.

If you have installed Chrome in a custom location, configure the path to the Chrome executable in the constant CustomChromePath in the _UseMe > Configuration folder.

Chromium

If you use Chromium, only use stable releases. The currently supported stable release is 112.0.5615.0.

Download the chrome-win.zip package and extract the archive to a location of your choosing.

Configure the path to the chrome.exe executable in the CustomChromePath constant in the _UseMe > Configuration folder.

Running on Mendix Cloud

To allow the module to send and receive document generation requests on your Mendix Cloud environments, you need to perform the following steps:

  1. If your app is deployed on Mendix Cloud or Mendix Cloud Dedicated, enable the DocGen request handler.

  2. Register your app environments.

  3. If your app is configured to restrict access based on IP address, add the IP addresses used by the DocGen service to the list of allowed addresses.

Enabling the DocGen Request Handler for Licensed Apps

  1. Make sure that you have configured the DocumentGeneration module as described in the Configuration section.

  2. Make sure that you have the application deployed to the desired Mendix Cloud.

  3. If the app does not have any access restrictions, you can skip this step. If the app has a configured access restriction profile that disables communication with the internet, you need to make sure that the app can communicate with the Document Generation service in the Public Cloud. To allow the module to send and receive document generation requests in your Mendix Cloud environments, enable the DocGen request handler as follows:

    1. Go to the Environments page for the app as follows:

      • Go to the Nodes page, then, in the Public Cloud - Nodes list, find the desired app, then click Environments.
      • Alternatively, go to Apps, then in the My Apps list, find the desired app, then click Environments.

      The app's Environments page opens. The Overview tab shows a list of available environments for your app.

    2. On the Overview tab, click Details for the respective environment.

    3. In the specific Environment Details page, select the Network tab.

    4. Scroll down to Path Based Access Restrictions and click Add. The Edit Path Based Access Restriction dialog box opens.

    5. Fill in the fields as follows:

      • In the Path field, enter /docgen/.

      • From the New Restriction Type drop-down list, select one of the following options:

        • Allow all access – Allows unrestricted bidirectional access to the /docgen/ path. This is less secure and gives full internet access to this path.
        • Custom Profile for Client Certificates and/or IP ranges – Applies a custom access restriction profile to the /docgen/ path. When you select this option, choose your access restriction profile from the New Restriction Profile drop-down list. Ensure that the selected profile allows bidirectional access to the /docgen/ path.
          To configure the required IP addresses, follow the Allowing the Document Generation Service IP Addresses section.
          For more information on managing access restriction profiles, refer to Access Restrictions.
    6. Click Save. The /docgen/ path is added to the list.

    7. Restart your application for the new request handler to take effect.

    8. Now you can register your app environments.

Allowing the Document Generation Service IP Addresses

If your app is configured to restrict access for incoming requests using IP restrictions, you must add the outbound IP addresses of the DocGen service to the list of allowed addresses.

Registering Your App Environments

  1. Add the snippet Snip_AppRegistration to a page in your app that is accessible to users with the Administrator module role set in the DocumentGeneration module. The snippet can be found in the _UseMe > Admin folder of the DocumentGeneration module.

  2. Enable the scheduled event SE_AccessToken_Refresh to automatically refresh the access token that is used to secure access to the Document Generation cloud service. The scheduled event can be found in the _UseMe > Scheduled events folder of the DocumentGeneration module.

    • In version 1.6.0 and above, for apps deployed on Mendix Free Cloud, a Renew app registration button will be visible in the Snip_AppRegistration snippet if your registration is going to expire within 24 hours or has already expired. You can use this button to manually refresh your token.
  3. Make sure that your changes are deployed to your Mendix Cloud environment.

  4. Sign in to the app environment you want to register.

  5. Navigate to the page that contains the Snip_AppRegistration snippet.

  6. Follow the steps on the page to register your app environment.

Running on self-hosted for airgapped and on-premises

Running Private PDF Document Generation Service

When access to the public Mendix PDF generation Service is restricted, particularly in isolated or airgapped environments, Mendix offers a privately hosted, Docker containerized PDF Document Generation Service as an alternative. With this deployment type, you can host the document generation service on your own infrastructure and have full control over resources, availability and scalability. In addition, this option offers configurable limits, such as the maximum file size and maximum page rendering time.

It is available starting with module versions 1.11.0 for Studio Pro 9, and 2.1.0 for Studio Pro 10. For more detailed information, installation guide and configuration, refer to Private PDF Document Generation Service.

Running a local version of the PDF Service on Windows or Linux

To configure the module to generate documents on your on-premises environments, you need to perform the following steps:

  1. Make sure that you have the prerequisite software installed.
  2. Configure the module to use the local service.
  3. Enable the DocGen request handler.
Installing the Prerequisite Software

You should pre-install and actively maintain the following software. Mendix does not provide support for the installation, configuration, and maintenance of these packages.

Chromium

You should have installed a stable release of the Chromium browser. The currently supported stable release is 112.0.5615.0 (Windows. Linux).

Node.js

You should have installed a stable release of Node.js. Mendix recommends installing the same version that is shipped with the Studio Pro version that is used to build the project. You can find this version by locating and executing the node executable within the modeler/tools/node folder of your Studio Pro installation.

Certificate Requirements

Both the Mendix and Node.js runtime need to trust the SSL/TLS certificate that is used to secure connections to the Mendix app. If you are using a custom Certificate Authority (CA), make sure that the Node.js runtime trusts the CA. If Node.js does not recognize the CA by default, set the NODE_EXTRA_CA_CERTS environment variable to point to the applicable certificate file, which should be in a .cert or .pem format.

The user account that is used to execute the Mendix runtime needs read access to the certificate file.

Configuring the Module to use the Local Service
  1. Set the OverrideServiceType constant to Local in the _UseMe > Configuration folder. This enforces the use of the local service instead of the cloud service.

  2. Configure the path to the chrome executable in the CustomChromePath constant in the _UseMe > Configuration folder.

  3. Configure the path to the node executable in the CustomNodePath constant in the _UseMe > Configuration folder.

Enabling the DocGen Request Handler

In case you deploy on Microsoft Windows, you need to add the following rules when configuring the reverse proxy inbound rules:

RuleNamePatternRewrite URL
1p^(p/)(.*)http://localhost:8080/{R:1}{R:2}
2docgen^(docgen/)(.*)http://localhost:8080/{R:1}{R:2}