Description

This example will show how the ImageTemplateReceiver can be used to generate check images filled with synthetic data. 


Domain and Attribute Initial Setup

A Check Domain has been created within a Project Version. The ImageTemplateReceiver has been assigned to the Check Domain, and a Scenario has been created. 



The Check Domain contains the following Attributes and assigned Generators: 

  • fullName = FullNameGen
  • address = AddressGen
  • city = USStateCapitalGen
  • state = USStateAbbreviationGen
  • zip = USStateCapitalZipCodeGen
  • fullAddress = ConcatGen (combines city/state/zip to look like this "Chicago, IL 60018")
  • date = FlexibleDateRangeGen
  • payee = CompanyNameGen
  • payerSignature = ReferenceGen (references the value generated by the fullName Attribute)
  • for = ListGen (e.g. Taxes, Catering, N/A, Party, Supplies)
  • numberDollarAmount = RandomMoneyGen
  • textDollarAmount = NumberToWordsGen (references NumberDollarAmount Attribute generated value)


fullAddress Attribute - Generator Configuration


date Attribute - Generator Configuration


for Attribute - Generator Configuration


payerSignature Attribute - Generator Configuration


numberDollarAmount Attribute - Generator Configuration


textDollarAmount Attribute - Generator Configuration


Preview of Generated Data


Step 1: Configure Receiver Parameters

Next, make any needed changes to the ImageTemplateReceiver's Parameters. Select the ImageTemplateReceiver within the Domain Dashboard. Make any required changes and click the Save button. 



For this example, the following Parameters have been changed: 

  • subDir Parameter - All generated images will be placed in an images directory.


Step 2: Upload the Check Image

  • Click on the Manage Image Template button to access the Management Dashboard.


  • Click on the Upload Image button to upload the template image that will be augmented.




  • Click on Choose File to browse for and select the template image.



  • Click the Save button.



  • The uploaded image will be displayed within the ImageTemplateReceiver Management Dashboard.



Step 3: Add Attributes to the Template Image

  • Click on the Attribute Name within the Attribute's Pane to select it.


  • Click and drag in a location on the image to place the Attribute.


  • Click the Save (disk) button to the right of the Attribute name. 



  • A Checkmark will be displayed to the left of the Attribute name.


  • The Attribute name will appear in the location on the check image. 


  • Click the Preview Tab to see what the image will look like: 


  • Click on the Setup Tab to return.



  • The Attribute's Receiver Property Keys (e.g., Background, Font Family, Font Size, etc.) within the Setup Tab can be used to modify the added Attribute.

  • Select the Attribute and then make any needed changes to the Property Keys. The selected Attribute will be highlighted in blue.


  • Next, click on each Property Key to change or enter a value.


  • For this example, the fontSize Property Key value has been changed to "14".
      


    Note: The xCoordinate, yCoordinate, width, and height Property Keys can be used to change the position and size of the Attribute on the Template Image.


  • Click the Save icon after many any changes for the Attribute.



  • The font for the fullName Attribute is now smaller on the check image. 


  • Complete these steps for each Attribute that should be added to the Template Image.


    Note: All Attributes have a fontSize of "14" in the sample image. The fontType Property Key for the payerSignature Attribute has also been set to "Italic."

  • A prompt will appear if an unsaved change is detected in the Property Keys of the already selected Attribute. Click Yes to update before moving to the next Attribute.



  • The completed check will appear as shown below: 


    Image Preview


  • Click on the Return to Receiver button to return to the Receiver Parameter Configuration.


Step 4: Generate the Images using GenRocket Runtime

  • Download the Scenario from the Domain Dashboard by clicking on the Cloud icon.



  • Open a Command Prompt or Terminal window and run the following command.

    genrocket -r <ScenarioName.grs>

    Note: <ScenarioName> should be replaced with the actual name of the Scenario, Scenario Chain, or Scenario Chain Set.


Sample Output

Below is a sample check image created by the ImageTemplateReceiver: 



Additional Reading - Use Case 2 

The ImageTemplateReceiver also has gr Property Keys. These can be used to set the Property Key (e.g., background, fontFamily, fontSize, fontColor) to an Attribute-generated Value.


Use case 2 will show how to generate checks with different signature colors (red, blue, black). To see the complete use case, please see ImageTemplateReceiver:Generate Checks with Different Signature Colors.