Document generated from a script
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):
<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'.
ATTENTION! The script service does not support the methods:
getParameters()
getFirstParameter()
getInputParameters()
In order, for example, to retrieve component values from the form you can use the getValue() method → example in demo_generowanieDokumentu
Last updated
Was this helpful?
