Skip to main content

Insert Text - Knowledgebase / Lasernet / Lasernet Training / Lasernet Form Editor 9 - Designing Forms - Formpipe Support Portal

Insert Text

Authors list


The Text tool is a Rearrange object that appears in the form view only. You can activate the tool by clicking the Text button on the toolbar or by adding a text element to an existing Rearrange by clicking the Add button on the Objects tab of the Edit Rearrange dialog.

You can use the Text tools to add the following types of elements to your output form:

Fixed text
Inserts a static text.

Current time
Displays the current time.

Current date
Displays the current date.

JobInfo
Inserts a value of JobInfo.

Page x of y
Inserts page numbering on the output pages where X = current page number and Y = total number of pages, e.g.: "Page 3 of 5".

Script
Inserts a script on the output form for execution.

Exercise

Download and import the attached configuration called 10. Insert Text in Lasernet Developer 9. Afterwards, go to the Forms section and open the Sample form.

1. Add a new Rearrange similar to the one illustrated on the picture below:



2. Set the X position to 20 and Y to 15.


3. Switch to the Objects tab to insert a text.

4. Click the Add button. A string is now merged with a Text input element from the Rearrange.

5. As Object type select Fixed text (default).

6. In the Fixed text field, type A Fixed Text is merged with a Rearrange.


7. Switch to the Formats tab and select the Before text box in the Newline group box to insert a new line between the Rearrange and the Fixed text.


8. Switch to the Fonts tab to change font settings for the Fixed text element. Click the Bold button.

9. The Objects list now contains two elements. A Rearrange with a Text element and a Fixed Text.


The elements are merged into one output object with unique font settings for each input element.


10. On the Developer toolbar, click the Text tool to insert a new Fixed text. In the output view, move the cursor to the following position: X = 20 and Y = 50 and click there. The New Insert Text value (default) is inserted. Select the text and press F2 to activate the text edit mode. Change the text to Date:.

11. Move the cursor to X = 20 and Y = 60. Add a new Insert text and edit its settings. Set Object type to Current time and select hh:mm:ss.zzz.


The following time formats are supported:

a. hh = hours
b. mm = minutes
c. ss = seconds
d. zzz = milliseconds
e. h:m:s ap = time in am / pm format

Note: The list for time formats and date formats includes a list of sample formats. But the field is editable, so you can type any time/date formats from the supported list.

12. Move the cursor to X = 20 and Y = 70. Add a new Insert text and edit its settings. Set Object type to Current date and select dd/MM/yyyy.


The following date formats are supported:

a. dd = day
b. MM = Months in two digits
c. MMM = Short text for month (Jan, Feb, Mar etc.)
d. MMMM = Full text for month
e. yy = Year in two digits
f. yyyy = year in four digits

Press Shift+F5 or select View -> Run JavaScript to view the current time and date.

13. Select the Text tool to insert four New Insert Text objects, for details see the picture below. Afterwards, insert a Fixed text at the following position: X = 20 and Y = 80. Select the Fixed text and press F2 to rename the text to Date:. Next to the Date label, insert a date of the dd/MM/yyyy format. Select both Rearranges, right-click the first object, and then click Merge output.

14. Edit the first New Insert Text object: set the Fixed text value to Time: and font attribute to Bold. Afterwards, edit the second object: set Object type to Current Time and select the hh:mm:ss time format. Select the After check box in the Newline group box. Edit then the third object: set the Fixed text value to Date: and font attribute to Bold. By editing the fourth object, set Object type to Current Date and select the dd-MM-yyyy date format.

15. Merge the four text objects into one. To this end, select all four objects, right-click the first object, and then click Merge output.

Objects are merged in the order you have selected them. The object at which you point when right-clicking and then clicking Merge output is listed as the first object in the Rearrange.


Your object list now contains a list of four Insert text objects with various insert text types.

Press Shift+F5 to view the final result.


16. Add one more Insert Text and edit its settings.


17. Set Object type to Page x of y to add page numbering and total number of pages.

18. Select Page %1 of %2 as a page format, where %1 is the current page number and %2 is the total number of pages.


19. Add one more Insert Text and edit its settings.


20. Set Object type to Script.

21. Specify the script contents as "This is a short text".


Note: Lasernet contains a scripting framework supporting the development of advanced functionality. Scripts are typically used for checksum calculations, conditional overlays, conditional targets and conditional printer profiles, but it is possible to develop anything using scripting to extend your Lasernet solution. Scripting is not covered in the training exercises.

Press Shift+F5 to view the final result. The form now presents various types of insert text objects, containing single and multiple elements with individual settings.

Helpful Unhelpful

2 of 2 people found this page helpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?

Share