Spruce Reference Information

This topic contains detailed Spruce reference information.

Expressions

Various objects within the Spruce template use expressions. These expressions follow the same syntax used in Report Distribution Manager (RDM) and can use many of the same functions and operators. Arithmetic operations use the standard operators. Parentheses can be used to control operator precedence. For more information, see the ASG-Cypress Knowledge Builder and Expression Criteria User’s topic.

Any variables defined in the template or in the input data can be used in the expression as desired. Items of arrays are indexed by placing the index value within square brackets.

Any expression field within an object contains a drop-down list that will show the variable items available to be inserted into the expression string. Any array members will display with a subscript of zero that will need to be modified to an appropriate value.

All arrays declared in the template or in the input data have a predefined count variable that returns the size of the array. For example, for an input array detail, the variable input.detail.count contains the number of occurrences of detail.

Arithmetic and Boolean Operators

This table shows the available arithmetic and Boolean operators:

Operator

Description

+

Plus

-

Minus

*

Multiply

/

Divide

%

Modulus

==

Equal

!=

Not Equal

<

Less Than

<=

Less Than or Equal to

>

Greater Than

>=

Greater Than or Equal to

&&

Logical And

| |

Logical Or

^

Exclusive Or

!

Not

Match

Wildcard Match

Mismatch

Wildcard Mismatch

( )

Parentheses can be used to surround sub-expressions

[ ]

Brackets denote array subscripts

Expression Examples

These examples illustrate some common expressions:

item_count + 1
(page_number % 2) == 0
inv_nums[inx]
input.cust_name.substr(1,3)
input.state.to_upper_case()
company_name.trim_left().find_str(“INC”) > 9

Using Quotes in Expressions

When entering a string value into a string expression, such as the From field of an Assign object, enclose the value within double quotes. If a double quote character is needed within the expression, insert two consecutive double quote characters. For example:

‘This is a ““required”” field for this report.’

When entering a string value into a boolean expression, such as in an If, While, or Case object, enclose the string value within single quotes. If the expression needs to include a single quote, use \x(27). If the string expression needs a double quote, use \x(2222).

Using Special Characters in Expressions

You can insert special characters that are not available on a keyboard into an expression using ASCII or Unicode syntax. The \x syntax accepts pairs of hexidecimal digits to specify 8-bit characters in ASCII. The \u syntax accepts multiples of four hexidecimal digits to specify 16-bit characters in Unicode.

To insert a character from the extended ASCII character set

> Use this syntax:

\x(<hex digits>)

where <hex digits> are 0 through 9 and A through F (upper or lower case).

For example, \x(414243)produces ABC.

You must use an even number of hexidecimal digits as each pair represents one ASCII character.

To insert a character from the Unicode character set

> Use this syntax:

\u(<hex digits>)

where <hex digits> are 0 through 9 and A through F (upper or lower case).

For example, \u(202203A9)produces a bullet (2022), followed by a Greek Omega (03A9).

You must use a multiple of four hexidecimal digits as four digits represent one Unicode character.

You can use the \u(200C) special character to control word wrap. You can insert u\(200C) to specify where line breaks should occur, if necessary, without inserting blanks in the data.

Deferred Objects

As described in the Creating a Document with Spruce topic, Spruce executes in four phases.

1. The Template is compiled.
2. Data is merged into the template and conditional objects are executed.
3. Pages are typeset and page overflow is handled.
4. Pages are emitted into the output document.

Data item insertion must be performed in phase two (so that paragraph justification can take place) but some items (e.g., the page count) are not known until the end of phase three. This situation is most apparent when automatic page overflow constructs additional pages. To avoid this problem, you can mark some objects as deferred so their execution will be deferred until the end of phase three.

Since data insertion must be performed in phase two, room for a deferred insert must be left within a line to perform paragraph justification. For this reason, the width sample attribute is used to specify the amount of room to leave for the deferred insert.

Disabled Feature

Most objects contain a disabled attribute that disables execution of that object (including any children) without removing the object from the template. This feature simplifies testing by avoiding the need to delete and re-create objects.

Variables

Any variable declared in the document section of the template will be positioned before the document formatting elements.

Global variables do not reset their value after each document.
Non-global variables reset their values at the end of each document.

Each variable consists of a name of up to 300 characters and is one of the four types: string, integer, real, or Boolean. Arrays may be declared as global (global_array) or as local (array), and the type and size must be specified. Spruce provides predefined variables for page counting and setting document and job ticket (JTic) attributes.

When adding variables, use a letter as the first character in the name of the variable followed by any combination of letters, numbers, and underscores. Letters can be upper case or lower case. Do not use spaces or special characters in the variable name.

This table lists the predefined variables available in Spruce:

Variable

Default

Definition

docuvault_name

DocuVault Name

Name of the connected DocuVault.

date_yyyymmdd

N/A

Current date in 4-digit year, 2-digit month, and 2-digit day format. This variable is assigned automatically at the beginning of each document.

time_hhmmssmmm

N/A

Current time in 2-digit hours, 2-digit minutes, 2-digit seconds, and 3-digit milliseconds format. This variable is assigned automatically at the beginning of each document.

output_document_creator

Spruce

Creator of the output document. Requires an Assign statement to set a value.

output_document_retention

N/A

Retention time of the document in days. The value of 0 (zero) means the DocuVault default. A negative value sets it to infinity (i.e., never delete). Requires an Assign statement to set a value.

output_document_title

Spruce Document

Title of the output document. Requires an Assign statement to set a value.

output_jtic_description

Spruce Document

Output JTic description. Requires an Assign statement to set a value.

output_jtic_destination

N/A

Destination device to which the JTic will be queued. Requires an Assign statement to set a value.

output_jtic_name

Spruce Document

Name value for the output JTic. A document number is appended to a string. Requires an Assign statement to set a value.

page_count

N/A

Number of pages within the individual document. You set this value after the typesetting phase and before the deferred phase. It is useful for emitting strings such as Page n of n. Use with deferred Insert or expressions (e.g., If statement).

page_number

N/A

Current page number within the individual document. Use with deferred Insert.

total_page_number

N/A

Current page number within the entire output document. Use with deferred Insert or expressions (e.g., If statement).

Template Properties

This section describes properties dialogs and related objects in alphabetical order, including a sample dialog and the corresponding field definitions. See Context-sensitive Menu for more information.

The Type value for each field within a properties dialog will contain one of these values:

Type

Definition

Boolean

Has a value of True or False selected from a drop-down list.

Enumeration

A list of values selected from a drop-down list. The contents of the list varies, depending on items configured in your template or DocuVault.

Fixed Value

A list of fixed values selected from a drop-down list.

Integer

A whole number.

Name

Must begin with a letter and contain letters, numbers, and the underscore.

Real

A real number that can include a decimal point.

Array Properties

The Array object enables you to declare an array of variables that you can use to store information within the template and use elsewhere as needed. You can set the values of array items via the Assign object and use them in conditional objects (i.e., if, for, while, and switch) as well as insert them on to the page with the Insert object.

