Lexmark X925 Lexmark Document Distributor - Page 30
mergeContext, mergeContext field to which
View all Lexmark X925 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 30 highlights
Developing workflow solutions 30 Assign callback functions to the following fields of the mergeContext top‑level object at the end of the main() function (or, when using exception handling, at the end of the try block within the function): mergeContext field to which the callback function is assigned Stage of forms merge at which the assigned function is called mergeContext.renderDataPage After each page of input data is read Parameters of assigned callback function page-DataPage object containing the data from the page mergeContext.endDoc mergeContext.endDataSet After input from a single form is completed and the resulting PDF is rendered fileName-String containing the path and file name of the output PDF After input from a single form is completed and the resulting dataset is generated Note: A dataset is generated only if this callback function is defined. fileName-String containing the path and file name of the dataset, which can be sent to a printer with a forms card mergeContext.endData After all input data is read None mergeContext.endJob After all PDFs included in the job have files-Array of strings containing the been rendered file names of all output PDFs A forms merge script with all callback functions defined is structured as follows: function main() { try { //Actions to take when job is first submitted ... //Assignment of callback functions mergeContext.renderDataPage = myRenderDataPageFunction; mergeContext.endDoc = myEndDocFunction; mergeContext.endDataSet = myEndDataSetFunction; mergeContext.endData = myEndDataFunction; mergeContext.endJob = myEndJobFunction; } catch(e) { //Logging and other exception handling ... throw e; } } function myRenderDataPageFunction(page) { try { //Actions to take after each page of data //is read from the input data ... } catch(e) { //Logging and other exception handling ... throw e; }