Document generated from a script

The availability of features depends on the license and may not be available in all deployments.

The document can be generated using a script that the form designer specifies in the document generator configuration. In such a case you should use the generator type 'documentFromScript'.

Example configuration (XML fragment):

Example of the form source
<data:DocumentGeneratorItems>
  <data:DocumentGeneratorItem 
      generatorName="documentFromScript" 
      fileName="Wniosek Dobry Start.pdf" 
      scriptName="adap_document-*"/>
</data:DocumentGeneratorItems>

The new generator type is distinguished by two key elements:

  • generatorName must take the value documentFromScript

  • scriptName points to the script service in the format: SCRIPT_SERVICE_NAME-VERSION_NUMBER (e.g. adap_document-*).

The script service that is linked to the document generator should return two fields:

  • output - the file content encoded in base64 format (required),

  • fileMimeType - the file content-type; optional parameter – if not returned, the generator will assume the default value 'application/pdf'.

Demo form: demoScriptDocumentGenerator

The script used on this form: demo_generowanieDokumentu

Last updated

Was this helpful?