This is an example of the “Array” Properties dialog.

This table lists the fields on the “Array” Properties dialog:

Field

Type

Definition

name

Name

Name of the array.

type

Enumeration

The type of items that comprise the array.

A drop-down list shows available values:

String
Integer
Real
Boolean

size

Integer

The number of items in the array.

Assign Properties

The Assign object enables you to assign values to variables or array items.

This is an example of the “Assign” Properties dialog:

This table lists the fields on the “Assign” Properties dialog:.

Field

Type

Definition

from

Expression

An expression that defines the value to be assigned to the variable.

A drop-down list shows available values. It contains all data items in the input data, any variables defined in the template, and the nine predefined variables. See Variables

When referencing an item that is a member of a data array, you must set the subscript to the appropriate value. For example, if this Assign is within a For object, you probably will need to change the subscript to the control variable.

Enclose a string expression within double quotes. If a double quote character is needed within the string, insert two double quotes.

to

String

The variable to which the fromvalue is assigned.

A drop-down list shows available values. It contains any variables defined in the template and some of the predefined variables. See Variables

When referencing an item that is a member of a data array, you must set the subscript to the appropriate value. For example, if this Assign is within a For object, you probably will need to change the subscript to the control variable.

defer

Boolean

Specifies whether execution of this Assign object should be deferred until after the pages are constructed.

A drop-down list shows available values:

False
True

disabled

Boolean

Specifies whether the execution of this object should be disabled.

A drop-down list shows available values:

False
True

Bar Code Properties

Using the barcode object enables you to insert a barcode into the current line.

This is an example of the “Barcode” Properties dialog:

A variety of combinations of these fields display, depending on the type of bar code you select.

The table lists the fields on the “Barcode” Properties dialog:

Field

Type

Definition

Type

Enumeration

Selects the type of bar code.

A drop-down list shows available values:

Aztec
Code128ab
Code128b
Code128bc
Code128c
Code39
datamatrix
ean_13
ean_128
int2of5
maxicode
omr
pdf417
pdf417t
postnet
qr_code
upc_a
usps_imail

CPI

Real

Specifies the horizontal character spacing in characters per inch.

width

Real

Specifies the width of the bar code.

height

Real

Specifies the height of the bar code.

thickness

Real

Specifies the thickness of the Optical Mark Recognition (OMR) bars.

fontname

Enumeration

Specifies which font to use for the Human Readable (HR) characters.

A drop-down list shows available values:

The available font names in the drop-down list depends on the fonts you have loaded in your DocuVault.

errorcode

Integer

Specifies the amount of error correction, as required by the bar code type.

configuration Enumeration

Specifies the configuration option for the DataMatrix 2D barcode. A dropdown list shows the available values:

  • Auto: Square – automatically select a square barcode based on the amount of data
  • Auto: Rectangle – automatically select a rectangle barcode based on the amount of data
  • Specific rectangular sizes, such as 12 by 36
  • If the amount of data exceeds the size of the specified configuration, Automatic Square will be used.

Mode

Integer

Specifies the mode of data storage.

checkdigit

Boolean

Specifies whether Cypress should calculate and append the check digit.

A drop-down list shows available values:

False - Cypress will not append the check digit.
True - Cypress will append the check digit.

add_start_stop

Boolean

Specifies whether Cypress should append the start and stop characters.

A drop-down list shows available values:

False - Cypress will not append the start and stop characters.
True - Cypress will append the start and stop characters.

disabled

Boolean

Specifies whether the execution of this object should be disabled.

A drop-down list shows available values:

False
True

Block Properties

Using a Block object, you can describe an area on a page into which text and data can be placed. You define a Block either using distinct values or by referencing a Cypress databox configured via Resource Manager.

This is an example of the “Block” Properties dialog:

The table lists the fields on the “Block” Properties dialog:

Field

Type

Definition

Positioning

String

Selects whether the block is configured via distinct values or via a databox.

A drop-down list shows available values:

Distinct
databox

top position

Real

Displays when Positioning is set to Distinct. Specifies the top edge of the block.

height

Real

Displays when Positioning is set to Distinct. Specifies the height of the block.

left position

Real

Displays when Positioning is set to Distinct. Specifies the left edge of the block.

width

Real

Displays when Positioning is set to Distinct. Specifies the width of the block.

rotation

Integer

Displays only if Positioning is set to Distinct. Specifies the rotation of the contents of the block in degrees, clockwise.

A drop-down menu is available in this field from which to select a valid value:

0
90
180
270

databox

String

Displays when Positioning is set to Databox. Specifies the name of the Cypress form, followed by a forward slash (/), followed by the databox name (e.g., invoice/cust_address).

style

Enumeration

Selects the style to be used by this block and its contents. If empty, its parents style is used.

A drop-down list shows available values and includes the predefined style and custom styles you created.

paragraph justify

Real

Specifies the paragraph position within the block.

A drop-down list shows available values:

Top (default) - positions paragraphs from the top of the block.
Bottom - positions paragraphs at the bottom of the block.
Center - centers paragraphs within the block.
Full - spreads the paragraphs apart to fill the block.

Overflow Positioning

 

Heading for Overflow Attributes

overflow top position

Real

Specifies the top position of the block after page overflow. If a block is within the Body of the Pages object and has overflowed to a new page, this value overrides the initial top position.

overflow height

Real

Specifies the height of the block after page overflow. If a block is within the Body of the Pages object and has overflowed to a new page, this value overrides the initial height.

Page Attributes

 

Heading for Page Attributes

 

Enumeration

Specifies the paper stock to be used for this page.

A drop-down list shows available values from your DocuVault.

 

Enumeration

Specifies the form overlay for this page.

A drop-down list shows available values from your DocuVault.

 

Enumeration

Specifies one- or two-sided printing.

A drop-down list shows available values:

Simplex - Prints on one side of the page.
Duplex - Prints on both sides of the page.
Duplex_front - Forces this page to be the front page of double-sided print.

orientation

Enumeration

Specifies the orientation of the page.

A drop-down list shows available values:

Portrait
Inverse_ landscape
Inverse_portrait
Landscape

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows available values:

False
True

Block Include Properties

The Block Include object enables you to insert a Block type Include into your template. When the Tree view is rebuilt, this object is replaced by its contents.

This is an example of the “Block Include” Properties dialog:

The Block Include Name field is an Enumeration type. You can select which Block Include object to insert from the drop-down menu.

Body

This object contains the Blocks that will trigger automatic page overflow. For information about how the Body object functions, see Pages Properties

Box Properties

The Box object enables you to draw a rectangular box, with its size and positioning calculated from its contents. The box can be outlined and/or shaded. Values in the current Style determine the line width, line color, and dash pattern for outlined boxes, and the fill color for shaded boxes. For more information on the Style object, see Style Properties

This is an example of the “Box” Properties dialog:

The table lists the fields on the “Box” Properties dialog.

Field

Type

Definition

linetype

Enumeration

Specifies the type of box outline.

