Document generated from a script
The document can be generated using a script that the form designer provides in the document generator configuration. In this case, use the generator type 'documentFromScript'.
Configuration example (XML fragment):
<data:DocumentGeneratorItems>
<data:DocumentGeneratorItem
generatorName="documentFromScript"
fileName="Good Start Application.pdf"
scriptName="adap_document-*"/>
</data:DocumentGeneratorItems>The new generator type is distinguished by two key elements:
generatorName must take the value documentFromScript
scriptName indicates the script service in the format: SCRIPT_SERVICE_NAME-VERSION_NUMBER (e.g. adap_document-*).
The script service, which is connected to the document generator, should return two fields:
output - file content encoded in base64 format (required),
fileMimeType - file content-type; optional parameter – if it is not returned, the generator will assume the default value 'application/pdf'.
NOTE! The script service does not support methods:
getParameters()
getFirstParameter()
getInputParameters()
To, for example, retrieve the values of components from the application, you can use the getValue() method → example in demo_generowanieDokumentu
Last updated
Was this helpful?
