Chromium Puppeteer Receipt Service

   Journey Manager (JM) The transaction engine for the platform. |   System Manager / DevOps |  19.05 This feature was introduced in 19.05.

Manager provides the Chromium Puppeteer Receipt service, which you can use to generate dynamic PDF receipts of forms. The service utilizes the PuppeteerPuppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome or Chromium. library that supports a wide range of styling options.

To create the Chromium Puppeteer Receipt service:

  1. Select Services > Core Global Services and click New.
  2. Select Render Receipt from the Service Type dropdown list.
  3. Select Chromium Puppeteer Receipt from the Service Template dropdown list.
  4. Update the service name in the New Name field.
  5. Update the service version in the Version Number field.
  6. Select an optional organization from the Organization dropdown list.
    Note

    If organization is blank, the service will be global, otherwise it will be available to the selected organization only.

    Manager chromium puppeteer service configuration
  7. Click Save to update the changes.

To configure the Chromium Puppeteer Receipt service:

  1. Select Services > Core Global Services.
  2. Locate the service and click Edit.
  3. Click the Service Definition tab to edit the standard service configuration.
  4. Click the Parameters Edit tab to view or update the service configuration.
  5. Select the Cleanup Receipt Files checkbox to clean up the receipt files after rendering has completed.
  6. Edit the fallback process timeout (in milliseconds) in the Fallback Timeout field. The default is 3000.
  7. Select the maximum number of concurrent processes from the Max Processes dropdown list. The default is 2.
    Note

    Changing Max Processes will not take effect until a Manager server is restarted.

  8. The Puppeteer Exe field contains the file name of the puppeteer executable that will be run to generate a receipt. Modify the file name as required, without the Windows .exe file extension. The default value is puppeteer.
  9. Click Receipt Properties Json to edit the properties that will be passed to the puppeteer.js script for rendering of customized headers and footers.
    {
    	"viewportSize": {
    		"width": 800,
    		"height": 600
    	},
    
    	"paperSize": {
    		"format": "A4",
    		"landscape": false,
    		"margin": {
    			"top": "1.5cm",
    			"left": "1.5cm",
    			"bottom": "1.5cm",
    			"right": "1.5cm"
    		}
    	},
    	"headerTemplate": "",
    	"footerTemplate": "<div style='width:100%;text-align: center;'><span style='font-size: 8px;'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></span></div>",
    	/* TJM configuration options */
    	"config": {
    		"loadTimeoutMS": 20000,
    		"postLoadTimeoutMS": 500,
    		"logOptions": true,
    		"logHeadersFooters": true,
    		"logResourceEvents": true,
    		"logFormCallbacks": true,
    		"disableFormOverrides": true, 
    		"supportOldStyleFormOverrides": "composer", 
    		"treatFormErrorsAsFatal": false,
    		"forceError": false, 
    		"customCSS": ".phantom-header {} .phantom-footer {}"
    	}
    }
  10. Click Save to update the changes.
  11. Assign this service to your form version as the Receipt Render Service, so it can render a form submission as a PDF receipt. You can also make this service as default.
Note

Customizing the Chromium Puppeteer Receipt service will impact all receipts of forms that are linked to this service.

Next, learn how to view core global services.