A drop-down list shows available values:

None - The box is not outlined.
Solid - The box is outlined with a solid line.
Dash - The box is outlined with a dashed line.

filltype

Enumeration

Specifies whether the box is shaded.

A drop-down list shows available values:

None
Shade

style

Enumeration

The style used for this box and its contents.

A drop-down list shows available values. It includes the predefined Default Style and custom styles you created.

extend up

Real

Specifies the distance to extend the box above its contents.

extend down

Real

Specifies the distance to extend the box below its contents.

extend left

Real

Specifies the distance to extend the box to the left of its contents.

extend right

Real

Specifies the distance to extend the box to the right of its contents.

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows available values:

False
True

Case Properties

A Case object describes one case within a Switch object. SeeSwitch Properties

This is an example of the “Case” Properties dialog:

 

This table lists the fields on the “Case” Properties dialog:

Field

Type

Definition

expression

Expression

Specifies the expression that is compared to the expression within the Switch object.

A drop-down list shows available values. It contains all data items in the input data, any variables defined in the template, and the nine predefined variables. See Variables

When referencing an item that is a member of a data array, you must set the subscript to the appropriate value. For example, if this Case is within a For object, you probably will need to change the subscript to the control variable.

Enclose a string expression within single quotes. If a single quote character is needed within the expression use \x(27). If a double quote character is needed within the expression, use \x(2222).

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows available values:

False
True

CLine Properties

See Line Editor Properties

Color Properties

You use this object to define a color. There are a number of predefined colors that you can overwrite by specifying a color with the same name.

This is an example of the “Color” Properties dialog:

The drop-down list below the Color Name displays the current color. It displays the standard Windows color selection dialog.

Spruce includes these predefined colors:

Black
Navy
Blue
Olive
Cyan
Orange
Gray
Purple
Green
Red
Lime
Silver
Ltgray (Light Gray)
Teal
Magenta
White
Maroon
Yellow

Column Properties

You can use this object to configure multiple columns of text within a Row. Each Column controls the horizontal placement of the Paragraphs within it. The text of each Line is wrapped to fit within that Column. The use of Rows and Columns ensures that multiple columns of text stay vertically aligned into rows.

This is an example of the “Column” Properties dialog:

This table lists the fields on the “Column” Properties dialog:

Field

Type

Definition

position

Real

Specifies the starting position of the Column, relative to the left edge of the Block.

width

Real

Specifies the width of the Column.

disabled

Boolean

Specifies whether the execution of this object should be disabled.

A drop-down list shows the available values:

False
True

Comment Properties

You can use Comment objects wherever in the template you wish to place comments within the template.

This is an example of the “Comment” dialog:

Cyp_Page_Var Properties

This object assigns a value to a Cypress page variable or document variable.
(A page or document variable is hidden metadata stored with the page or document
for later processing.)

This is an example of the “Cyp_Page_Var” Properties dialog:

 

The table lists the fields on the “Cyp_Page_Var” Properties dialog.

Field

Type

Definition

name

String

Specifies the name of the page variable.

expression

String

Specifies the value to be assigned to the page variable.

A drop-down list shows available values. It contains all data items in the input data, any variables defined in the template, and the nine predefined variables. See Variables

When referencing an item that is a member of a data array, you must set the subscript to the appropriate value. For example, if this Cyp_Page_Var is within a For object, you probably will need to change the subscript to the control variable.

scope

Fixed Value

Specifies whether the value is stored in a page variable on a single page, as a page variable on all pages, or as a document variable stored for the document.

A drop-down list shows the available values:

Single page - a page variable is set only for the current page.
All pages - a page variable is assigned to this page and all subsequent pages of this document.
Document - a document variable is assigned to this document.

defer

String

Specifies whether execution of this object should be deferred until after the pages are constructed.

A drop-down list shows available values:

False
True

disabled

Boolean

Specifies whether the execution of this object should be disabled.

A drop-down list shows available values:

False
True

Default Properties

The Default object specifies the action to be taken if none of the Cases match. It must be last within a Switch. See Switch Properties

This is an example of the “Default” Properties dialog:

The disabled field is a Boolean type and specifies whether to disable the Default object. Insert values of False or True from the drop-down menu.

Document Properties

The Document object is the top level of the template tree and describes general page information.

This is an example of the “Document” Properties dialog:

This table lists the fields on the “Document” Properties dialog:

Field

Type

Definition

stock

Enumeration

Specifies the paper stock for this page.

A drop-down list shows available values from your DocuVault.

form

Enumeration

Specifies the form overlay for this page.

A drop-down list shows available values from your DocuVault.

plex

Fixed Value

Specifies one- or two-sided printing.

A drop-down list shows available values:

Simplex - Prints on one side of the page.
Duplex - Prints on both sides of the page.
Duplex_front - Forces this page to be the front page of double-sided print.

orientation

Fixed Value

Specifies the orientation of the page.

A drop-down list shows available values:

Portrait
Inverse_ landscape
Inverse_portrait
Landscape

Document Include Properties

This object inserts a document type Include. When the Tree view is rebuilt, this object is replaced by its contents.

This is an example of the “Document Include” Properties dialog:

The Document Include Name field is an Enumeration type. Select the Include object to be inserted from the drop-down menu.

Draw Properties

This object enables you to draw lines or rectangles on the page. All coordinates can be specified either by relative offset or absolute position. Values in the current Style determine the line width, line color, and dash pattern for lines, and the fill color for shading. See Style Properties

If the starting and ending X values are the same, a vertical line is drawn. If the starting and ending Y values are the same, a horizontal line is drawn. Any other combination of values yields a rectangle.

This is an example of the “Draw” Properties dialog:

This table lists the fields on the “Draw” Properties dialog:

Field

Type

Definition

drawtype

Enumeration

A drop-down list shows available values:

Line
rect

Starting X

Enumeration

Specifies the starting horizontal position.

A drop-down list shows available values:

Absolute Position
Relative Offset

start x position

Real

Specifies the horizontal starting position as an absolute position that is measured from the left edge of the page.

Displays when Starting X is set to Absolute Position.

start x offset

Real

Specifies the horizontal starting position as a relative offset from the current position.

Displays when Starting X is set to Relative Offset.

Starting Y

Enumeration

Specifies the starting vertical position.

A drop-down list shows available values:

Absolute Position
Relative Offset

start y position

Real

Specifies the vertical starting position as an absolute position that is measured from the top of the page.

Displays when Starting Y is set to Absolute Position.

start y offset

Real

Specifies the vertical starting position as a relative offset from the current position.

Displays when Starting Y is set to Relative Offset.

Ending X

Enumeration

Specifies the ending horizontal position.

A drop-down list shows available values:

Absolute Position
Relative Offset

end x position

Real

Specifies the horizontal ending position as an absolute position that is measured from the left edge of the page.

Displays when Ending X is set to Absolute Position.

end x offset

Real

Specifies the horizontal ending position as a relative offset from the current position.

Displays when Ending X is set to Relative Offset.

Ending Y

