You will use a Word Publishing Template Preprocessing logic when you need to:
-
To prepare data which are then used in the Word template (which is then later converted to PDF).
Logic API
-
Logic Nature: default
-
Logic Type: Calculation/Pricing
-
-
Execution Types:
-
Standard - to prepare the data in the shape suitable for the Word template.
-
-
Information provided to the logic:
-
api.currentItem()- The object being published (e.g., a Quote document).
-
-
Expected logic execution outcome:
-
The result values of logic elements will be provided to the Word template, under keys named by the name of elements, i.e., like a map
[ <element1Name> : <element1Result>, <element2Name> : <element2Result>, …].
-
Configuration
The preprocessing logic is set up as part of the Word publishing template on the page Administration › Configuration › Templates › Publishing Templates.
Code Sample
-
PublishingTemplate_Quote_Publishing_Template - example preparing the values of quote line inputs and outputs to a data structure easy to consume by the word template.