Anchors are text objects on the PDF page whose location provides an alignment point for text and barcode insertion or substitution. The anchor pattern is defined by the pattern parameter of the anchor command. Once the search pattern is found it provides the following data:
Anchor Position - a rectangle which contains the pattern. Used for anchor placement of barcode and text commands.
Anchor Text - a string with complete search pattern. Used as a variable.
Anchor Value – a substring from that pattern. Used as a variable.
The pattern format, that will be searched in the text, is of the form:
[prefix]PatternText[Separator][${}][suffix]
prefix
String of non-alphanumeric characters (optional)
PatternText
String starting with alphanumeric characters
Separator
One of the following characters = : – (optional)
${}
Placeholder for anchor value substring (optional because anchors may possess only a position)
suffix
String of characters (optional)
The pattern is searched by matching phrases in the PDF text against the pattern definition. A phrase is a string, separated from other text by least 3 spaces or the edge of the page.
Pattern text is used as the anchor variable name, unless another name is explicitly defined in the name parameter of the anchor command
If the placeholder ${} is specified, then ${AnchorName} refers to its value.
Use ${AnchorName.text} to refer to the entire anchor text, including suffix, prefix, pattern text, separator and anchor value. This variable can be used by replace command to delete or modify the anchor pattern.
${anchor} is equivalent to ${AnchorName} in barcode and text commands using anchor placement. It refers to the most recently found anchor.
Anchors are applicable only to input and output pages containing searchable text. Anchors cannot be located in image files or PDF pages containing only faxed or scanned images.
Search for phrase starting with ##User Name: and ending with ##.
Name the anchor UserName. Use
the text from the ”:” to the second “##” as the value of a barcode.
In this example if text contains: ##User
Name:John Doe## then the barcode value is John
Doe.
anchor ##User Name:${}##, name = UserName
barcode ${UserName}
If PDF text contains the phrase “OrderID=876534”. The following command will create a barcode with value “876534” placed just below (default placement) this phrase.
anchor OrderID=${}
barcode target=OrderID, ${OrderID}
To simplify the notation, the ${anchor} variable can be used.
anchor OrderID=${}
barcode target=OrderID, ${anchor}
To delete anchor pattern text (replace it with a null string)
anchor OrderID=${}
replace target=OrderID, ""
An alternative notation is
replace ${OrderID.text}, ""
Format |
Meaning |
Italic |
Information
that the user must supply |
Bold |
Elements that the user must type exactly as shown. |
Between brackets ([]) |
Optional
items |
Ellipsis (...) |
Parameter that can be repeated several times |