Enumeration

Specifies the ending vertical position.

A drop-down list shows available values:

Absolute Position
Relative Offset

end y position

Real

Specifies the vertical ending position as an absolute position that is measured from the top of the page.

Displays when Ending Y is set to Absolute Position.

end y offset

Real

Specifies the vertical ending position as a relative offset from the current position.

Displays when Ending Y is set to Relative Offset.

linetype

Enumeration

Specifies the type of line to draw.

A drop-down list shows available values:

None
Solid
Dash

filltype

Enumeration

Specifies if the rectangle is shaded.

A drop-down list shows available values:

None
Shade

disabled

Boolean

Specifies whether the execution of this object should be disabled.

A drop-down list shows available values:

False
True

For Properties

The For object implements an automatically incrementing loop. It is generally used to control the insertion of varying amounts of input data, (e.g., arrays).

This is an example of the “For” Properties dialog:

This table lists the fields on the “For” Properties dialog:

Field

Type

Definition

control

Name

Specifies the name of the control variable. This variable does not have to be previously declared.

initial

Integer

Specifies the initial value of the control variable. The Default value is zero.

step

Integer

Specifies the amount that the control variable is automatically incremented during each pass through the loop.

expression

Expression

Specifies the expression that controls when the loop ends. The loop will end when the control variable equals the expression value.

A drop-down list shows available values. It contains all data items in the input data, any variables defined in the template, and the nine predefined variables. See Variables

When referencing an item that is a member of a data array, you must set the subscript to the appropriate value.

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows available values:

False
True

Format Include Properties

This object inserts a format type Include. When the Tree view is re-built, this object is replaced by its contents. This is an example of the “Format Include” Properties dialog:

The Format Include Name field requires an Enumeration type. You can select which Include object to insert from the drop-down menu.

Full_Text_Index Properties

This object allows you to set the Cypress Full Text Index on a specific page or the whole document.

This is an example of the “Full_Text_Index” Properties dialog:

This table lists the fields on the “Full_Text_Index” Properties dialog:

Field

Type

Definition

scope

Enumeration

Specifies whether the Full Text index applies only to the current page or to all pages in the document.

A drop-down list shows the available values:

Single page - only the current page is indexed.
All pages - the index is assigned to this page and all subsequent pages of this document.

disabled

Enumeration

Specifies whether the execution of this object should be disabled.

A drop-down list shows available values:

False
True

Global Properties

This object declares a global variable. Its value is not reset for each document.

This is an example of the “Global” Properties dialog:

This table lists the fields on the “Global” Properties dialog:

Field

Type

Definition

name

Name

Name of the global variable.

type

Enumeration

The type of variable.

A drop-down list shows available values:

String
Integer
Real
Boolean
Database
Rowset

Global Array Properties

This object declares a global array. Its values are not reset for each document.

This is an example of the “Global_Array” Properties dialog:

This table lists the fields on the “Global_Array” Properties dialog:

Field

Type

Definition

name

Name

Name of the global array.

type

Enumeration

The type of items that comprise the array.

A drop-down list shows available values:

String
Integer
Real
Boolean
Database
Rowset

size

Integer

The number of items in the array.

Header Properties

This object is executed first by the Pages object (i.e., before the Body object) and at the beginning of each automatically created overflow page.

This is an example of the “Header” Properties dialog:

The table lists the fields on the “Header” Properties dialog.

Field

Type

Definition

include

Enumeration

Controls whether this header is executed on the specific page.

The drop-down list shows all possible combinations of these five values:

Only - No overflow occurred (i.e. the Body produced only this page).
First - The first page of a multiple page overflow (i.e. at least one page follows).
Middle - A page between a First page and a Last page.
Last - The final page of a multiple-page overflow.
Always - Header is always executed.
Forced - Header is executed only when a blank page is inserted in order to force the content to a certain page, via the force_to_page attribute in a Pages object.

If Spruce has to create a blank page to get the content to the desired page, any Header with a type of Forced will be executed on this page, along with any Header with a type of Always.

This is the only case where a Forced Header will be executed. This selection is intended to be used for special text that is only emitted onto a blank page, such as the common statement: This page is intentionally left blank for formatting purposes.

 

 

These are all the possible combinations of the available values:

Always
First
First, Last
First, Middle
First, Middle, Last
Last
Middle
Middle, Last
Only
Only, First
Only, First, Last
Only, First, Middle
Only, Middle
Only, Last
Only, Middle, Last
Forced

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows available values:

False
True

If Properties

This object controls whether content is executed, depending on an expression.

This is an example of the “If” Properties dialog:

This table lists the fields on the “If” Properties dialog:

Field

Type

Definition

expression

Boolean Expression

The expression that is evaluated. A result of True will cause execution of its content.

A drop-down list shows available values. It contains all data items in the input data, any variables defined in the template, and the nine predefined variables. See Variables

When referencing an item that is a member of a data array, you must set the subscript to the appropriate value. For example, if this If object is within a For object, you probably will need to change the subscript to the control variable.

Enclose a string expression within single quotes. If a single quote character is needed within the expression use \x(27). If a double quote character is needed within the expression, use \x(2222).

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows available values:

False
True

Image Properties

This object enables you to insert an image from the DocuVault into the current line.

This is an example of the “Image” Properties dialog:

This table lists the fields on the “Image” Properties dialog:

Field

Type

Definition

Image Type

Enumeration

Specifies the location for the image to be inserted:

Cypress Resource
Disk File

image

Enumeration

Available when you select Cypress Resource as the Image Type.

Specifies which image to insert. A drop-down list shows available values, which are the images stored in the DocuVault.

expression

Enumeration

Available when you select Disk File as the Image Type.

Allows you to enter an expression, which may contain input data items, used to construct the file name. For example, “D:\test\imaging samples\” + input.title

Horizontal Size

Enumeration

Specifies how the image is scaled horizontally.

A drop-down list shows available values:

Fixed Width
Scaling Factor

width

Real

Specifies the actual width of the image.

Displays when Horizontal Size is set to Fixed Width.

scale x

Real

Specifies the horizontal scaling factor of the image. A value of 1.0 will draw the image the actual width at which it was captured.

Displays when Horizontal Size is set to Scaling Factor.

Vertical Size

Enumeration

Specifies how the image is scaled vertically.

A drop-down menu is available in this field from which to select a valid value:

Fixed Height
Scaling Factor

height

Real

Specifies the actual height of the image.

Displays when Vertical Size is set to Fixed Height.

scale y

Real

Specifies the vertical scaling factor of the image. A value of 1.0 will draw the image the actual height at which it was captured.

Displays when Vertical Size is set to Scaling Factor.

rotation

Integer

Amount the image is rotated in degrees, clockwise.

A drop-down list shows available values:

0
90
180
270

disabled

Boolean

Specifies whether the execution of this object should be disabled.

A drop-down list shows available values:

False
True
When an image is inserted into a line, it is treated as a word of text for justification purposes. When inserting an image, make sure that the dimensions of your paragraph/block are larger than those of your image. If the paragraph/block is smaller than the image you insert, your image will not display when the document is viewed.

