When developing a form in Lasernet there may be a time when you wish to add static pages into the final document. For example, a multi-page Terms and Conditions document for a bank report or some promotional material for a bill. This article will show how to add a static Terms and Conditions document.
Generating the Overlay
The Terms and Conditions document needs to be implemented into Lasernet, for this the T&C document needs to converted to an overlay. An overlay is traditionally used as the background of a form but we can use the same method to import the file. Either a single or multiple-page document can be used as the process is still the same. Follow these steps:
1. Ensure that the Lasernet Print Capture 8 Windows service is running. and then take the document to be turned into an overlay and print to the Lasernet Print Capture printer. This printer is automatically created when the Lasernet Developer is installed.
2. Open your build in Lasernet Developer, open your list of forms and click the Overlay Files button.
3. A new window will appear at the bottom and display the overlay files that are currently in use and then click the Import button.
In the new window, the original document filename should appear in the window if it has been printed correctly.
4. Highlight the file, click the Import button and give it a sensible name to make identification later easier.
Adding the File retriever modifier
In order to use the overlay, a modifier is needed to pick up the file. If using a single page overlay, there would be no need to do this as the overlay can be set as an additional sheet directly on the form.
For a multiple sheet overlay, follow these steps:
1. Add a File Retriever modifier to the build by selecting the Modifier button in the bottom left of Lasernet Developer and double-clicking the modifier name.
2. Set the Path to the location where the imported file is stored. In the build folder, this will be the Overlay folder or you can store them somewhere else. It is important that this location be accessible on the server where the Lasernet service is running and the service user has access to this file.
3. Set the FileName JobInfo to a sensible name that is not used previously, for example ‘PickupFile’. The name of the file to be picked up is stored in a jobinfo and it will be set on the form.
4. The Output JobInfo needs to be ‘JobData’
5. Ensure that the Replace JobInfo checkbox is selected and then save the settings.
This modifier can now be added to the form.
Setting up the form
With the modifier now configured and set up, this then needs to be added onto the form and the JobInfo set containing the filename. Follow these steps:
1. Create a new sheet specifically for the Terms and Conditions page.
2. Within this sheet, add the JobInfo used in the above section. In this example, ‘PickupFile’ is needed.
If the name of the file that you want to pick up is static, double-click the new sheet you have added to bring up its properties and add the JobInfo on the Pre Jobinfos tab
If the name of the file that you want to pick up is dynamic, then it is best to include it in your input data. Add the JobInfo by clicking the JobInfo button on the left-hand side and highlighting the data to set as the JobInfo value.
The value of the JobInfo needs to be the full filename including the extension, eg ‘EFS T&C.lnemf’.
Add the File Retriever
You can add the File Retriever module onto the form and sheet by following these steps:
1. Double-click the sheet we previously added and go to the Modifiers tab.
2. Click Add at the bottom left and find the name of the module within the drop-down list.
3. Set the Sheet point as Sheet End.
4. Using Shift + F5 to run all the scripts on the form, in the log you should see the following occurrences in progress:
- The JobInfo being set that is storing the name of the file to pickup, ‘PickupFile’.
- The modifier being run at Sheet End.
- The JobData JobInfo being set to a binary data value not equal to 0; this indicates that the file has been picked up and stored in the JobInfo.
If required, the process can be repeated to allow for multiple sheets and for multiple different overlays to be used at the same time.
Combining the Terms and Conditions
After following these steps, you should now have at least one sheet that is picking up an overlay file and storing this in the JobData JobInfo. We now need to combine this sheet together with your existing sheets to generate the desired output PDF.
Depending on how many other sheets you have, there are a few options available, but combining with other sheets must be done in a PDF Engine. For best practice, it is best to have a separate PDF Engine for any combining that must be done.
1. Find the PDF module in the Engine module list and double-click to add it to your build.
2. Give the module a sensible name and navigate to the Combining tab, click the Enable job combining checkbox to enable the job combining options.
For best practice and to make sure that documents are only combined as expected, we first need to create a Link Jobinfo.
1. Click the Link Jobinfos button to open another window where further information can be added
2. Give the name of a JobInfo that links the Terms and Conditions sheet with other sheets in your form. For example, an order number and system JobInfo RecognizedForm would be a good combination.
It is also recommended to add in a released order JobInfo. This will make sure that the sheets are combined in the order as expected. Creating a JobInfo ‘ReleaseOrder’ on all sheets and giving them a value dictating the order of combination is a good idea, i.e. Sheet 1 = #1, T&c = #2, Sheet 3 = #3, etc.
If you have more than two sheets, where possible, combine the non-terms and conditions within the form with sheet combining and then direct the sheets to the PDF for combining. See the below image for a further explanation:
3. Update the Lasernet service and pass in an input file. The output should now produce a PDF that has picked up the Terms and Conditions and added it in with the input data.
Share