Index Properties

This object allows you to index the page.

This is an example of the “Index” Properties dialog:

This table lists the fields on the “Index” Properties dialog:

Field

Type

Definition

index

Enumeration

Specifies the index.

A drop-down list shows available values, which are all Indexes configured in the DocuVault.

expression

Expression

The expression that is evaluated to produce the index value.

A drop-down list shows available values. It contains all data items in the input data, any variables defined in the template, and the nine predefined variables. See Variables

When referencing an item that is a member of a data array, you must set the subscript to the appropriate value. For example, if this Line is within a For object, you probably will need to change the subscript to the control variable.

scope

Fixed Value

Specifies whether this index applies only to the current page or to all pages in the document.

A drop-down list shows the available values:

Single page - only the current page is indexed.
All pages - the index is assigned to this page and all subsequent pages of this document.

defer

String

Specifies whether the execution of this Index object should be deferred until after the pages are constructed.

A drop-down list shows available values:

False
True

template

Enumeration

Specifies the Index Template to be used to evaluate the Index value for this Index type.

A drop-down list shows available values, which are all Index Templates configured in the DocuVault.

This template refers to Index Templates; not Spruce Templates.

disabled

Enumeration

Specifies whether the execution of this object should be disabled.

A drop-down list shows available values:

False
True

Inline Style Properties

This object enables you to modify the style for a particular section within a Line. You can specify the style and/or some of the style components (e.g., font, font size, overline, and underline).

For fixed data, inserting an Inline Style will place the appropriate XML at the selected location in the line. Then you can add the contents of the Style. Alternately, a section of the Line can be highlighted and surrounded by the Inline Style. For the Surround menu option to be enabled, the highlighted text must be valid, self-contained XML.

For text coming from an input file, Dynamic Scanned Inline Styles can be used.

To use Dynamic Scanned Inline Styles

1. Select the Dynamic Scanning Inline Type.
2. Enter the text characters that denote the start and stop tokens within the incoming data.

Spruce will scan the input text for these tokens and set the Style of all the text between them to what is specified within this properties dialog. The tokens are removed from the text string.

In the example below, all text between braces will use the Style ul_single. An input text string of Are there any {deductibles} for specific services? would then result in the word deductibles being underlined with a single underline, as specified in the dialog.

An input text string can contain multiple occurrences of Dynamic Scanned tokens.
The Line object can contain multiple Dynamic Scanned Inline Style definitions.
For correct operation, you need to specify different start and stop tokens.

This is an example of the “Inline_Style” Properties dialog:

This table lists the fields on the “Inline_Style” Properties dialog:

Field

Type

Definition

Inline Type

Fixed Values

Type of inline style.

A drop-down list shows available values:

Fixed Location - all text within the Style XML tags use the specified style.
Dynamic Scanning - all incoming text within the start and stop tokens use the specified style.
 

Name

Token that defines where the specified style begins within incoming text when Dynamic Scanning is used.

The token can contain any useable characters, up to 32 characters in length.

To avoid conflicts and unintended consequences, ASG recommends that you use character strings that are not likely to appear in the input text.

 

Name

Token that defines where the specified style ends within incoming text when Dynamic Scanning is used.

The token can contain any useable characters, up to 32 characters in length.

To avoid conflicts and unintended consequences, ASG recommends that you use character strings that are not likely to appear in the input text.

style name

Enumeration

Name of the style.

A drop-down list shows available values, which are all the available styles.

font

Enumeration

Font for emitting text.

A drop-down list shows available values, which are all the available fonts.

fontheight

Decimal

Vertical size of the font.

fontwidth

Decimal

Horizontal size of the font.

fontcolor

Enumeration

Color for the text.

A drop-down list shows available values, which are all the available colors for text. It includes the predefined colors and custom colors you created.

overline

Fixed Values

Style of the overline.

A drop-down list shows available values:

None - no overline.
Single - single-line overline.
Singleword - single-overline above words only (no spaces).
Double - double-line overline.
Doubleword - double-overline above words only (no spaces).

underline

Fixed Values

Style of the underline.

A drop-down list shows available values:

None - no underline.
Single - single-line underline.
Singleword - single-underline under words only (no spaces).
Double - double-line underline.
Doubleword - double-underline under words only (no spaces).

Inline Tab Properties

This object enables you to insert a tab within the Line text to perform horizontal positioning. You can specify either a predefined tab or the actual justification and position values.

This is an example of the “Inline_Tab” Properties dialog:

This table lists the fields on the “Inline_Tab” Properties dialog:

Field

Type

Definition

Tab specification

Fixed Value

Selects whether the tab is specified by name or by value.

A drop-down list shows available values:

By Name
By Values

tab name

Enumeration

The name of the tab.

A drop-down list shows available values, which are all the available tabs.

just

Fixed Value

Type of justification performed.

A drop-down list shows available values:

Left
Right
Center

position

Real

The horizontal position measured from the left edge of the paragraph.

When inserting text at a tab location, the tab specifies only the position of the text. Text that is too long can overflow into other tab positions. Adjusting the font size might help you fit the text into the line as desired.

Insert Properties

This object will insert an expression (typically containing a data item) into the Line.

This is an example of the “Insert” Properties dialog:

This table lists the fields on the “Insert” Properties dialog.:

Field

Type

Definition

expression

Expression

The expression that is inserted into the Line.

A drop-down list shows available values, including all data items in the input data, any variables defined in the template, and the nine predefined variables. See Variables

When referencing an item that is a member of a data array, you must set the subscript to the appropriate value. For example, if this Insert is within a For object, you probably will need to change the subscript to the control variable.

real precision

Integer

Number of decimal digits for Spruce to display when inserting a real value. A value from 0 through 7 can be added.

decimal_point

Fixed Value

Specifies how a decimal point is displayed.

A drop-down list shows the available values:

Period
Comma

third_digit_separator

Fixed Value

Specifies what separates every third digit.

A drop-down list shows the available values:

Nothing
Comma
Period
Blank

negative_display

Fixed Value

Specifies how negative values are displayed.

A drop-down list shows the available values:

Minus_before
Minus_after
Parentheses

retain_linefeeds

Boolean

Specifies how line feeds in the inserted text are treated.

A drop-down list shows available values.

False
True

When True, any line feeds in the inserted text will cause Spruce to start a new line. When False (the default value) line feeds are simply treated as word separators and Spruce will position the text as normal.

defer

String

Specifies whether the execution of this Insert object should be deferred until after the pages are constructed.

A drop-down list shows available values.

False
True

width sample

String

This value needs to be entered only when Defer is set to True.

This value specifies a sample of characters that will determine the amount of room to be reserved for the insertion of data after the page is constructed. For example, 9999 will reserve room in the current font for a number with a maximum of four digits.

disabled

Boolean

Specifies whether the execution of this object should be disabled.

A drop-down list shows available values:

False
True

Label Properties

This object defines a label that is attached to a paragraph. You can configure a Label on either the left or right side of the paragraph and is aligned vertically with the paragraph. Labels are commonly used to insert bullets and paragraph numbers.

This is an example of the “Label” Properties dialog:

:

This table lists the fields on the “Label” Properties dialog.:

Field

Type

Definition

style

Enumeration

Specifies the name of the style.

A drop-down list shows available values, which are all the available styles.

just

Fixed Value

Specifies the type of label justification.

A drop-down list shows available values.

Left - text is left-justified.
Right - text is right-justified.
Center - text is centered.
Full - text is left- and right-justified.

indent

Real

Specifies the amount to indent the first line of the label.

position

Fixed Value

Specifies the position of the label, relative to the paragraph.

A drop-down list shows available values:

Left
Right

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows available values:

False
True

Line Editor Properties

This dialog displays when you create a new Line or CLine or right-click on an existing Line or CLine and select Properties. The CLine object is a conditional line, which is the same as a Line, except that its line spacing is suppressed if the line is empty.

When you right-click in the Line Editor dialog, this context-sensitive menu displays:

The Line Editor enables you to use the Surround, Copy, Cut, Delete, Paste, and Select All features. It also enables you to Insert any of the objects listed on the menu (on the right side of the dialog) when you are creating a line (e.g., Inline_Tab, or Barcode).

The Hard Blank object inserts a special XML tag to force a hard blank into the data. This is a blank that will not be stripped out by the paragraph justification process.

The Literal LessThan, Literal GreaterThan, and Literal Ampersand objects are used to insert characters that cannot be entered directly into the text stream because they are XML delimiters.

New Output Document Properties

This object causes the current page to start a new output document. It is often used within an If object that controls when a new document starts. For example, if this object is within an If object whose expression is total_page_count > 4000, then a new output document will be created every 4,000 pages.

This is an example of the “New_Output_Document” Properties dialog:

The disabled field is a Boolean type that specifies whether to disable. The valid values of False or True are available from the drop-down list.

Newpage Properties

This object starts a new output page.

This is an example of the “Newpage” Properties dialog:

This table lists the fields on the “New Page” Properties dialog:

Field

Type

Definition

stock

Enumeration

Specifies the paper stock for this page.

A drop-down list shows available value.from your DocuVault.

form

Enumeration

Specifies the form overlay for this page.

A drop-down list shows available values from your DocuVault.

plex

Fixed Value

Specifies one- or two-sided printing.

A drop-down list shows available values:

Simplex - Prints on one side of the page.
Duplex - Prints on both sides of the page.
Duplex_front - Forces this page to be the front page of double-sided print.

orientation

Fixed Value

Specifies the orientation of the page.

A drop-down list shows available values:

Portrait
Inverse_ landscape
Inverse_portrait
Landscape

disabled

Boolean

Specifies whether the execution of this object should be disabled.

A drop-down list shows available values:

False
True

Pages Properties

This object implements automatic page overflow. A Pages object contains optional Headers, a Body, and optional Trailers. The execution of the Pages object performs these actions:

3. Executes all Headers in order, depending on their include_type.
4. Executes the Blocks of the Body in order.

If any Block overflows, these additional actions are performed:

a. Executes all Trailers in order, depending on their include_type.
b. A new page starts.
c. Executes all Headers in order, depending on their include_type.
d. Continues the current Block execution at the point at which it was interrupted.

Actions 2a through 2d are repeated as many times as necessary.

5. Executes all Trailers in order, depending on their include_type.

In this example of the “Pages” Properties dialog, the Pages object will be forced to page 5 of the output and will continue 0.4 inches below the end of the content of the previous Pages object:

This table lists the fields on the “Pages” Properties dialog:

Field

Type

Definition

stock

Enumeration

Specifies the paper stock for this page.

A drop-down list shows the available values from your DocuVault.

form

Enumeration

Specifies the form overlay for this page.

A drop-down list shows the available values from your DocuVault.

plex

Fixed Value

Specifies one- or two-sided printing.

A drop-down list shows the available values:

Simplex - Prints on one side of the page.
Duplex - Prints on both sides of the page.
Duplex_front - Forces this page to be the front page of double-sided print.

orientation

Fixed Value

Specifies the orientation of the page.

A drop-down list shows the available values:

Portrait
Inverse_ landscape
Inverse_portrait
Landscape

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows the available values:

False
True

offset_from_prev_pages

Real

Specifies the amount of space to separate the previous Pages content from the new content. For example, if this value is set to 0.5 inches, Spruce places the content of this Pages object at 0.5 inches below where the previous Pages object left off.

This mechanism can be used with content that requires different headers and trailers for different sections where these sections might appear on the same page. When invoked, Spruce will not invoke any headers and trailers of the first page of the second Pages object (the one that specifies the offset_from_prev_pages attribute) since the headers and trailers of the first Pages objects were in effect.

force to page

Integer

Specifies the earliest page that this output is placed. The output will not be placed on a page before the specified page.

For example, if the content would normally be placed on a page prior to the specified page, the output skips to the specified page instead. One or more blank pages are inserted, if needed.

Paragraph Properties

This object contains one or more lines and specifies how they are justified and positioned. Any line whose width exceeds the width of the paragraph will be broken at a word boundary and justified. Each Line object will begin a new line within the paragraph.

This is an example of the “Paragraph” Properties dialog:

This table lists the fields on the “Paragraph” Properties dialog:

Field

Type

Definition

style

Enumeration

Specifies the name of the style.

A drop-down list shows the available values, which are all the available styles listed here.

just

Fixed Value

Specifies the type of paragraph justification.

A drop-down list shows the available values:

Left - text is left-justified.
Right - text is right-justified.
Center - text is centered.
Full - text is left- and right-justified.

indent

Real

Specifies the amount for Spruce to indent the first line of the paragraph.

label width

Real

Specifies the width of the label attached to this paragraph.

label gap

Real

Specifies the amount of room between the label and the paragraph body.

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows the available values:

False
True

Row Properties

You can use this object to configure rows of multiple Columns. After the text in each column is typeset, the overall height of the Row is determined by the heights of each corresponding Column. Rows are usually used with For loops, and each Row is vertically positioned within the Block by the overall height of that Row. The use of Rows and Columns ensures that multiple columns of text stay vertically aligned into rows.

This is an example of the “Row” Properties dialog:

The disabled field is a Boolean type. You can select whether or not the execution of this object should be disabled (True or False) from the drop-down menu.

Style Properties

A style object defines various attributes for text, lines, boxes, shading, positioning, etc. You can invoke styles throughout the template, and any style attributes that are not specifically set in the invoked style are inherited from that object’s parent.

This is an example of the default “Style” Properties dialog:

This table lists the fields on the “Style” Properties dialog:

Field

Type

Definition

name

Name

Specifies the name of the style. The default style has predefined values and is available when you create a template.

font

Enumeration

Specifies the font for emitting text.

A drop-down list shows the available values, which are all the available fonts.

fontheight

Real

Specifies the vertical size of the font in points.

fontwidth

Real

Specifies the horizontal size of the font in points.

Line Spacing Type

Fixed Value

Specifies the type of line spacing.

A drop-down list shows the available values:

Percent - the percentage of line spacing. For example, 100% results in the lines being spaced at 100% of the font height while 200% results in double spacing.
Fixed - the distance, in current units of inches, centimeters, or points. For example, specifying 0.2 inches will space the lines at 5 per inch.

fontcolor

String

Color for text.

A drop-down list shows the available values, including the predefined colors and any custom colors you have created.

shadecolor

String

Sets the background shading color for a line of text. A drop-down list shows the available values, including the predefined colors and any custom colors you have created.

overline

Fixed Value

Style of the overline.

A drop-down list shows the available values:

None - no overline.
Single - single-line overline.
Singleword - single-overline above words only (no spaces).
Double - double-line overline.
Doubleword - double-overline above words only (no spaces).

 

underline

Fixed Value

Style of the underline.

A drop-down list shows the available values:

None - no underline.
Single - single-line underline.
Singleword - single-underline under words only (no spaces).
Double - double-line underline.
Doubleword - double-underline under words only (no spaces).

just

Fixed Value

Type of paragraph justification.

A drop-down list shows the available values:

Left - text is left-justified.
Right - text is right-justified.
Center - text is centered.
Full - text is left- and right-justified.

para spacing

Real

Vertical spacing between paragraphs as a factor of font size. For example, a value of 1.0 will leave one blank line between paragraphs. The font size of the next paragraph determines the amount of spacing.

indent

Real

Distance in units (i.e., inches, centimeters, points) to indent paragraphs.

label width

Real

Width of the label in units.

label gap

Real

Width of the gap between a label and a paragraph, in units.

orphan

Integer

Minimum number of lines on a page before a paragraph is moved to the next page.

widow

Integer

Minimum number of lines on the next page before a paragraph is moved.

linewidth

Real

Width of drawn lines in units.

boxmargin

Real

Margin around boxes in units.

linecolor

Enumeration

Color for line drawing.

A drop-down list shows the available values, including the predefined colors and custom colors you have created.

fillcolor

Enumeration

Color for box shading.

A drop-down list shows the available values, including the predefined colors and custom colors you have created.

dashpattern

String

Pattern for dashed lines. If specified, it must contain at least three numbers separated by commas:

The offset within the dashpattern.
Pairs of numbers specify the width of a line.
The width of a gap.

You can specify up to 20 pairs. The pattern of lines and gaps will be repeated automatically, as needed.

For example, the dash pattern of 0.03. 0.05, 0.03, 0.01, 0.01 will draw a pattern consisting of a 0.05 line, a 0.03 gap, a 0.01 line, and a 0.01 gap. The pattern will be initially offset by 0.03.

Switch Properties

This object will execute one case from a list of cases, depending on the Switch expression. The expression within each Case object is compared to the Switch expression and the Case object that matches it will be executed. If none of the Case expressions match, then the Default object is executed.

This is an example of the “Switch” Properties dialog:

This table lists the fields on the “Switch” Properties dialog:

Field

Type

Definition

expression

Expression

Specifies the expression that is compared to the expression within each Case object.

A drop-down list shows the available values. It contains all data items in the input data, any variables defined in the template, and the nine predefined variables. See Variables

When referencing an item that is a member of a data array, you must set the subscript to the appropriate value. For example, if this Switch is within a For object, you probably will need to change the subscript to the control variable.

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows the available values:

False
True

Script Properties

This object displays in the Insert and Append context menus as appropriate for the selected object. It allows you to execute a script where a return value is not applicable.

This is an example of the Script dialog:

Tab Properties

This objects describes a horizontal tab and its associated justification. You can use Tabs within Lines where-ever they are needed. They are typically used for placing text into columns.

This is an example of the “Tab” Properties dialog:

This table lists the fields on the “Tab” Properties dialog:

Field

Type

Definition

name

Name

Specifies the name of the tab.

just

Fixed Value

Specifies the tab justification.

A drop-down list shows the available values:

Left
Right
Center

position

Real

Specifies the horizontal position of the tab, measured from the left edge of the paragraph.

When you are inserting text at a tab location, the tab specifies only the position of the text. Text that is too long can overflow into other tab positions. Adjusting the font size might help you fit the text into the line as desired.

Template Properties

This object specifies global options for Spruce execution.

This is an example of the “Template” Properties dialog:

This table lists the fields on the “Template” Properties dialog:

Field

Type

Definition

unit

Fixed Value

Specifies the unit of measure to be used for storing values in the Template XML.

A drop-down list shows the available values:

Inch
cm
Point

max loop

Integer

Specifies the maximum number of times a For or While object will execute. This prevents infinite loops.

real precision

Integer

Specifies the default number of decimal digits displayed for real numbers when inserting their values on the Page.

decimal_point

Fixed Value

Specifies how a decimal point is displayed.

A drop-down list shows the available values:

Period
Comma

third_digit_separator

Fixed Value

Specifies what separates every third digit.

A drop-down list shows the available values:

Nothing
Comma
Period
Blank

negative_display

Fixed Value

Specifies how negative values are displayed.

A drop-down list shows the available values:

Minus_before
Minus_after
Parentheses

external errors

Fixed Value

Specifies how errors external to Spruce should be handled (e.g., when a form, stock, or index is specified that does not exist in the DocuVault).

A drop-down list shows the available values:

Warning - Spruce execution continues with a warning message.
Fatal - Spruce terminates with a fatal error.

Trailer Properties

This object is executed last by the Pages object (i.e., after the Body) and at the end of each automatically created overflow page.

This is an example of the “Trailer” Properties dialog:

This table lists the fields on the “Trailer” Properties dialog:

Field

Type

Definition

include

Enumeration

Controls whether this trailer is executed on the specific page.

The drop-down list shows all possible combinations of these five values:

Only - No overflow occurred (i.e. the Body produced only this page).
First - The first page of a multiple page overflow (i.e. at least one page follows).
Middle - A page between a First page and a Last page.
Last - The final page of a multiple-page overflow.
Always - Trailer is always executed.

 

 

These are all the possible combinations of the available values:

Always
First
First, Last
First, Middle
First, Middle, Last
Last
Middle
Middle, Last
Only
Only, First
Only, First, Last
Only, First, Middle
Only, Middle
Only, Last
Only, Middle, Last

disabled

Boolean

Specifies whether the execution of this object and its contents should be disabled.

A drop-down list shows available values:

False
True

URI Properties

This object emits a URI onto the page, which will be displayed as a hyperlink in a PDF created by the PDF driver. The URI object is valid within a Line or Cline object.

This is an example of the “URI” Properties dialog:

This table lists the fields in the “URI” Properties dialog

Field

Type

Definition

uri_text

String

The text of the URI to emit.

Starting X

Enumeration

Specifies the starting horizontal position.

A drop-down list shows available values:

Absolute Position
Relative Offset

start x position

Real

Specifies the horizontal starting position as an absolute position that is measured from the left edge of the page.

Displays when Starting X is set to Absolute Position.

start x offset

Real

Specifies the horizontal starting position as a relative offset from the current position.

Displays when Starting X is set to Relative Offset.

Starting Y

Enumeration

Specifies the starting vertical position.

A drop-down list shows available values:

Absolute Position
Relative Offset

start y position

Real

Specifies the vertical starting position as an absolute position that is measured from the top of the page.

Displays when Starting Y is set to Absolute Position.

start y offset

Real

Specifies the vertical starting position as a relative offset from the current position.

Displays when Starting Y is set to Relative Offset.

Ending X

Enumeration

Specifies the ending horizontal position.

A drop-down list shows available values:

Absolute Position
Relative Offset

end x position

Real

Specifies the horizontal ending position as an absolute position that is measured from the left edge of the page.

Displays when Ending X is set to Absolute Position.

end x offset

Real

Specifies the horizontal ending position as a relative offset from the current position.

Displays when Ending X is set to Relative Offset.

Ending Y

Enumeration

Specifies the ending vertical position.

A drop-down list shows available values:

Absolute Position
Relative Offset

end y position

Real

Specifies the vertical ending position as an absolute position that is measured from the top of the page.

Displays when Ending Y is set to Absolute Position.

end y offset

Real

Specifies the vertical ending position as a relative offset from the current position.

Displays when Ending Y is set to Relative Offset.

linetype

Enumeration

Specifies the type of line to draw.

A drop-down list shows available values:

None
Solid
Dash

Outline_width

Real

The width of the lines of the surrounding rectangle in the output PDF.

Disabled Boolean

Specifies whether the execution of this object should be disabled.

A drop-down list shows the available values:

False
True

 

Variable Properties

This object declares a global variable. Its value is reset for each document.

This is an example of the “Variable” Properties dialog:

This table lists the fields on the “Variable” Properties dialog:

Field

Type

Definition

name

Name

Specifies the name of the global variable.

type

Fixed Value

Specifies the type of variable.

A drop-down list shows the available values:

String
Integer
Real
Boolean

While Properties

This object will repeatedly execute its contents while the expression returns a value of True. To prevent an infinite loop, some value within the expression must change within the loop. The max_loop value within the Template object will specify the maximum number of times the loop should repeat.

This is an example of the “While” Properties dialog:

This table lists the fields on the “While” Properties dialog:

Field

Type

Definition

expression

Expression

Specifies the expression that is compared to the expression within the Switch object.

A drop-down list shows the available values. It contains all data items in the input data, any variables defined in the template, and the nine predefined variables. See Variables

When referencing an item that is a member of a data array, you must set the subscript to the appropriate value. For example, if this While is within a For object, you probably will need to change the subscript to the control variable.

Enclose a string expression within single quotes. If a single quote character is needed within the expression use \x(27). If a double quote character is needed within the expression, use \x(2222).

disabled

Boolean

Specifies whether the execution of this object should be disabled.

A drop-down list shows the available values:

False
True

Schema Properties Dialogs

When working with a Schema, you can create arrays and variables. This section contains examples of the Schema Array and Variable dialogs.

Schema Array Properties

An array is a collection of variables. The variables within an array can be of different types. Arrays can be repeated as many times as necessary within the data.

This is an example of the Schema “array” Properties dialog:

The name field is a Name type. Enter the name of the array in this field.

Schema Variable Properties

A variable is an object that can contain one item of data.

This is an example of the Schema “variable” Properties dialog:

This table lists the fields on the Schema “variable” Properties dialog:

Field

Type

Definition

name

Name

The name of the variable.

type

Fixed Value

The type of variable.

A drop-down list shows the available values:

String
Integer
Real
Boolean

Sample Data Properties

The properties of a data item within the Sample Data will display the variable name and type and allow you to change the value. This enables you to construct Sample Data to perform testing as desired.

This table lists the fields for Sample Data properties:

Field

Type

Definition

name

Name

The name of the variable.

type

Fixed Value

The variable will be one of these types:

String
Integer
Real
Boolean

value

User-Specified

The value of the variable.

Spruce Tips and Techniques

This section contains tips and techniques that can help you navigate within Spruce. They are also helpful in providing more efficient use of Spruce’s template designer features.

When examining Spruce-created pages on the Document tab, you might want to locate the template object(s) that produced a particular item on the page.

To locate Template Objects from the Document view

> In the Document view, double-click the item.

The Spruce user interface switches to the Template tab with the view highlighted on the object that produced the item that was selected. For example, double-clicking on a line of text in the Document view will position the Template view to the first Block that matches that coordinate (not necessarily the one that produced the item desired, since the Spruce user interface cannot determine which Block was intended).

To simplify the placement of Blocks on a page

> Draw a rectangle with the mouse on the Document tab. The next Block you create on the Template tab is populated with the coordinates of that rectangle.

To prevent an infinite loop

> Ensure that an Include template does not include itself or any Include template that will chain back to itself.

Restoring a Deleted Include Template: Do not delete an Include template unless you are sure that it is not in use by any other templates. If you delete an Include template, then later determine it was referenced by a template that is currently in use, you can use this procedure to restore it:

To restore a deleted Include template

1. Create a dummy Include template with the same name and of the same type as the one that you deleted. It does not have to contain any actual content.
2. Save the dummy Include template.
3. Open the template that is referencing the Include template, then the remove the reference by deleting the top-level object of the Include template.
4. Delete the dummy Include template.

Setting Page Attributes: When you are setting a page attribute (e.g., Stock, Form, or Orientation), the last value you specify on a page will be used for that page. For example, if one page specifies three different forms, the last form you specified will be used for the resulting generated page.

When Creating Include Templates: An Include template does not contain an explicit units value. It will use the units specified in the template in which it is included. Therefore, it is important to create Include templates that use the same units as the Templates in which the Include template will be used.

Template Units and the Line Editor: When inserting objects into a Line with the Line Editor, they are stored in the same units (i.e., inches, centimeters, points) as those in the template. If the units you view are different than the units in the template, you will see the values of the units automatically translated to those of the template, when stored into the line.

Insert versus Append: When you are inserting or appending objects in the template:

Insert places the object above the item from which you are inserting.
Append places the object below the item from which you are appending and at the end of its children (unless the type of object requires a different placement [e.g., a Header will always be placed before a Body].

Recommendations

Save your templates often, especially when you have implemented an item and tested it successfully. If a template item is accidentally deleted or changed incorrectly, you can restore it.
Export your templates to disk for backup in case a template is accidentally deleted.

To control placement of rows of multiple columns of text

1. Create a Row within the Block.

Usually this Row will be within a For loop to process an array of input data.

2. Within the Row, create a Column for each desired column of text.

The Column specifies the starting position and width of that column.

It is usually helpful to leave a small gap between the end of one column (its position plus width) and the start of the next column to ensure that the text of the two neighboring columns do not get too close to each other.