The following paragraph does not apply to any country where such provisions are inconsistent with local law:
LEXMARK INTERNATIONAL, INC., PROVIDES THIS PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express
or implied warranties in certain transactions; therefore, this statement may not apply to you.
This publication could include technical inaccuracies or typographical errors. Changes are periodically made to the
information herein; these changes will be incorporated in later editions. Improvements or changes in the products or
the programs described may be made at any time.
Comments about this publication may be addressed to Lexmark International, Inc., Department F95/032-2, 740 West
New Circle Road, Lexington, Kentucky 40550, U.S.A. In the United Kingdom and Eire, send to Lexmark International
Ltd., Marketing and Services Department, Westhorpe House, Westhorpe, Marlow Bucks SL7 3RQ. Lexmark may use
or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you.
You can purchase additional copies of publications related to this product by calling 1-800-553-9727. In the United
Kingdom and Eire, call +44 (0)8704 440 044. In other countries, contact your point of purchase.
References in this publication to products, programs, or services do not imply that the manufacturer intends to make
these available in all countries in which it operates. Any reference to a product, program, or service is not intended to
state or imply that only that product, program, or service may be used. Any functionally equivalent product, program, or
service that does not infringe any existing intellectual property right may be used instead. Evaluation and verification of
operation in conjunction with other products, programs, or services, except those expressly designated by the
manufacturer, are the user’s responsibility.
Lexmark and Lexmark with diamond design are trademarks of Lexmark International, Inc. registered in the United
States and/or other countries.
This software and documentation are provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the
Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and
Computer Software clause at DFARS 252.227-7013 and in applicable FAR provisions: Lexmark International, Inc.,
Lexington, KY 40550.
This book provides a technical reference for LDDScript, the scripting language for the Lexmark
Document Distributor. It is assumed you are already familiar with the language; if not, please review
the "Basic Script Writing" book installed with this product.
If you are migrating from LDD version 1.4, start with Appendix A, "Migrating from LDD 1.4 to 2.1".
The Script Reference is organized as follows:
Chapter 1, "The Basics"—Quick overview of the basic constructs of LDDScript. For detailed
examples, please see the "Basic Script Writing" book.
Chapter 2, "Data Type Objects" — Information on the supported data types.
Chapter 3, "Helper Objects"—Information on the objects that are used to perform common
operations
Chapter 4, "System Objects"—Information on the objects that provide the data provided with a
submitted job and provide feedback to the end-user.
Chapter 5, "Action Objects"—Information on the objects that perform the actual processing of
documents to route, store in a database, print, and so on.
Appendix A, "Migrating from LDD 1.4 to 2.1"—Information for users migrating from previous
versions of LDD.
Appendix B, "LDD Constants Reference"—Quick lookup of all the constants used in LDDScript.
Appendix C, "ODBC Reference"—Information about interfacing with databases from within a script.
Appendix D, "Barcode Reference"—Information about the barcodes supported by LDDScript.
1
What’s new in version 2.1
Lexmark Document Distributor 2.1 has enhanced many of it’s standard features as well as added
some brand new function. Additions and enhancements include:
Actions
•PrintIP—Now supports Staple and Print Confirmation (WaitForCompletion and WaitTimeout
properties)
New actions
•
ImageText Action—Place text anywhere on an image
•Electronic Document Manipulation (EDMS) actions that include third party database software;
SharePoint and Domino.Docs
Document Server Admin
Script Editor improvements that include:
•find/replace—Use the find/replace tool to take you to the code you want
•print—Print a hard copy of your script from the Script Editor
•insert logic—Automatically insert logic syntax into your script
•auto-complete—Automatically finishes your actions
•auto-indent—Automatically indents your script when inserting a sub-routine
Documentation
Expanded documentation including:
•Basic Script Writing—Documentation to help you get started writing your first script
•Script Examples—Detailed script examples (included with LDD) with line–by–line explanations
of the code
•Server Admin Tour—Take a detailed tour of the tools available in your Document Server
Admin
2
1
The Basics
Objects
An object is the basic building block of LDDScript. An object contains properties and methods. A
property is one of the basic data type objects such as a string or integer. A property is set to various
values to affect how the object operates. A method is a function called to operate on the data. A
method may be passed parameters and may return a value. The parameters and return values are
data type or helper objects.
Dot notation is used to access the properties and methods of an object.
•Data Type—The most basic objects; all properties and most variables are of this type.
•Helper—Provide an easy way to perform some common operations.
•System—Do not process documents; used to gather input and provide user feedback.
•Action—Process documents; perform the archiving, routing, distribution, etc.
The remaining chapters in this book provide a reference for objects of each type.
3
Declaring Variables
All variables must be declared before they can be used. Variables cannot be declared inside of a "with"
block or inside of any logic blocks like if/then or loops. To declare a variable, specify its object type and
name. For example:
string text
int num
There are some rules to follow when naming your variables:
•Name must consist of letters, numbers, and underscores.
•The first character of the name must be a letter.
•Must be unique within the script, the names are not case sensitive so "Name", "NAME", and
"name" are all considered the same variable name.
•Cannot be a reserved word (one that has a special meaning to the script compiler).
Flow control
In order to control the execution of script statements, some type of flow control logic is necessary.
Script statements can be executed three ways: sequentially, selectively, or repetitively.
When no flow control logic is used, the statements are executed in the order they are in the script. For
selective execution of certain script statements, you can use if/then/else or switch/case statements.
For repetitive execution of script statements, the loop and repeat statements can be used.
These flow control statements are discussed next.
If/Then/Else
The most common type of flow control is the ability to execute a statement if a certain condition is true.
This ability is implemented in Document Server by the if/then/else construct. The basic format is:
if (bool expression) then
statement1statementn
endif
statement1 to statementn are only executed if the Boolean expression in parentheses is TRUE.
Sometimes it is also necessary to evaluate one set of statements if a condition is TRUE and another if
it is FALSE. That can be accomplished using the else construct:
if (bool expression) then
statementa
statementc
else
statementx
statementz
endif
statementa to statementc are executed if the Boolean expression in parentheses is TRUE;
otherwise, statementx to statementz are executed.
4
Switch/Case
Sometimes you have more than one condition you want to check for. You can do this with several
If/Then statements. The Switch/Case statement provides an easier way to make multiple comparisons:
Integer switchString switch
switch (intvar) switch (stringvar)
case intval1case "stringval1"
statementa statementa
statementb statementb
case intval2case "stringval2"
statementc statementc
statementd statementd
default default
statemente statemente
statementf statementf
endswitch endswitch
You can use integer or string values with the Switch/Case statement. Based on the value of the
variable, the case block corresponding to that value is executed. Each case block can contain multiple
statements but only one case block is executed.
If the value of the switch variable does not match any of the cases, the default block is executed. The
default block is not required. However, if a default block is used, it must be the last block.
Example of Switch
Lexmark MFPs have a job accounting capability. When this feature is enabled, users must enter an
account number before accessing a profile. For this example, users enter a department number when
using profiles. This example script uses a Switch/Case statement to check the department number.
string CustomSubject
// Use the account number as an integer
int DeptNumber = original.useracct.AsInt()
switch (DeptNumber)
case 35
CustomSubject = "Document from Human Resources"
case 41
CustomSubject = "Document from Legal Department"
case 15
CustomSubject = "Document from Shipping Department"
default
CustomSubject = "Document from FooBar Company"
endswitch
Each statement in a script is executed only once. The repeat and loop statements let you execute the
same block of statements multiple times. You can insert an empty repeat or loop statement by clicking
the Insert Logic button on the Script Editor toolbar.
Loop
When you want to repeat a set of statements a known number of times, use the loop statement.
Syntax:
loop (intcounter from istart to ifinish)
statement1
statementn
endloop
where:
•intcounter is a previously declared integer variable
•istart is an integer value to assign to intvar when the loop starts
•ifinish is an integer value that is the maximum for intvar
Using an integer variable as a counter, the loop is repeated as many times as specified in the
istart/ifinish information. You can include as many statements as you want in the loop block.
The loop block ends with the endloop statement.
The loop begins with the counter variable being assigned the value indicated by istart. With each
execution of the loop, the value of the counter is incremented by 1. This continues until the counter is
greater than the value of ifinish.
So a loop from 1 to 10 repeats until the counter has a value of 11. The value of istart must be less
than the value of ifinish.
The integer variable used for the counter must be declared prior to using it in the loop statement.
Example:
E-mail the originally scanned document to ten customer service representatives. In this script, the
common EmailSMTP properties are specified before the e-mails are sent inside the Loop statement.
string EmailAdd
int LoopCount
// Set up the common properties for the emails.
with EmailSMTP
.Subject="Customer Complaint"
.Server="mail.server.com"
.From="customer_service@foobar.com"
.Message="Please review this complaint"
.Attachments=original.document
.CharacterSet=LDD_SMTPCHARSET_US
endwith
loop (LoopCount from 1 to 10)
EmailSMTP.To="CustRep" + LoopCount.AsString() + "@foobar.com"
EmailSMTP.Go()
endloop
6
Repeat
The repeat statement lets you execute a block of statements over and over until an expression
becomes true.
repeat (until bool expression)
statement1
statementn
endrepeat
The repeat statement executes the block of statements until the Boolean expression is TRUE. You
can have as many statements as you want in the loop block. The endrepeat statement ends the loop
block. If the initial value of the Boolean expression is true, the loop is not executed.
Example:
This script uses Optical Character Recognition (OCR), to check documents scanned by end users for
confidential documents. If the document is confidential it is not e-mailed. The scanned image is saved
to a file and a warning message sent to the user who scanned the confidential document.
// Open the results of the OCR Action
tf.Open(ConvertToText.output)
bool bConfDoc = FALSE
int iCount, iEnd
iCount =1
iEnd = tf.GetNumberLines()
Submitter = original.username+ "@lexmark.com"
// Check each line for the term Confidential
repeat (until (bConfDoc OR (iCount>=iEnd)))
OneLine = tf.ReadLine()
if (OneLine.Contains("Confidential"))
then
bConfDoc = TRUE
endif
iCount.Add(1)
endrepeat
7
// If it's a Confidential Document, save it and send warning message
if (bConfDoc)
then
with SaveToFile
.input=original.document
.Path="c:\ebc.txt"
.AppendTimestamp=TRUE
.Overwrite=FALSE
.SaveUserData=FALSE
.Go()
endwith
with EmailSMTP
.Server="mail.server.com"
.To= Submitter
.From="mailcheck@abcxyz.com"
.Subject="Invalid Email Rejected"
.Message="Cannot email a confidential document"
.CharacterSet=LDD_SMTPCHARSET_US
.Go()
endwith
else
with EmailSMTP
.Server="mail.server.com"
.To="Receiver@abcxyz.com"
.From=Submitter
.Subject="Scanned Document"
.Message="Here is the document you requested"
.CharacterSet=LDD_SMTPCHARSET_US
.Attachments=original.document
.Go()
endwith
endif
8
Operators
Mathematical
These operators are used to set or change the value of a variable or property.
OperatorSymbolDescription
Addition+For integer and real objects, this
Subtraction-For integer and real objects, this
Multiplication*For integer and real objects, this
Division\For integer and real objects, this
adds the numbers on both sides of
the "+" and returns the new value.
For string objects, this has a similar
affect as the concatenate method. It
appends the string on the right to
the string on the left and return the
new string. For document objects, it
appends the document on the right
to the document on the left and
return the new document. In all
cases, the variables on either side
remain unchanged.
subtracts the number on the right
from the number on the left and
return the new value. The variables
on either side remain unchanged. It
is not valid for any other object
types.
multiplies the numbers on both
sides of the " * " and return the new
value. The variables on either side
remain unchanged. It is not valid for
any other object types.
divides the number on the left by
the number on the right and return
the new value. The variables on
either side remain unchanged. It is
not valid for any other object types.
Modulo%For integer objects, this divides the
number on the left by the number
on the right and return the
remainder. The variables on either
side remain unchanged. It is not
valid for any other object types. For
example, 5/2 returns 1 since 5 / 2 is
2 with remainder 1.
9
Comparison
These operators are used to compare the values of variables or properties of the same type. The result
of the comparison is a boolean value (TRUE or FALSE). Any of the symbols listed for an operator can
be used.
OperatorSymbolsDescription
Less Than<, LTFor integers and reals, returns TRUE if the value
Greater Than>, GTFor integers and reals, returns TRUE if the value
Less Than or Equal To<=, LEFor integers and reals, returns TRUE if the value
Greater Than or Equal To>=, GEFor integers and reals, returns TRUE if the value
Equal To== , EQ
(double equal sign)
Not Equal To!=, <>, NEFor integers and reals, returns TRUE if the value
on the left is less than the value on the right. For
strings, returns TRUE if the value on the left
comes alphabetically before the value on the right
(including case). Returns FALSE otherwise.
on the left is greater than the value on the right.
For strings, returns TRUE if the value on the left
comes alphabetically after the value on the right
(including case). Returns FALSE otherwise.
on the left is less than or equal to the value on the
right. For strings, returns TRUE if the value on the
left comes alphabetically before or is the same as
the value on the right (including case). Returns
FALSE otherwise.
on the left is greater than or equal to the value on
the right. For strings, returns TRUE if the value on
the left comes alphabetically after or is the same
as the value on the right (including case). Returns
FALSE otherwise.
For integers and reals, returns TRUE if the value
on the left is equal to the on the right. For strings,
returns TRUE if the value on the left is exactly the
same (including case) as the value on the right.
Returns FALSE otherwise.
on the left is not equal to the on the right. For
strings, returns TRUE if the value on the left is not
exactly the same (including case) as the value on
the right. Returns FALSE otherwise.
10
Boolean
These operators are used to build complex boolean expressions. Each value on either side of the
operator must be a boolean value. The result of the boolean operator is a boolean value (TRUE or
FALSE). Any of the symbols listed for an operator can be used.
OperatorSymbolsDescription
And&, &&, ANDANDs two boolean values to get the final boolean
Or|, ||, ORORs two boolean values to get the final boolean
Not!, NOTNOTs a boolean value to get the final boolean
result.
result.
result.
The following table shows the results of the AND and OR methods using:
bool1 AND bool2
bool1 OR bool2
bool 1bool2ANDOR
FALSEFALSEFALSEFALSE
FALSETRUEFALSETRUE
TRUEFALSEFALSETRUE
TRUETRUETRUETRUE
11
Other Features
Object shorthand using "with"
If you have a section code that is working with the same object, it can be cumbersome to continually
type the object name. To avoid this, you can use the with statement. The general format is:
with objectname
.property = value
.property = value
.method()
endwith
You state the object name being used in the with statement and then you can refer to any property or
method of the object by simply using the "dot" followed by the property or method name. This is most
commonly used with the action objects.
Debugging a script
When a script executes, the action objects can write error and warning messages to the log. You can
also write your own messages to the log to help debug your script.
For example, you may want to know the value of a variable or the return value of a method. To write
your message to the log use the "debug" statement.
debug msg
msg can be a string variable, a string in quotes, or a numeric expression. Below are some examples:
int index= 3
string ErrorMsg = "Failed to print"
debug index
debug ErrorMsg
debug "Job received from " + original.username
Each of these writes a message to the server log.
Prompting for values during compilation
There may be circumstances when you do not want the sensitive data (such as userids or passwords)
to appear in the script for everyone to see. In that case, you can prompt for the data during script
compilation. This data is not visible in the script itself and it does not exist in an uncompiled form. To
use this feature, you use the preprocessor prompt directive:
#prompt{prompt msg}
The prompt message you want displayed is placed between the braces ( {} ). You cannot use a string
variable here and the text should not be in quotes. This is because the prompt is processed before the
compiler is in use and thus you cannot use other objects. The value returned by the prompt is a string
and contains whatever text was entered by the user.
The prompt can be placed anywhere a string is expected, such as:
FTPget.username = #prompt{Enter your FTP username}
12
If the prompt is used where a number is expected, assign a string to the value returned by the prompt
and then use the AsInt method. For example:
string copies = #prompt{Enter number of copies}
PrintIP.copies = copies.AsInt()
Aborting a script during runtime
If you detect an error condition during script execution, it is useful to have a means of halting the script
processing. To accomplish this, you use the exit function:
void exit(string msg)
The exit function halts processing of the script. It lets you pass a string which appears in the server’s
log as well as on the confirmation page/dialog.
Reserved words
A variable may not be any reserved word that already has a special meaning in the script language.
The following is the list of reserved words:
•If
•Then
•Else
•Endif
•Switch
•Case
•Default
•Endswitch
•Loop
•Exit
•From
•To
•Endloop
•Repeat
•Until
•Endrepeat
•String
•Textfile
•Int
•Confirm
•Doc
•Bool
•Binary
•BinaryFile
•Original
•Real
•Endwith
•Userdata
•Log
•Prompt
13
2
Data Type Objects
All data used by the Document Distributor can be grouped into five distinct data types:
•Boolean
•Document
•Integer
•Real
•String
Every object property is one of the Data Type Objects. In addition, most variables are one of these
types. Following is a discussion of each of these objects.
14
Boolean
The Boolean object is used for values that are logically true or false. The only valid values for this
variable are the reserved words: TRUE and FALSE.
The object has no properties. The following operators are supported:
Operators
SymbolDescription
==, EQEquals
<>Not Equal
&, ANDAnd
|, OROr
!, NOTNot
=Assignment
15
Document
The document object is used to hold a collection of image, text, and other formatted files. All files in a
document object do not have to be of the same type; it can be used to hold different files of different
types.
A property or variable is of this type when declared as doc. The document object has no properties.
Methods
SyntaxDescription
bool AddDocument(doc doc1)Adds an existing document to the end of this document.
Parameters:
doc1 – document to be added
Returns:
A bool indicating success or failure.
bool AddFile(string path [, string type])Adds an existing file to the end of this document. This method
will fail if the file does not exist or could not be read.
Parameters:
path – fully qualified path of the file on the server to be
added
type – if not supplied, the file type will be set to the
extension of the file being added; otherwise, the value
supplied will be used.
Returns:
A bool indicating success or failure.
void Clear()Removes all files from the document.
Parameters:
None
Returns:
None
doc CopyRange(int start, int end)Copies the specified files in this document to a new document;
this actually makes a copy of the files so two copies of the files
now exist. Doing this allows changes to be made to one set of
the files without affecting the other set.
Parameters:
start – index of the first file in document to copy; file
indexes start at 1
end – index of the last file in document to copy
Returns:
A doc that contains a copy of the files in the specified
range.
16
SyntaxDescription
doc Copy()Copies all the files in this document to a new document; this
int GetDocumentSize()Returns the total size in bytes of all the files in this document.
string GetDocumentType()Returns the type (file format or extension) of the document. If
doc GetFile(int filenum)Returns a reference to the specified file; the returned
string GetFileLabel(int filenum)Returns the label for the specified file. The label is used as the
int GetFileSize(int filenum)Returns the size in bytes of the specified file. A value of zero
actually makes a copy of the files so two copies of the files
now exist. Doing this allows changes to be made to one set of
the files without affecting the other set.
Parameters:
None
Returns:
A doc that contains of the copy all the files.
A size of zero (0) is returned if no files are in the document.
Parameters:
None
Returns:
An int with the total number of bytes in this document.
all the files in the document are the same type, the value is the
document type; otherwise, the value is an empty string.
Parameters:
None
Returns:
A string containing the document type (file format or
extension) of the document.
document is not a copy, so any change made to this file affects
the original. An empty document is returned if filenum is
invalid.
Parameters:
filenum – index of file to get; file indexes start at 1
Returns:
A doc containing a reference to the specified file.
filename (minus the extension) for attachments in e-mails or
databases. An empty string is returned if filenum is invalid.
Parameters:
filenum – index of file label to get; file indexes start at 1
Returns:
A string containing the label of the specified file.
(0) is returned if filenum is invalid.
Parameters:
filenum – index of file size to get; file indexes start at 1
Returns:
An int containing the size in bytes of the specified file.
17
SyntaxDescription
string GetFileType(int filenum)Returns the type (file format or extension) of the specified file.
doc GetFileRange(int start, int end)Returns a reference to the specified files; the returned
int GetNumberFiles()Returns the number of separate files in this document. This
bool SetFileLabel(int filenum, string label)Sets the label for the specified file; this label is used as the
An empty string is returned if filenum is invalid.
Parameters:
filenum – index of file type to get; file indexes start at 1
Returns:
A string containing the value of file type of the specified
file.
document is not a copy, so any change made to these files
affects the original.
Parameters:
start – index of first file to get; file indexes start at 1
end – index of last file to get
Returns:
A doc containing a reference to the specified files.
does not return the number of pages.
Parameters:
None
Returns:
An int with the number of files in this document.
filename (minus the extension) for naming attachments in
e-mail or databases. This method fails if filenum is invalid.
Parameters:
filenum – index of file; file indexes start at 1
label – label to give specified file; since it is used as a
filename, the label must follow the rules of file naming.
Returns:
A bool indicating success or failure.
void SetFileLabelAll(string label)Sets the labels of all the files in this document; this label is
used as the filename (minus the extension) for naming
attachments in e-mail or databases.
Parameters:
label – label to give all the files; since it is used as a
filename, the label must follow the rules of file naming.
Returns:
None
Note:For variables of type doc, assigning the variable is simply a reference. In other words, both
variables point to the same physical set of files that make up the document. So when you
make a change to one of the files, that file is changed in both documents. To make different
working copies of the files, use the Copy or CopyRange methods of the doc object.
18
Operators
SymbolDescription
+Add (same as calling AddDocument)
[]Index (same as calling GetFile using that one file)
=Assignment (same as calling GetFileRange using all files)
19
Integer
The integer object is used for values that are numbers without decimal points.
A property or variable is of this type when declared as int. The object has no properties.
Methods
SyntaxDescription
void Add(int num)Adds num to the current value. The value of this object
real AsReal()Converts and returns the current value of this object as
string AsString()Returns the current value of this object as a string.
void Divide(int num)Divides the current value by num. The value of this
is changed.
Parameters:
num – integer to be added to current value
Returns:
None
a real object. The value of this object is not changed.
Parameters:
None
Returns:
A real with the value of this object.
This is typically used so that the value of the integer
can be used as part of a string.
Parameters:
None
Returns:
A string with the value of this object.
object is changed.
Parameters:
num – integer to divide by
Returns:
None
void Mod(int num)Divides the current value by num and sets the value of
void Multiply(int num)Multiplies the current value by num. The value of this
this object to the remainder.
Parameters:
num – integer to divide by
Returns:
None
object is changed.
Parameters:
num – integer to multiply by
Returns:
None
20
Operators
SymbolDescription
<, LTLess Than
>, GTGreater Than
<=, LELess Than or Equal To
>=, GEGreater Than or Equal To
==, EQEquals
<>, NE, !=Not Equal
+Add
-Subtract
*Multiply
/Divide
%Modulo (Remainder)
=Assignment
Examples
StatementValue of XComment
int x0Declares variable
x = 55Assigns value of 5 to x
x.Mod(2)15/2 is 2 with remainder
Note:The standard mathematical operators (+, -, *, /) can also be used.
21
Real
The real object is used for values that are numbers with decimal points.
A property or variable is of this type when declared as: real. The object has no properties.
Methods
SyntaxDescription
void Add(real num)Adds num to the current value. The value of this object
int AsInt ()Converts and returns the current value of this object as
string AsString()Returns the current value of this object as a string.
void Divide(real num)Divides the current value by num. The value of this
is changed.
Parameters:
num – real to be added to current value
Returns:
None
an int object. The value is not rounded; any numbers
after the decimal point are truncated. The value of this
object is not changed.
Parameters:
None
Returns:
An int with the value of this object.
This is typically used so that the value of the real can
be used as part of a string.
Parameters:
None
Returns:
A string with the value of this object.
object is changed.
Parameters:
num – real to divide by
Returns:
None
void Multiply(real num)Multiplies the current value by num. The value of this
object is changed.
Parameters:
num – real to multiply by
Returns:
None
22
Operators
SymbolDescription
<, LTLess Than
>, GTGreater Than
<=, LELess Than or Equal To
>=, GEGreater Than or Equal To
==, EQEquals
<>, NE, !=Not Equal
+Add
-Subtract
*Multiply
/Divide
=Assignment
23
String
The string object is used for values that are text. A property or variable is of this type when declared
as: string. The object has no properties.
Methods
SyntaxDescription
string AsAlphaNumeric()Converts and returns the current value of the string as
doc AsDoc()Returns the current value of this as a document. The
int AsInt()Returns the current value of the string as an integer.
a string that contains only the alphabetic and numeric
characters of the current value; all other characters are
removed. The value of this string is not changed.
Parameters:
None
Returns:
A string that contains only the alphabetic and
numeric characters in the current string.
document has one file that contains the current value
of this string as its text.
Parameters:
None
Returns:
A doc with the current value of this string as its
text.
The current value is read up to the first non-numeric
character. The returned value is zero (0) if the string is
empty or the first character is not numeric. The value
of this string is not changed.
Parameters:
None
Returns:
An int with the current value of the string as in
integer.
string AsLower()Converts and returns the current value of this string in
all lowercase letters. Any non-alphabetic characters
are not changed. The value of this string is not
changed.
Parameters:
None
Returns:
A string with the current value converted to all
lowercase letters.
24
SyntaxDescription
string AsUpper ()Converts and returns the current value of this string in
bool Compare(string string1)Compares the current value of this string to the one
bool CompareNoCase(string string1)Compares the current value of this string to the one
all uppercase letters. Any non-alphabetic characters
are not changed. The value of this string is not
changed.
Parameters:
None
Returns:
A string with the current value converted to all
uppercase letters.
provided. This comparison is case sensitive.
Parameters:
string1 – string to which the current value of this
string is compared
Returns:
A bool with a value of TRUE if the strings are the
same including the case of alphabetic characters;
otherwise, FALSE.
provided. This comparison is not case sensitive.
Parameters:
string1 – string to which the current value of this
string is compared
Returns:
A bool with a value of TRUE if the strings are the
same excluding the case of alphabetic characters;
otherwise, FALSE.
void Concatenate(string string1)Appends string1 to the current value of this string.
Parameters:
string1 – string to append
Returns:
None
int Find(string substring, int start)Searches the current value of this string for the first
int Length()Returns the number of characters in this string.
occurrence of the specified substring.
Parameters:
substring – the substring to search for
start – the index of the character in this string to
start the search at; a value of 1 starts the search
at the beginning
Returns:
An int indicating the start position of the substring
in this string; 0 if the substring is not found.
Parameters:
None
Returns:
An int containing the number of characters in
string.
25
SyntaxDescription
string Left(int count)Returns the first count characters of this string. If
string Mid(int start, int count)Returns a substring of the current string of length
string Right(int count)Returns the last count characters of the string. If count
array Separate(string separator)The current value of the string is searched for the
count is more than the length of the string, the entire
string is returned.
Parameters:
count – the number of characters to get
Returns:
A string containing the first count characters of the
current value.
count beginning at the start character. String indexes
start at 1.
Parameters:
start – the index of the first character to include in
the substring
count – the number of characters to include in the
substring; a value of zero (0) indicates the rest of
the characters in the string
Returns:
A string that is a substring of the current value and
contains the characters in the specified range.
is more than the length of the string, the entire string is
returned.
Parameters:
count – the number of characters to get
Returns:
A string containing the last count characters of the
current value.
separator string; every time it is found, a new string is
formed minus the separator value. When the end of
the string is reached, the remaining portion of the
string is added as the last item in the array. If the
separator is not found, the entire string is returned as
the first item in the array.
Parameters:
separator – the string used as the separator
value
Returns:
An array of strings with each item being a string
minus the separator.
26
SyntaxDescription
void TrimLeft()Removes any whitespace from the beginning of the
void TrimRight ()Removes any whitespace from the end of the string.
string. Whitespace is any newline, space, or tab
characters. The value of the current string is changed.
Parameters:
None
Returns:
None
Whitespace is any newline, space, or tab characters.
The value of the current string is changed.
Parameters:
None
Returns:
None
Operators
SymbolDescription
<, LTLess Than (compares using case)
>, GTGreater Than (compares using case)
==, EQEquals (compares using case)
<>, NENot Equal (compares using case)
+Concatenate
Examples:
For string, str, with a value of "ABC123abc:789":
There are some characters that are needed in strings that cannot be represented using normal
characters. To accommodate these characters, string objects support the following escape characters.
SymbolDescription
^nWindows new line
^lUnix line feed
^rUnix carriage return
^tTab
^^Caret
^xddHex
^"Put quote in string
To use these, simply include the escape character within the quotes. For example:
string str = "Line 1^nLine2^tTab to next column"
string msg = "This is the ^"first^" quoted string.
28
3
Helper Objects
Helper objects are provided to help perform some common operations. Currently, there are two objects
of this type:
•Array
•Tex tF il e
To use a helper object, declare a variable of the specific object type.
29
Array
The array object is used to contain a collection of strings. The array index begins at 1. This is object is
read-only; no items can be added, edited, or deleted from the array. The values get added by calling a
method that returns an array such as the Separate method of the string object.
A variable is of this type when declared as: array. The array object has no properties.
Methods
SyntaxDescription
string GetAt(int index)Returns the string at the specified index. If an invalid
int GetSize()Returns the number of items in the array.
index is specified, an empty string is returned.
Parameters:
index – the string in the array to get; indexes start
at 1
Returns:
The string at the specified index.
Parameters:
None
Returns:
An int with the number of items in the array.
Example:
For a string, str, that has a value of "Bill,Jane,John,Jill". If you call the separate method of
the string object, it returns an array with each entry being one of the names.
The textfile object is used to operate on a single text file; it cannot work with images or multiple files. It
can be used to read text from an existing file or to write out text to a new or existing file for use by some
other process,.
A variable is of this type when declared as: textfile. The object has no properties.
Methods
SyntaxDescription
bool Append(string text)Appends text to the end of the file. The file pointer is
bool AppendLine(string text)Appends text to the end of the file and inserts a new
bool Clear()Deletes the contents of the file. The method fails if a
moved to the end of the appended text. The method
fails if a file has not been opened or is out of disk
space.
Parameters:
text – data to append to file
Returns:
A bool indicating success or failure.
line at the end of the specified text. The file pointer is
moved to the end of the appended text after the new
line. The method fails if a file has not been opened or
is out of disk space.
Parameters:
text – data to append to file
Returns:
A bool indicating success or failure.
file has not been opened.
Parameters:
None
Returns:
A bool indicating success or failure.
void Close()Closes the file associated with this object.
Parameters:
None
Returns:
None
bool Eof()Checks if the file pointer is at the end of the file.
Returns TRUE if the end of file has been reached;
otherwise, FALSE.
Parameters:
None
Returns:
A bool indicating if the file pointer is at the end of
the file.
31
SyntaxDescription
string GetLine(int line)Returns the line of text specified by line with any new
int GetNumberLines()Returns the number of lines in the file. A line ends
bool Open(string file, bool create)Opens the specified file and sets the file pointer to the
line removed from the returned string. A line ends
when a new line is encountered. This method does not
move the file pointer. If line does not exist or a file is
not opened, an empty string is returned.
Parameters:
line – the line of text to get
Returns:
A string containing the specified line of text minus
the new line.
when a new line is encountered. This method does not
move the file pointer. A zero (0) is returned if a file has
not been opened.
Parameters:
None
Returns:
An int with the number of lines of text in this file.
beginning of the file. If the file does not exist and
create is set to TRUE, the file will be created;
otherwise, the file will not be created and the method
will fail. The method can also fail if the any directories
in the path do not exist or if the path is on a network
drive to which the Document Server does not have
access rights.
Parameters:
file – fully qualified path of the file to open
create – specifies whether to create the file if it
does not exist
Returns:
A bool indicating whether the file was successfully
opened.
bool Open(doc doc1)Opens the first file in the specified document and sets
the file pointer to the beginning of the file. Typically
called to use a file created by another action. The
method fails if the specified document has no fails.
Parameters:
doc1 – document to open
Returns:
A bool indicating whether the file was opened
successfully.
32
SyntaxDescription
string Read(int count)Returns count characters from the file starting at the
string ReadLine() Returns the next line from the file. The file pointer
bool Rewind()Moves the file pointer to the beginning of the file. This
current file pointer position. The file pointer is moved to
after the last character read. If count is greater than
the remaining characters in the file, the characters up
to the end of the file are returned. If a file is not opened
or the file pointer is at the end of the file, an empty
string is returned.
Parameter:
count – number of characters to read
Returns:
A string with the specified characters read from
the file.
advances until a new line character is encountered.
The returned string does not include the new line
character. If a file is not opened or the file pointer is at
the end of the file, an empty string is returned.
Parameters:
None
Returns:
A string containing the next line of text from the
file.
method fails if a file is not opened.
Parameters:
None
Returns:
A bool indicating success or failure.
int Size()Returns the size in bytes of the text file. A zero (0) is
returned if a file is not open.
Parameters:
None
Returns:
An int with the size of the file in bytes.
33
SyntaxDescription
bool Write(string data)Writes data to the text file at the current file pointer
bool WriteLine(string data)Writes data to the text file at the current file pointer
position. The file pointer moves to after the last
character written. This method fails if a file is not open
or if there is a lack of disk space.
Parameters:
data – string to write to the text file
Returns:
A bool indicating success or failure.
position. A new line character is written after data. The
file pointer moves to after the new line character. This
method fails if a file is not open or if there is a lack of
disk space.
Parameters:
data – string to write to the text file
Returns:
A bool indicating success or failure.
Example:
You have a file called "data.txt" in the root c:\ directory. You want to read in the whole file.
textfile tf
string data
int size
tf.Open("c:\data.txt", FALSE)
size = tf.GetSize()
data = tf.Read(size)
tf.Close()
34
Example:
You want to save the userdata that was submitted with the job to an xml file for later processing. The
file should be save to a data directory with each file named the usertime to insure a unique name.
The system objects enable you to get information about the originally submitted document or about the
user that submitted the job. They also allow you to customize the feedback provided to end-users that
submit jobs. The following system objects are supported:
•original—provides information about the submitted document and the user that submitted it
•userdata—contains values entered by the user when the job was submitted
•confirm—provides an interface for adding information to the confirmation page or dialog the
user sees when the job has completed
System objects cannot be declared as variables and no object properties of this type exist. These
objects automatically exist for every script. To use one, simply use the object type followed by a dot and
then the property or method name.
36
Original
The Original object contains the document that was submitted for the job along with any other known
information about the document. The properties of the object are read-only; therefore, they cannot be
changed in the script. The object contains no methods. To access the properties, type:
original.propertyname
The following are properties of the Original object.
Property Type Description
documentdocThe document that was submitted with the job; if the
useripstringThe ip address of the device (MFP or user’s
usernamestringThe username of the user that submitted the request.
useracctstringIf job accounting is enabled on an MFP, this is the
usertimestringThe time the job was submitted by the gateway to the
scriptnamestringThe name of the script currently being executed.
script options were set such that no document was
required, this property is not available.
workstation) that submitted the job.
If submitted from an MFP that does not provide
authentication or on which authentication is not
enabled, this value is "MFP User".
account number entered. For those MFPs without job
accounting or if the job is submitted from a workstation,
this value is (" ").
Document Server. This is the same time used for all
actions with the AppendTimestamp property.
37
The following properties are only available if the document was submitted through an MFP.
PropertyTyp eValue sDescription
scansizestringLETTER
LEGAL
A3
A4
A5
B4
B5
BOOK
EXECUTIVE
11X17
3x5 PHOTO
4x6 PHOTO
BUSINESS CARD
scanorientstringLandscape, PortraitThe orientation of the scanned document
scanres*realThe resolution of the scanned document.
scandepthintBlack & White = 1
Grayscale = 8
Color = 24
scanpagesintThe number of pages in the scanned
scanrotateoddint0, 90, 180, 270 The number of degrees odd pages must
The paper size of the scanned
document.
as set by the profile.
See note below table.
The color depth of the scanned
document.
document.
be rotated in order to achieve the
orientation requested by the profile.
scanrotateevenint0, 90, 180, 270The number of degrees even pages
must be rotated in order to achieve the
orientation requested by the profile.
Note:*The scanres property returns the value specified for the resolution in the scan profile.
Please note that in some cases the actual resolution of the image may be different. This
can happen when the requested resolution results in an image that would be too large for
the scanner to hold in memory. In this case, the resolution is automatically lowered.
38
Userdata
The userdata object contains any values entered by the user at the time the job was submitted. When
you write a script, one of your options is to prompt users for information when they submit a job. This
object provides access to that information.
The userdata object contains no methods; its properties are defined by you when declaring the
information to be requested from the user. For each question you add, you assign a variable name and
data type to that question. That variable name becomes one of the userdata object’s properties; the
user’s response to the question is stored in that property.
To access the userdata properties, use:
userdata.propertyname
For example, suppose you want to prompt the user for an account number (a string) and for the
number of copies being made (an integer). When defining the questions, you assign the variable name
of acccountnum for the account number and the variable name of copies to the number of copies
being made. To access these values, you would use:
string acct
int copies
acct = userdata.accountnum
copies = userdata.copies
While the above example uses variables to hold the values, you don’t have to do this to use the values.
Since you defined a data type for each property when defining the questions, the userdata property
can be used wherever a value of that data type can be used.
39
Confirm
The confirm object allows you to control the information that appears on the confirmation page (for jobs
submitted by way of an MFP) or the confirmation dialog (for jobs submitted by way of Print‘N’Send or
Select‘N’Send). These confirmation pages/dialogs appear after the job has been processed. You can
set the default behavior for all scripts by modifying the Server Settings in the Document Server Admin.
Sometimes it might be necessary to override the default settings from within a script; you can use the
confirm object to do that. To access the properties and methods, use:
confirm.propertyname
confirm.methodname()
The following are properties of the Confirm object.
PropertyTyp eValu eDescription
inputdocoriginal.documentThis controls the source that is used to
levelintLDD_CONFIRM_OFF—No
confirmation page/dialog is used
for this script.
LDD_CONFIRM_SCRIPT—The
script provides all the content for
the confirmation page/dialog.
LDD_CONFIRM_ERROR—All
warnings/errors are
automatically added to the
confirmation page/dialog; the
script provides all other content.
LDD_CONFIRM_VERBOSE—
All action objects automatically
add information after being
executed in addition to any other
warnings/errors.
LDD_CONFIRM_ONERROR—A
confirmation dialog only displays
if a warning/error occurs.
thumbsint0 to 3Controls the number of thumbnail images
generate the thumbnails on the
confirmation page.
This controls the type of confirmation
page/dialog that should be used for the
script. By default, the value set in the
server settings is used.
Controls whether a confirmation page
should be printed for jobs submitted by
way of MFP. The default value is always to
print.
Controls whether a confirmation dialog
box is displayed on the computer of the
user that submitted the job after it
completes. By default, the dialog is always
displayed.
that appear at the bottom of confirmation
pages. By default, the value set in the
server settings is used.
40
The following are methods for the Confirm object.
SyntaxDescription
void Reset()Causes all the properties in this object to be set back to the value specified
void Clear()Removes all items added to the confirmation page by the Daytime method
in the server settings.
Adds a line to the end of the confirmation page / dialog. If called multiple
times, each line is added in the order this method is called.
Parameters:
title – the short title that appears in the first column of the page /
dialog
success – indicates success or failure of this line. If set to TRUE,
“Completed” appears in the second column; otherwise, “Fail ed”
appears.
msg – a longer description that appears in the third column
err – an optional parameter; when specified, this text appears after
the success word in the second column. This is usually used for an
error or warning message.
Returns:
None
or by any other object.
Parameters:
None
Returns:
None
For the following examples, assume the default behavior for Confirmation Pages/Dialogs is confirm
level set to verbose and to always print and display.
For script A, you want all pages/dialogs turned off. At the beginning of the script, you would add the
following line:
confirm.level = LDD_CONFIRM_OFF
For script B, you want confirmation pages turned off, but the confirmation dialogs to still be displayed.
At the beginning of the script, you would add:
confirm.printmfp = LDD_CONFIRM_NEVER
41
For script C, you want to use the default comments except when you are inside a loop. You need to
change the level to script before the loop, add your own comments, and then reset the level back to
verbose following the script. To do this, you would add:
(other script processing)
confirm.level = LDD_CONFIRM_SCRIPT
loop (x from 1 to 5)
(print copies)
endloop
confirm.AddItem("Print", TRUE, "Copies sent to marketing")
confirm.level = LDD_CONFIRM_VERBOSE
(continue script processing)
These examples show various ways the confirm object can be used to augment the behavior specified
in the Confirmation Page Settings on a script-by-script basis.
42
5
Action objects
Many action objects create a new document as a result of their operation. If an action has a property
named output, it produces a new document during its execution. This document, however, does not
exist until after the Go method has been called. Before calling Go the first time, it is simply an empty
document. This new output document is only available while the script executes; if you need to use it
after the script is done, an action that saves or archives the document needs to be included in the
script.
The rest of this chapter discusses available action objects.
43
ConvertBarcodeToText
Purpose: Read one or more barcodes of a specified type on a single page. To read barcodes of
different formats from one page, this action must be used multiple times. The action fails if no barcodes
of the specified type are located on the page.
Install group: Barcode CD
Prerequisites: None
Properties
NameDescriptionData typeAdditional information
InputThe source document for
the action.
OutputThe document to which
this action’s output is
written.
TypeType of barcode to be
read.
PageNumberPage to read for barcodes.intA value of 0 can be used to
WholePageReads all barcodes on the
whole page. (The
barcodes must be of the
same type).
LeftSpecifies (in pixels) the left
side of the area to read.
docOnly one page of the
docThe output is ASCII text
int
(LDD Constant)
boolSet this to FALSE if only one
intValue is only used when
document can be read.
terminated by a new line
character.
See “Barcode Reference” on
page 189.
Default:
LDD_BARCODE_CODE39
indicate the last page.
Default:
1
area of the page should be
read.
Default:
TRUE
WholePage is set to FALSE.
Default:
0
TopSpecifies (in pixels) the top
of the area to read.
RightSpecifies (in pixels) the
right side of the area to
read.
BottomSpecifies (in pixels) the
bottom of the area to read.
Bold names are required properties.
44
intValue is only used when
WholePage is set to FALSE.
Default:
0
intValue is only used when
WholePage is set to FALSE.
Default:
0
intValue is only used when
WholePage is set to FALSE.
Default:
0
Methods
SyntaxDescription
bool Go()Executes the action. Returns TRUE or FALSE to
void Reset()Clears the current properties and returns them to their
indicate if the action completed successfully.
default values.
Notes:
•
ConvertBarcodeToText reads only one page from a document at a time. Use the PageNumber
parameter to specify which page to read a barcode from. To read barcodes from more than
one page, use the ConverBarcodeToText action multiple times.
•The values for Right, Left, Top, and Bottom depend on the scan resolution used to acquire the
document. Determine the scan resolution needed, determine the pixel positions needed to
bound the area, and then use the same scan resolution for all profiles that use the script.
•The ConvertBarcodeToText action is sensitive to scan quality. A scan resolution of 300 dots
per inch (dpi) typically provides good results. A resolution greater than 600 dpi is not
recommended.
•Images that are too dark decrease the accuracy of the barcode read. Profiles with a darkness
setting of 3 or less are recommended.
•For best results, use a monochrome image with this action. This allows the best detection of
the spaces within a barcode, resulting in greater accuracy.
•If you want to read only a specific area of a page, set WholePage to FALSE. For example, you
can scan invoices, read the invoice number from a barcode in the right-hand corner and use
that invoice number as the filename to store the invoice.
•The output from this action is text followed by a new line character. Depending on what the
output is used for, this new line character may need to be removed from the text prior to using
it.
•If you want to read multiple barcodes at once, use the ConvertForm action.
45
ConvertForm
Purpose: Using a data map created by FastMap, read a one page form for information such as
barcodes, check boxes, and typed text. For information about using FastMap, see the documentation
available from the FastMap application Help menu.
Install group: OCR and Barcode CDs
Prerequisites: None
Properties
NameDescriptionData typeAdditional information
InputThe source data for the
action.
OutputThe document to which
this action’s output is
written.
DataMapName of the data map to
use when reading the
form.
Bold names are required properties.
docOnly the first page of the
document will be read.
docThe output is the ASCII
text read from the
specified zones. Each
zone is written on a single
line.
stringThis is the name given to
the data map when it was
created with the FastMap
Utility.
Methods
SyntaxDescription
bool Go()Executes the action. Returns TRUE or FALSE to
indicate if the action completed successfully.
void Reset()Clears the current properties and returns them to their
default values.
46
ConvertImageFormat
Purpose: Converts one or more image files to the specified file format. To convert an image to
PostScript or PDF format, use the ConvertToDocument action.
Install group: Image Module
Prerequisites: None
Properties
NameDescriptionData typeAdditional information
InputThe source document for
the action.
OutputThe document to which
this action’s output is
written.
FormatThe output format of the
conversion.
ColorDepthThe number of bits to
use for color or
grayscale.
docMust be in an image format.
docOutput is in the specified
int
(LDD Constant)
int
(LDD Constant)
format.
Valid values:
LDD_IMGFORMAT_TIF
LDD_IMGFORMAT_TIFG3
LDD_IMGFORMAT_TIFG4
LDD_IMGFORMAT_TIFPB
LDD_IMGFORMAT_BMP
LDD_IMGFORMAT_JPG
LDD_IMGFORMAT_PJPG
LDD_IMGFORMAT_PCX
LDD_IMGFORMAT_DCX
LDD_IMGFORMAT_PNG
LDD_IMGFORMAT_EPS
Default:
LDD_IMGFORMAT_TIF
Valid value:
LDD_IMGDEPTH_BW
LDD_IMGDEPTH_4C
LDD_IMGDEPTH_8C
LDD_IMGDEPTH_8G
LDD_IMGDEPTH_24C
LDD_IMGDEPTH_24G
Default:
LDD_IMGDEPTH_BW
JPEGQualitySpecifies the amount of
JPEG compression
used. The higher the
number the better the
quality but the larger the
file.
AllPagesConverts all pages in the
input.
Bold names are required properties.
47
intValid value:
5–95
Default:
95
boolDefault:
TRUE
NameDescriptionData typeAdditional information
StartPageFirst page to convert. intValue is only used when
EndPageLast page to convert. intValue is only used when
Bold names are required properties.
AllPages is set to FALSE.
Valid value:
0–32767
Default:
0
AllPages is set to FALSE.
Value of 0 indicates the last
page in the file.
Valid value:
0–32767
Default:
0
Methods
SyntaxDescription
bool Go()Executes the action. Returns TRUE or FALSE to
indicate if the action completed successfully.
void Reset()Clears the current properties and returns them to their
default values.
Inputs/Outputs
This action can convert images to Encapsulated PostScript. However, it cannot convert an
Encapsulated PostScript file to another format. If the output of this action will be used by the PrintIP or
FaxByPrinter actions, it is recommended that the ConvertToDocument action be used to create the
PostScript file.
Some output formats, such as TIFF Group3 or TIFF Group4 do not support color images. See “Valid
conversion formats” on page 50 for the list of color depths supported by each format.
48
Default color depths
If the color depth of the output file specified in the script is not valid, the action chooses a proper
default value for that format and completes the conversion. The following table lists the default color
depth for different image formats.
Image formatDefault color depth
PostScript (*.ps)8-bit Grayscale
TIFF Group 4 (*.tif)Black and White
TIFF Group 3 (*.tif)Black and White
TIFF Packed Bits (*.tif)8-bit Color
TIFF Uncompressed (*.tif)8-bit Color
Bitmap (*.bmp)8-bit Color
Windows PCX (*.pcx)8-bit Color
Windows DCX (*.dcx)8-bit Color
JPEG (*.jpg)24-bit Color
Progressive JPEG (*.jpg)24-bit Color
PNG (*.png)8-bit Color
Multipage image formats
The image formats of TIFF and DCX can contain multiple pages in a single file. All other image formats
can contain only one page per file. If you convert a TIFF or DCX image with multiple pages to a format
that can contain only one page per file, the result will be one new file for each page in the original
multipage file.
49
Valid conversion formats
File typeValid conversion
BitmapBlack and White
4-bit Color
8-bit Grayscale
8-bit Color
24-bit Grayscale
24-bit Color
JPG24-bit Grayscale
24-bit Color
TIFF (Uncompressed)Black and White
4-bit Color
8-bit Grayscale
8-bit Color
24-bit Grayscale
24-bit Color
TIFF (Packed Bits)Black and White
4-bit Color
8-bit Grayscale
8-bit Color
24-bit Grayscale
24-bit Color
TIFF (Group 3)Black and White
TIFF (Group 4) Black and White
EPSBlack and White
8-bit Grayscale
24-bit Grayscale
24-bit Color
PCXBlack and White
4-bit Color
8-bit Grayscale
8-bit Color
24-bit Grayscale
24-bit Color
DCXBlack and White
4-bit Color
8-bit Grayscale
8-bit Color
24-bit Grayscale
24-bit Color
50
File typeValid conversion
PJPEG24-bit Grayscale
24-bit Color
PNG8-bit Grayscale
8-bit Color
24-bit Grayscale
24-bit Color
51
ConvertToDocument
Purpose: Converts one or more image files to PDF or PostScript document format.
Install group: Image Module
Prerequisites: None
Properties
NameDescriptionData typeAdditional information
InputThe source document for the
action.
OutputThe document to which the
action’s output is written.
FormatOutput format of the conversion.
Color images are converted in
color.
PaperSizeThe paper size to use for the
output. If the value is
LDD_PAPERSIZE_AUTO, the
paper size specified in the profile
used to initiate this job is used.
docMust be in an image format.
doc
int
(LDD
Constant)
int
(LDD
Constant)
Valid values:
LDD_DOCFORMAT_PDF
LDD_DOCFORMAT_PS
Default:
LDD_DOCFORMAT_PDF
Valid values:
LDD_PAPERSIZE_AUTO
LDD_PAPERSIZE_A3
LDD_PAPERSIZE_A4
LDD_PAPERSIZE_A5
LDD_PAPERSIZE_B4
LDD_PAPERSIZE_B5
LDD_PAPERSIZE_BOOK
LDD_PAPERSIZE_BUSCARD
LDD_PAPERSIZE_EXECUTIVE
LDD_PAPERSIZE_LEGAL
LDD_PAPERSIZE_LETTER
LDD_PAPERSIZE_PHOTO35
LDD_PAPERSIZE_PHOTO46
LDD_PAPERSIZE_TABLOID
Default:
LDD_PAPERSIZE_AUTO
OrientationThe orientation to use for the
output. If the value is
LDD_ORIENTATION_AUTO, the
orientation specified in the profile
used to initiate this job is used. If
the job is initiated from an LDD
Client, the default value is
LDD_ORIENTATION_PORTRAIT.
Bold names are required properties.
int
(LDD
Constant)
52
Valid values:
LDD_ORIENTATION_AUTO
LDD_ORIENTATION_PORTRAIT
LDD_ORIENTATION_LANDSCAPE
Default:
LDD_ORIENTATION_AUTO
NameDescriptionData typeAdditional information
PSResolutionResolution of the input. Only used
when converting to PostScript
format and no resolution is
provided in the profile. Jobs
received from an MFP contain the
resolution at which the original
image was scanned. Value of
LDD_RESOLUTION_AUTO
indicates that the scan setting
specified in the profile will be used.
AllPagesConverts all pages in the input.boolDefault:
StartPagePage to start the conversion. intValue is only used when AllPages is
EndPagePage to end the conversion. intValue is only used when AllPages is
Bold names are required properties.
int
(LDD
Constant)
Valid values:
LDD_RESOLUTION_AUTO
LDD_RESOLUTION_75
LDD_RESOLUTION_150
LDD_RESOLUTION_200
LDD_RESOLUTION_300
LDD_RESOLUTION_400
LDD_RESOLUTION_500
LDD_RESOLUTION_600
Default:
LDD_RESOLUTION_AUTO
TRUE
set to FALSE.
Default:
0
set to FALSE. Value of 0 indicates
the last page in the file.
Default:
0
Methods
SyntaxDescription
bool Go()Executes the action. Returns TRUE or FALSE to
indicate if the action completed successfully.
void Reset()Clears the current properties and returns them to their
default values.
53
ConvertToText
Purpose: Converts an image into the specified text format.
Install group: OCR Module
Prerequisites: None
Properties
NameDescriptionData typeAdditional information
InputThe source document for
the action.
OutputThe document to which the
action’s output is written.
FormatThe output format of the
conversion.
AllPagesConverts all pages in the
input.
StartPageThe first page to convert. intValue is only used when AllPages is set to
EndPageThe last page to convert.intValue is only used when AllPages is set to
LanguageThe language of the
document that is being
converted.
docThe input document must be in TIFF,
doc
int
(LDD Constant)
boolDefault:
int
(LDD Constant)
JPEG, PCX, DCX, PNG, or BMP format.
See “Supported output formats” on
page 57.
Default:
LDD_TEXTFORMAT_STANDARD_WIN
TRUE
FALSE.
Default:
0
FALSE. A value of 0 indicates the last
page of the file.
Default:
0
Valid values:
LDD_LANG_DANISH
LDD_LANG_DUTCH
LDD_LANG_ENGLISH
LDD_LANG_FINNISH
LDD_LANG_FRENCH
LDD_LANG_GERMAN
LDD_LANG_ITALIAN
LDD_LANG_NORWEGIAN
LDD_LANG_PORTUGUESE
LDD_LANG_SPANISH
LDD_LANG_SWEDISH
Default:
LDD_LANG_ENGLISH
Bold names are required properties.
54
NameDescriptionData typeAdditional information
CharacterTypesThe character types in the
document to convert.
SpellCheckUse a dictionary during
conversion to increase
accuracy.
KeepFormatKeeps all the formatting of
the document, such as
bold, underline, font size,
spacing, and so on.
WholePageConverts the entire page
of the image. Set this to
FALSE if only one area of
the image should be
converted.
LeftSpecifies (in pixels) the left
side of the area to convert.
TopSpecifies (in pixels) the top
of the area to convert.
RightSpecifies (in pixels) the
right side of the area to
convert.
int
(LDD Constant)
boolDefault:
boolDefault:
boolDefault:
intValue is only used when WholePage is
intValue is only used when WholePage is
intValue is only used when WholePage is
Valid values:
LDD_FILTER_ALLCHARS
LDD_FILTER_LETTERS
LDD_FILTER_NUMBERS
Default:
LDD_FILTER_ALLCHARS
TRUE
FALS E
TRUE
set to FALSE.
Default:
0
set to FALSE.
Default:
0
set to FALSE.
Default:
0
BottomSpecifies (in pixels) the
bottom of the area to
convert.
Bold names are required properties.
intValue is only used when WholePage is
set to FALSE.
Default:
0
Methods
SyntaxDescription
bool Go()Executes the action. Returns TRUE or FALSE to
void Reset()Clears the current properties and returns them to their
indicate if the action completed successfully.
default values.
55
Notes:
•The values for Right, Left, Top, and Bottom depend on the scan resolution used to acquire the
document. Determine the scan resolution needed, determine the pixel positions needed to
bound the area, and then use the same scan resolution for all profiles that use the script.
•The upper left corner of the page is 0,0 in pixel coordinates. Left, Top, Right, and Bottom
should be specified relative to these coordinates.
•The ConvertToText action is sensitive to scan quality. A scan resolution of 400 dpi typically
provides good results. There are many different types of fonts, paper, formats and forms.
Experimentation may be needed with a sample document to tune both the scan quality and
subsequent OCR conversion. A resolution greater than 600 dpi is not recommended.
•Extremely light text should be darkened during the scan process to increase accuracy. Images
that are too dark decrease the accuracy of the OCR conversion.
•If you want to convert only a specific area of a page, set WholePage to FALSE. For example,
you can scan invoices, convert only the invoice number in the right-hand corner and use that
invoice number as the filename to store the invoice.
•The ConvertForm action should be used for barcodes, check boxes, and typed text.
56
Supported output formats
FormatValue
ASCII Plain for DOSLDD_TEXTFORMAT_PLAIN_DOS
ASCII Plain for WindowsLDD_TEXTFORMAT_PLAIN_WIN
ASCII Smart for DOSLDD_TEXTFORMAT_SMART_DOS
ASCII Smart for WindowsLDD_TEXTFORMAT_SMART_WIN
ASCII Standard for DOSLDD_TEXTFORMAT_STANDARD_DOS
ASCII Standard for WindowsLDD_TEXTFORMAT_STANDARD_WIN
ASCII Stripped for DOSLDD_TEXTFORMAT_STRIPPED_DOS
ASCII Stripped for WindowsLDD_TEXTFORMAT_STRIPPED_WIN
HTML Level 3LDD_TEXTFORMAT_HTML3
Excel 97, 2000LDD_TEXTFORMAT_EXCEL2000
Microsoft Word for Windows 97, 2000LDD_TEXTFORMAT_WORD2000
Rich Text Format for DOSLDD_TEXTFORMAT_RTF_DOS
Rich Text Format for WindowsLDD_TEXTFORMAT_RTF_WIN
Rich Text Format for WinWord 6LDD_TEXTFORMAT_RTF_WORD6
Rich Text Format for WinWord 7LDD_TEXTFORMAT_RTF_WORD7
The different ASCII formats provide various levels of output formatting. Each one is described below:
•ASCII Plain—Text only; no formatting.
•ASCII Smart—Page formatting such as paragraphs, indents, spacing, and centering is
preserved.
•ASCII Standard—Minimal page formatting is preserved. White spaces remain spaces;
carriage returns are included.
•ASCII Stripped—Paragraphs are long single lines, which will automatically format when
margins change. Carriage returns for "hard" new lines are included.
57
DatabaseNotes
Purpose: Adds an entry to the specified Lotus Notes database on the specified Notes server. It uses a
predefined form. Documents that have multiple attachments are supported.
Install group: Lotus Notes Module
Prerequisites:
•The Lotus Notes desktop must be installed on the Document Server workstation for this action
to utilize the Notes capabilities. The Notes desktop provides the underlying Notes security and
settings for the Document Server to interact with the Notes servers.
•A valid Notes user account/ID file for use by the Notes actions on the Document Server must
be provided. Notes administrators typically call the Notes IDs associated with a server
application (rather than a person) an application ID. This ID should not be password protected.
Note:If the ID file used by the Notes client has a password, this password must be shared
with 3rd party applications. To change this setting, inside the Notes client choose File
Tools User ID. On the dialog that appears, select "Share password with Notes
add-ins".
•The user account/ID file for use by the Notes actions must be granted access to the Notes
database you wish the action to insert into.
Properties
Name DescriptionData typesAdditional information
ServerName of server hosting
the database.
DatabaseName of the Notes
database to use.
FormName of the Notes
database form to use.
ComputeWithFormPerforms calculations,
validates fields, and
populates default values
as specified in the Notes
form when a new record is
inserted.
Bold names are required properties.
stringIf left blank, defaults to the local
machine.
stringThe database name is the actual
filename of the database to use and is
relative to the Notes data directory on
the specified server.
stringIf left blank, defaults to the default form
for the database.
boolDefault:
FALS E
58
Methods
SyntaxDescription
bool Go()Executes the action. Returns TRUE or FALSE to indicate if
void Reset()Clears the current properties and returns them to their
bool AddField(string fieldname, int datatype,
string value)
bool AddField(string fieldname, int datatype,
int value)
bool AddField(string fieldname, int datatype,
doc value)
the action completed successfully.
default values.
Sets a Notes Database field of type text, rich text, or date/
time to the specified string value. This method fails if the
datatype specified does not match the type of value
provided.
Parameters:
fieldname – name of the Notes Database field to set
datatype – type of Notes Database field; this must be
one of the following LDD constants:
LDD_NOTESDBFIELD_TEXT
LDD_NOTESDBFIELD_RICHTEXT
LDD_NOTESDBFIELD_DATETIME
value – value to set the field to
Returns:
A bool indicating success or failure.
Sets a Notes Database field of type number to the specified
integer value. This method fails if the datatype specified
does not match the type of value provided.
Parameters:
fieldname – name of the Notes Database field to set
datatype – type of Notes Database field; this must be
the following LDD constant:
LDD_NOTESDBFIELD_NUMBER
value – value to set the field to
Returns:
A bool indicating success or failure.
Adds an attachment to a Notes Database field of type text or
rich text. This method fails if the datatype specified does not
match the type of value provided.
Parameters:
fieldname – name of the Notes Database field to set
datatype – this must be the following LDD constant:
LDD_NOTESDBFIELD_ATTACHMENT
value – attachment to be added
Returns:
A bool indicating success or failure.
Notes:
Each time the Go() method is called a new record is written to the Notes database. The record
contains the fields specified by preceding AddField() calls.
59
If multiple records are written to the database, call the Reset() method to clear all the fields. Then call
AddField() as many times as necessary, followed by one call to the Go() method to insert the record in
the database.
Example:
This example script inserts the originally scanned document into a Notes database along with a string
describing the document's content.
•These actions have only been tested with Lotus Domino R5.0.4a; other R5 servers should
work but have not been specifically tested. The Domino server must include a Domino.Doc
server installation of version 3.0 or higher.
•A Lotus Notes client certified by Lotus as compatible with Domino.Doc must be installed on the
same machine as the Document Server.
•If the Document Server will be connecting to Domino using Notes authentication, a Notes ID is
required. If the ID has a password, Notes can be configured to share the password with third
party add-ins; this is not required, but is an option.
•If the Document Server will be connecting to Domino using an HTTP or HTTPS connection, an
internet browser certified by Lotus to work with Domino must be present.
•No matter which method is being used to connect to Domino, the Domino.Doc Desktop
Enabler must be installed. The Enabler can be installed by visiting a web-enabled Domino.Doc
database with a browser and selecting "Getting Started" on the library’s home page.
61
DominoDocCheckIn
Purpose: Inserts one or more documents with any associated metadata into Lotus Domino.Docs.
Properties:
NameDescriptionData TypesAdditional information
InputThe document
to be checked
in.
UsernameSpecifies user to
login as.
PasswordSpecifies the
password of the
user.
LibrarySpecifies the
Domino.Doc
library to use.
RoomStringPlease see “Navigating a Domino.Doc Library”
CabinetString
CategoryString
BinderString
DescriptionThe description
to be associated
with all versions
of this document
DocEach file in the doc is checked in separately.
The label of each file in the document is used
to generate the document titles. If files have the
same label, a qualifier "(x of y)" is appended to
each title, where x and y denote the 1-based
indexes of the files with the same file label.
StringIf connecting via Notes, this should be left
blank. Required if connecting via HTTP or
HTTPS.
StringIf connecting via Notes and the password is
shared or there is no password, this can be left
blank. In all other cases, this is the password of
the user.
StringPlease see “Connecting to Domino.Doc” on
page 72 for more details.
on page 72 for more information on these four
settings.
StringThis is used for the newly-created version and
any operations thereafter.
CheckinlevelSpecifies
whether the
document being
checked in is a
major version
(1.0) or a draft
(0.1).
StringThis field is typically automatically updated as
the document passes through Domino.Doc
workflow processes such as review, approval,
and auditing.
62
NameDescriptionData TypesAdditional information
DocumentTypeSpecifies the
type of the
document to be
checked in.
DocumentListArrayAfter calling the Go method, this contains an
Bold names are required properties.
StringThe default is empty (no type). The document
type is termed a "profile" in Domino.Doc and
specifies which fields of metadata are available
for this document. The document type must be
one of the valid types supported when the file
cabinet was created. The document type is
case-sensitive. If workflow features in
Domino.Doc are being used, such as
document life-cycle automation, the
DocumentType also specifies which workflow
will automatically apply to the checked-in
document.
array of strings corresponding to the unique
Domino identifier assigned to each file that was
checked in.
63
Methods:
SyntaxDescription
bool Go()Each file in the input document is checked in separately with the same
void Reset()Clears all information previously set for this action and returns all properties
void SetMetadata(string key,
string value)
security, profile, and metadata settings.
Parameters:
None
Returns:
TRUE – all file(s) checked in successfully; the DocumentList property is
filled with the list of unique Domino identifiers assigned to each file.
FALSE – unable to initialize the API, invalid library specified, invalid
username or password, empty input document, invalid property setting.
Consult the logfile for more information on the exact error.
to their default value.
Parameters:
None
Returns:
None
Sets a metadata key/value pair to be used during the next use of the Go
method. Valid metadata keys are determined by the document type in the
document profile design. This function can be called as many times as
needed to set all metadata items for an input document.
Parameters:
key – name of the key to set
value – value to be used for the key
Returns:
None
void ClearMetadata()Removes all metadata key/value pairs currently stored in this object. This is
most useful if the DominoDocCheckIn object is to be used multiple times in
the same script.
Parameters:
None
Returns:
None
64
SyntaxDescription
void SetSecurityLevel(string
name, int level)
void ClearSecurityLevel()Removes all access levels currently stored in this object. This is most useful
Specifies the access level of a particular user to this document. If this method
is not called, the document will use the same security settings as its parent
binder. This method can be called as many times as necessary to setup each
individual’s access level. Any user for whom this method is not called will
receive the default access level.
Parameters:
name – fully-qualified name of a user that has access rights to
participate in this cabinet
level – the access rights to be granted to the specified user for the
document being checked in; must be one of the following values:
if the DominoDocCheckIn object is to be used multiple times in the same
script.
Parameters:
None
Returns:
None
To check the scanned document into Domino.Doc
This example assumes the scanned document is a single file. This is the smallest complete example of
using the CheckIn action and does not include any options. Typically the document ID returned by the
method will be stored elsewhere for use later (for instance, including it in an e-mail).
doc d1=original.document// the document that is to be checked in
string id// where to store the document ID
with DominoDocCheckin
.input=d1
.library="notes://MyServer/DocumentLibrary.nsf"
.cabinet="Scanned Files"
.binder="LDD"
.description="Submitted from "+original.userip
.comment="Inserted by LDD"
.Go()
id=.documentlist[1]
endwith
65
Additional check-in metadata and security options
In this example, the checked-in document is to be used as a status report for John Doe’s current
project. Unfortunately John Doe is only able to read documents in the Status Reports binder, so
security is overridden to allow him to edit this one. The document is labeled and additional metadata
added.
doc d1=original.document// the document that is to be checked in
d1.SetFileLabelAll("Widget: Current Status")
with DominoDocCheckin
.input=d1
.library="notes://MyServer/DocumentLibrary.nsf"
.cabinet="Project Files"
.binder="Status Reports"
.description="Submitted from "+original.userip
.comment="Inserted by LDD"
.SetSecurityLevel("John Doe/MyNotesDomain",LDD_DOMDOC_SECURITY_EDITOR)
.documenttype="Generic Document"
.SetMetadata("Description","Project: Widget TeamLeader: Doe")
.SetMetadata("Date",original.usertime.AsAlphanumeric())
.Go()
endwith
66
DominoDocRetrieve
Purpose: Retrieves one or more documents and their associated descriptions and metadata from a
Lotus Domino.Docs library based on search criteria.
Details: Documents are retrieved from Domino.Doc by using the unique document IDs assigned by
Domino when documents are checked in. To use this action, the connection, navigation, and search
criteria are first set. The Query() method is then called; if successful, an array of document IDs of all
the matching documents is returned in the DocumentList property. The DocumentID property is then
set to one of these IDs and the Go method is called to retrieve the document and its associated
description and metadata.
67
Properties:
NameDescriptionData TypeAdditional information
UsernameSpecifies user to
login as.
PasswordSpecifies the
password of the user.
LibraryThe Domino.Doc
library to use.
RoomstringPlease see Navigating a Domino.Doc Library for
Cabinetstring
Categorystring
Binderstring
SearchmethodSpecifies the type of
query to be
performed.
stringIf connecting via Notes, this should be left blank. If
stringIf connecting via Notes and the password is
stringPlease see Connecting to Domino.Doc below for
int (LDD
constant)
connecting via HTTP or HTTPS, the username to
login as.
shared or there is no password, this can be left
blank.
more details.
more information on these four settings.
Values:
LDD_DOMDOC_SMETHOD_NONE –
Navigate to a binder and select by title
LDD_DOMDOC_SMETHOD_FORMULA –
Optionally navigate to a cabinet, use a LotusScript
formula
LDD_DOMDOC_SMETHOD_FAVS –
No navigation, select by title from the Favorites
web bookmarks
LDD_DOMDOC_SMETHOD_RECENT –
No navigation, select by title from the Recently
Edited web bookmarks
LDD_DOMDOC_SMETHOD_OUT –
No navigation, select by title from the Checked
Out web bookmarks
Default:
LDD_DOMDOC_SMETHOD_NONE
CriteriaIf the formula search
method was
specified, this is used
to specify the
LotusScript search
criteria or full-text
search qualification.
Bold names are required properties.
stringFull-text searching can only be used if it has been
enabled for this library.
This setting is not used by any other search
method.
68
NameDescriptionData TypeAdditional information
FulltextoptionsIf the formula search
method was
specified, this
specifies how the
full-text searching
should operate.
SortoptionsIf the formula search
method was
specified, this
specifies the order in
which match
documents are
returned in the
document list.
WhichdocumentAfter the Query
method is called, a
list of all matching
documents is
created. If this
property is specified,
the list of matching
documents is
searched for one with
a document title that
matches this value.
DocumentIDThe unique
document id of the
document that should
be retrieved with next
call to the Go
method.
int (LDD
Constant)
int (LDD
Constant)
string There must be only one match; if there are no
string
Values:
LDD_DOMDOC_FULLTEXT_NONE – exact
match required or no full-text searching in use
LDD_DOMDOC_FULLTEXT_STEMWORDS –
use the base words for matching (matches include
suffixes such as ‘ed’, ‘ing’, or ‘s’)
LDD_DOMDOC_FULLTEXT_THESAURUS –
words of similar meaning are treated as matching
LDD_DOMDOC_FULLTEXT_BOTH – apply both
the stem words and thesaurus.
Default:
LDD_DOMDOC_FULLTEXT_NONE
Values:
LDD_DOMDOC_SORT_NONE – documents are
returned in their ‘natural’ order
LDD_DOMDOC_SORT_RELEVANCE – if
weighting is included in the LotusScript search
string, closer matches are listed first
LDD_DOMDOC_SORT_DATEDESCEND –
documents are listed with the most recent first
LDD_DOMDOC_SORT_DATEASCEND –
documents are listed with the oldest first
Default:
LDD_DOMDOC_SORT_NONE
matches or multiple matches, the Query method
will return FALSE. If there is only one match, that
document id will be the only one returned in the
DocumentList property.
OutputThe document mostly
recently retrieved
using the Go method.
DocumentTypeThe document type
(or document profile)
of the document
most recently
retrieved using the
Go method.
Bold names are required properties.
docThis is empty if no document has been
successfully retrieved.
stringThis is an empty string if no document has been
successfully retrieved.
69
NameDescriptionData TypeAdditional information
DescriptionThe description of
the document most
recently retrieved
using the Go method.
DocumentListThis array contains
the list of matching
documents as
returned by the
Query() method.
Bold names are required properties.
stringThis is an empty string if no document has been
successfully retrieved.
ArrayThis array is empty until the Query method is
called.
70
Methods:
SyntaxDescription
bool Go()Retrieves the single, unique document specified by the
void Reset()Clears all information previously set for this action and
bool Query()Executes the search query specified by the
string GetMetadata(string key)Gets the value of the specified key for the document
DocumentID property.
Parameters:
None
Returns:
TRUE – the document was found and is now
available in the output property; the document
type, description, and metadata are now also
available.
FALSE – unable to find the document
returns all properties to their default value.
Parameters:
None
Returns:
None
searchmethod, criteria, sortoptions, fulltextoptions,
and whichdocument properties. The queries will
navigate to the required cabinet or binder if specified
or if the search method requires them.
Parameters:
None
Returns:
TRUE – the query was successful; the list of
matching document ids is now available in the
DocumentList property.
FALSE – the query was not successful; possible
causes include unable to connect to the
specified library, invalid username or password,
unable to navigate to specified library location,
or invalid search property setting
If the query was able to execute and there are no
documents matching the search criteria, this
method will still return TRUE.
most recently retrieved with Go.
Parameters:
key – the key to return the metadata value of
Returns:
The value of the specified key for the most
recently retrieved document. This value is
formatted according to the format specifications
defined for that document type. If the specified key
does not exist, an empty string is returned.
71
Connecting to Domino.Doc
When using either action, the action must first connect to a particular Domino.Doc library before it can
proceed with the requested function. Each action uses the username, password, and library properties
to configure the connection. Domino.Doc supports three connection methods; each method is
described below along with the necessary settings for these properties.
Notes Client:
This method connects to Domino.Doc with the user id stored in the local Notes id file. In this
case, the username property should be left blank. The password property can be left blank if
the Notes client was configured to share its password with add-in applications; otherwise, the
password property should be used to explicitly specify it. The library property must begin with
"notes://" and can be used to access hierarchical Notes servers if necessary. Typical values
are:
These methods connect to Domino.Doc as a particular user and are not restricted to the user
id in the local Notes id file. The username and password properties must be supplied using the
fully-qualified name as it appears in the Notes Name and Address Book, e.g. "John Doe/
NotesDomain". Typical library property values are:
Each action uses the room, cabinet, category, and binder properties to navigate to a particular location
in the Domino.Doc library. Rooms and categories are grouping techniques used to make the graphical
display of a library easier to use. Every cabinet must have a unique name while every binder in a
cabinet must have a unique name. For example, a cabinet may appear in more than one room or a
binder may appear in more than one category. Binders in different cabinets may have the same name;
binders in the same cabinet cannot.
Only cabinets and binders need to be specified to find the correct location in the library. Room and
category properties may be used to facilitate the location of particular cabinets or binders (especially
when relating to what is seen on a client display). When checking-in documents, a unique cabinet and
binder must be specified. When retrieving documents, a cabinet and binder only need to be specified if
the specified search method requires it.
Note:Categories can be nested. Nested categories are denoted by using "/" as the path
separator. For example, "Forms/Medical".
72
Retrieving a known document ID
The document ID returned by the check-in method uniquely identifies the document and could have
been sent in an e-mail or added to a confirmation page. The following script defines a userdata field so
when running this script a document ID can be entered and retrieved. The script will typically continue
to print or send this document.
doc d1// the retrieved document
with DominoDocRetrieve
.library="notes://MyServer/DocumentLibrary.nsf"
.documentID=userdata.docid
.Go()
d1=.output
endwith
Searching for files matching a specific criteria
The organization above has chosen to label and categorize project files in a consistent manner, and
has chosen to make sure that all titles of documents checked into Domino.Doc include the project
name. The following example finds all files relating to the Widget project, orders them most recent first,
and collates them into a single LDD document which may for instance be delivered in an e-mail.
doc dCollate// where all matching files are collated
int iIndex// index of matching documents
with DominoDocRetrieve
.library="notes://MyServer/DocumentLibrary.nsf"
.cabinet="Project Files"
.searchmethod=LDD_DOMDOC_SMETHOD_FORMULA
.criteria='([Title]CONTAINS"Widget")'
.sortoptions=LDD_DOMDOC_SORT_DATEDESCEND
.Query()
loop iIndex from 1 to .documentList.GetSize()
.documentID=.documentList[iIndex]
.Go()
dCollate.AddDocument(.output)
endloop
endwith
73
EmailExchange
Purpose: Sends e-mail to one or more recipients by way of a given Exchange server. Recipients may
be people or public Exchange folders.
Install group: Microsoft Exchange Module
Prerequisites: There are several prerequisites for using the EmailExchange action:
•Microsoft Outlook must be installed on the same computer as the Document Server. Microsoft
Outlook Express that comes with Internet Explorer will NOT work.
The values of "CMC" and "MAPI" keys should both be set to 1.
•You need a valid user account on the Exchange server to log in. If you have Outlook installed,
try to log in to your Exchange server to verify this is working.
•Document Distributor must log in as a user. The Document Server is a service. For the
EmailExchange action, you need to configure the service to log in with a user account. The
user account chosen must have a valid Exchange e-mail account. The user account should
have full access to the Document Server host computer.
To configure the Document Server service to log in as a user (You must be logged in as an
administrator to do this):
Windows NT:
aGo to Start Settings Control Panel Services.
bSelect the Lexmark Document Server service and click Startup.
cClick "This Account" and select the user’s name who has the access rights desired. Type
the user’s password and confirm.
dClick OK.
Note:For the service to log on as the user specified, you must stop and start the Document
Server service or reboot the computer.
Windows 2000/XP:
aGo to Start Settings Control Panel Administrative Tools Services.
bDouble-click the Lexmark Document Server service.
cChoose the Log On tab.
dClick "This Account" and select the user’s name who has the access rights desired. Type
the user’s password and confirm.
eClick OK.
Note:For the service to log on as the user specified, you must stop and start the Document
Server service or reboot the computer.
74
About Exchange profiles
A user "profile" is required for Document Distributor to log in to Exchange. The profile specifies the
address of the Exchange server and the name of the valid Exchange mailbox. Document Distributor
creates an Exchange profile for you if your script supplies:
•The name of the profile you want to create.
•The address of the machine on which Exchange is installed.
•The name of a valid Exchange mailbox
If you supply the name of a profile that already exists on the Document Distributor machine then
Document Distributor attempts to log onto Exchange with that profile. If no profile name is supplied at
all, then Document Distributor looks into the system registry for the name of a default profile. The name
of this default profile (if one exists) is found in the following registry key:
If no profile name is specified in the script and no default profile exists on the system, Document
Distributor produces an error.
Properties
Name DescriptionData typeAdditional information
ToList of e-mail addresses to
which this message is sent.
FromThe e-mail address of the
sender.
ccList of e-mail addresses to
which copies are sent.
bccList of e-mail addresses to
which blind copies are sent.
SubjectSubject of e-mail.string
stringComma delimit to specify
more than one recipient.
string
stringComma delimit to specify
more than one recipient.
stringComma delimit to specify
more than one recipient.
MessageText string to use as the
message body.
AttachmentsThis can be an:
• Original scanned document
• Output from a previous
action
ServerIP address or DNS hostname of
server.
MailboxMailbox namestringInclude this value if you
Bold names are required properties.
string
docTo attach multiple files,
create a variable of type
doc and call the doc
object’s AddFile() method
to add the files to the doc
object before using it here.
stringInclude this value if you
want Document Distributor
to create a profile for you.
want Document Distributor
to create a profile for you.
75
Name DescriptionData typeAdditional information
ProfileNameProfile to use stringThis value specifies the
PasswordPassword to access the
Exchange server.
Bold names are required properties.
string
name of the new profile you
want Document Distributor
to create,
name of an existing profile
that you want Document
Distributor to use. If no
name is specified,
Document Distributor looks
for a default profile in the
registry. See “About
Exchange profiles” on
page 75.
or it can be the
Methods
SyntaxDescription
bool Go()Executes the action. Returns TRUE or FALSE to
indicate if the action completed successfully.
void Reset()Clears the current properties and returns them to their
default values.
76
EmailNotes
Purpose: Sends e-mail to one or more recipients through a Lotus Notes mail server.
Install group: Lotus Notes Module
Prerequisites:
•The Lotus Notes client must be installed on the Document Server for this action to utilize the
Notes capabilities. The Notes client provides the underlying Notes security and settings for the
Document Server to interact with the Notes servers.
•A valid Notes user account/ID file for use by the Notes actions on the Document Server must
be provided. Notes administrators typically call the Notes IDs associated with a server
application (rather than a person) an application ID. This ID should not be
password-protected.
Note:If the ID file used by the Notes client has a password, this password must be shared
with 3rd party applications. To change this setting, inside the Notes client choose File
Tools User ID. On the dialog that appears, select "Share password with Notes
add-ins".
Properties:
NameDescriptionData typeAdditional information
ToList of e-mail addresses to
which this message is sent.
FromThe e-mail address of the
sender.
ccList of e-mail addresses to
which copies are sent.
bccList of e-mail addresses to
which blind copies are sent.
SubjectSubject of e-mail.string
MessageText string to use as the
message body.
AttachmentsAttachments can be:
• Original scanned document
• Output from a previous
action
DeliveryPriorityPriority of e-mail delivery.int
stringComma delimit to specify more than one
string
stringComma delimit to specify more than one
stringComma delimit to specify more than one
string
docTo attach multiple files, create a variable
(LDD
Constant)
recipient.
recipient.
recipient.
of type doc and call the doc object’s
AddFile() method to add the files to the
doc object before using it here.
bool Go()Executes the action. Returns TRUE or FALSE to
void Reset()Clears the current properties and returns them to their
indicate if the action completed successfully.
default values.
Notes:
•The e-mail addressescan be either Lotus Notes addresses or Internet e-mail addresses.
•Lotus Notes does not require values for To, From, cc, or bcc. However, a message must supply
a value for at least one of these properties.
79
EmailSMTP
Purpose: Send e-mail to one or more recipients by way of the specified Simple Mail Transfer Protocol
(SMTP) server.
Install Group: SMTP Module
Prerequisites: This action acts as an SMTP client and can only work with an SMTP server that does
not require a password. In other words, if the specified SMTP server only works in enhanced mode,
this action will not work.
Properties:
NameDescriptionData TypeAdditional information
ServerThe IP Address or DNS
hostname of the SMTP
server.
ToList of e-mail addresses to
which this message is sent.
FromThe e-mail address of the
sender.
ccList of e-mail addresses to
which copies are sent.
bccList of e-mail addresses to
which blind copies are sent.
ReplyToAddress to reply to if other
than the "From" field.
SenderThe e-mail address to send
any errors.
SubjectSubject for message.string
MessageText string to use as the
message body.
Bold names are required properties.
string
stringComma delimit to specify more than
stringSome SMTP servers require the
stringComma delimit to specify more than
stringComma delimit to specify more than
stringA secretary, for example, sending
string
string
one recipient.
From field to be a valid address
known by the SMTP server before it
will route mail.
one recipient.
one recipient.
e-mails for a manager.
80
NameDescriptionData TypeAdditional information
CharacterSetThe character set to use for
sending the message and
subject text.
AttachmentsAttachments can be an:
• Original scanned
document
• Output from a previous
action
Bold names are required properties.
int
(LDD
Constant)
docTo attach multiple files, create a
Val id Val u es:
LDD_SMTPCHARSET_US
LDD_SMTPCHARSET_WEUROPE
LDD_SMTPCHARSET_EEUROPE
LDD_SMTPCHARSET_SEUROPE
LDD_SMTPCHARSET_NEUROPE
LDD_SMTPCHARSET_CYRILLIC
LDD_SMTPCHARSET_ARABIC
LDD_SMTPCHARSET_GREEK
LDD_SMTPCHARSET_HEBREW
LDD_SMTPCHARSET_TURKISH
LDD_SMTPCHARSET_NORDIC
Default:
LDD_SMTPCHARSET_US
variable of type doc and call the doc
object’s AddFile() method to add the
files to the doc object before using it
here.
Methods
SyntaxDescription
bool Go()Executes the action. Returns TRUE or FALSE to
void Reset()Clears the current properties and returns them to their
indicate if the action completed successfully.
default values.
E-mail Addresses
This action supports both undecorated and decorated e-mail addresses. The following three examples
would send e-mail to the same address:
1jdoe@company.com
2John Doe <jdoe@company.com>
3"Doe, John" <jdoe@company.com>
The first example is undecorated and simply provides the e-mail address.
The second example is decorated; it is simply a phrase followed by the e-mail address in <>.
The third example is decorated but with special characters; therefore, the phrase must be in quotes
followed by the e-mail address in <>.
The decorated name is what appears in the e-mail client and provides a user-friendly look.
81
When using decorated e-mail addresses, it is important to note that only 7-bit ASCII characters are
allowed as part of the phrase. This means that accented characters and any other non-standard
characters that are valid in the subject and message fields (based on the specified character set)
cannot be used here.
Recipients and Senders
The following properties allow you to setup who will receive the e-mail:
•To —to whom the e-mail is being directly sent
•cc—to whom a copy of the e-mail is being sent
•bcc—to whom a copy of the e-mail is being secretly sent
While none of these properties are themselves required to have a value, at least one recipient must be
specified in one of them. Multiple addresses can be specified for any of them with each address
separated by a comma.
The following properties allow you to setup how the e-mail recipients view who sent the mail:
•From—specifies from whom the e-mail appears to be
•ReplyTo—if a recipient replies, specifies to whom the reply is sent
•Sender—specifies who is actually sending the e-mail; this is the address that any errors
encountered by the SMTP server will be sent
The From property is required and can contain one or more e-mail addresses.
The ReplyTo property is optional and can be set to one or more addresses; if omitted, the addresses in
the from list are used.
The Sender property is optional if only one address is specified in the from list; otherwise, if multiple
addresses are specified for the From property, it is required. When set, the Sender property can
contain only one address. If omitted, the Sender is set to the first (or only) address in the From list.
Example
A loan manager for a bank wants to send an e-mail to various locations to announce the new loan
rates. The following fragment shows on of the e-mails sent when this script is executed.
with EmailSMTP
.To = "^"Doe, John^" <jdoe@company.com>"
.From = "Jane Clark<jane@company.com>"
.ReplyTo = "Loan Rates <george@company.com>"
.Sender = "admin@company.com"
.Subject = "Rates Announcement"
.Message = "See the attached flyer for the new loan rates."
.Attachment = original.document
.Go()
endwith
In this fragment, the e-mail is being sent to John Doe. Notice how a decorated e-mail address is being
used; since it includes a special character (the comma), quotes are needed around the phrase. Since
quotes are necessary around LDDScript strings, the "^" is an escape sequence so that a quote can be
used in the string itself. The e-mail will be from Jane Clark the loan manager. If John Doe has a
question and replies to the e-mail, the reply will be sent to George; he is Jane's assistant and will take
care of any questions. If any errors occur and the e-mail can't be sent, a message will be sent to the
admin.
82
FaxByPrinter
Purpose: Faxes a document through a Lexmark printer with a fax-capable MarkNet™ print server.
Install group: Print Module
Prerequisites: A fax-enabled MarkNet print server.
Inputs: Encapsulated PostScript file (EPS) or PostScript file (PS), Black and White or 8-bit grayscale.
Properties
NameDescriptionData typeAdditional information
InputThe document to be faxed. docThe document must be in .EPS
or .PS format.
IPAddressThe IP address or DNS
hostname of the fax-equipped
printer.
string
FaxNumberThe phone number to which the
fax is sent.
StationIDThe station ID to be used for the
fax.
WaitForCompletionWait for the fax to complete
before continuing.
WaitTimeoutThe maximum number of
minutes to wait for the fax to
complete or error out.
Bold names are required properties.
string
string
boolIf set to TRUE, the Go method
will not return until the fax has
been successfully sent, the fax
returns an error, or the timeout
specified by WaitTimeout has
been reached. If set to FALSE,
the Go method returns
immediately after the fax
request is sent.
intThis setting is ignored if
WaitForCompletion is set to
FALSE. This value should allow
time for the initial request and
any retries.
Val id Valu es:
0 to 60
Default:
0
83
NameDescriptionData typeAdditional information
RedialMinutesIf the fax fails, the time in minutes
to wait before retrying.
RedialTimesThe number of times to retry the
fax.
Bold names are required properties.
Methods
intTo perform no retries, this value
should be set to 0. To use the
value set on the printer's web
page, use the LDD constant,
LDD_PRINTER_DEFAULT.
Val id Valu es:
0 to 9 or
LDD_PRINTER_DEFAULT
Default:
LDD_PRINTER_DEFAULT
intTo use the value set on the
printer's web page, use the LDD
constant,
LDD_PRINTER_DEFAULT.
Val id Valu es:
1 to 200 or
LDD_PRINTER_DEFAULT
Default:
LDD_PRINTER_DEFAULT
NameSyntaxDescription
Gobool Go()Executes the action. Returns TRUE
or FALSE to indicate if the action
completed successfully.
Resetvoid Reset()Clears the current properties and
returns them to their default values.
84
FTPget
Purpose: Retrieves a file from a specified FTP server.
Install group: Document Server
Prerequisites: None
Properties:
NameDescriptionData typeAdditional information
OutputThe document to which this action’s output
is written.
ServerAddressIP Address or DNS hostname of the FTP
server from which to retrieve the file.
UserNameThe user name used to log into the FTP
server.
PasswordThe password used to log into the FTP
server.
AccountThe account name to use if one is
required.
TransferModeThe mode used to transfer the requested
file.
doc
string
stringIf none is required, enter an
stringIf none is required, enter an
stringMost FTP servers do not
int
(LDD
Constant)
empty string.
Default:
anonymous
empty string.
Default:
anonymous
require an account to be
specified.
If the document is an image or
images, select
LDD_FTPMODE_BINARY
mode.
If the document is text, select
LDD_FTPMODE_ASCII mode.
Default:
LDD_FTPMODE_BINARY
SourcePathThe file to retrieve.stringIf no path is specified with the
Bold names are required properties.
filename, the file will be
retrieved from the user’s default
FTP directory. See “Sample
source path” on page 86.
Methods
NameSyntaxDescription
Gobool Go()Executes the action. Returns TRUE
Resetvoid Reset()Clears the current properties and
or FALSE to indicate if the action
completed successfully.
returns them to their default values.
85
Note:Due to differences between file systems, when transferring a file in ASCII mode, the size of
the new file may not be identical to the original file on the FTP server.
Sample source pathExplanation
/sample1.tifRetrieves the file "sample1.tif" from the root directory of the source computer
sample1.tifRetrieves the file "sample1.tif" from the user's default FTP directory
/zdir/sample1.tifRetrieves the file "sample1.tif" from the directory "zdir" that resides under the
myfile/sample1.tifRetrieves the file "sample1.tif" from the "myfile" subdirectory that resides
root directory of the source computer (not the user's default FTP directory).
under the user’s default FTP directory
86
FTPput
Purpose: Transfers a document to a specified FTP server.
Install group: Document Server
Prerequisites: None
Properties
NameDescriptionData typeAdditional information
InputDocument to transfer.doc
ServerAddressIP Address or DNS hostname of
the FTP server to which the
document is to be transferred.
UserNameThe user name used to log into
the FTP server.
PasswordThe password used to log into the
FTP server.
DestinationPathThe fully-qualified path name for
the file transferred to the FTP
server.
AccountThe account name to use if one is
required.
AppendTimeStampAppends a time stamp containing
the year, month, day, and time of
day to the filename so that files
with the same name will not be
overwritten.
string
stringIf none is required, enter an
empty string.
Default:
anonymous
stringIf none is required, enter an
empty string.
Default:
anonymous
stringIf the value only contains a
filename, the file will be stored
in the users’ default FTP
directory. See “Sample
destination path” on page 88.
stringMost FTP servers do not
require an account to be
specified.
boolThe reserved variable
original.usertime is used for the
timestamp.
Default:
TRUE
CreateDirectoryCreates the path specified in the
"DestinationPath" parameter if it
does not already exist.
Bold names are required properties.
87
boolIf value is FALSE and the
specified directory does not
exist, the action will fail.
Default:
FALS E
NameDescriptionData typeAdditional information
TransferModeThe mode used to transfer the
document.
OverwriteOverwrites the previous FTP fileboolDefault:
Bold names are required properties.
int
(LDD Constant)
If the document is an image,
select
LDD_FTPMODE_BINARY
mode.
If the document is text, select
LDD_FTPMODE_ASCII mode.
Default:
LDD_FTPMODE_BINARY
TRUE
Methods
NameSyntaxDescription
Gobool Go()Executes the action. Returns TRUE
Resetvoid Reset()Clears the current properties and
or FALSE to indicate if the action
completed successfully.
returns them to their default values.
Note:If a document contains multiple files, the files created on the FTP server will have a number
appended after the file extension and before the time stamp (if a time stamp was requested)
in order to create a unique filename. Due to differences between file systems, when
transferring a file in ASCII mode, the size of the new file on the FTP server may not be
identical to the size of the original file.
Sample destination pathExplanation
/sample1.tifPlaces the file "sample1.tif" into the root directory of the destination
computer.
sample1.tifPlaces the file "sample1.tif" into the user's default FTP directory under
the name "sample1.tif".
/zdir/sample1.tifPlaces the file "sample1.tif" into the directory "zdir" that resides under the
root directory of the destination computer (not the user's default FTP
directory).
88
GroupWise Actions
Prerequisites:
•The necessary NetWare connectivity must be available to the host machine. This includes any
necessary drivers for the LDD server to connect to a NetWare server. Check the Properties in
your Network Neighborhood to ensure the required gateways and protocols were installed
when you installed GroupWise. The module uses any available protocol, and is not limited to
TCP/IP.
•NetWare client software must also be installed. In particular, the server must have the Novell
Client for Windows NT, Windows 2000, or Windows XP installed. The client must be
compatible with the version of NetWare running on the GroupWise host. At the bare minimum,
the client must be configured to point to a NetWare server with a specific tree and context. See
the Advanced settings in the Novell Client dialog box.
•The Novell GroupWise client for Windows must also be installed on the server machine. If the
GroupWise application may be started from the icon on the server machine without requiring
any other user input other than a user name and password, the setup is correct.
•The GroupWise version must be at least version 6.
•Depending on your preferred GroupWise configuration, you may require the Document Server
to log on as a particular user on startup. This may be set in the Services control panel applet
(located under Administrative Tools on Windows 2000). This enables the GroupWise module
to retrieve any necessary NetWare setup from the Windows user-level settings in the Registry.
Desktop interaction should not be necessary. The GroupWise client does not need to be
running. It is strongly advised that any interactive components of GroupWise, such as the
Notify application, be disabled on the server machine.
Configuration options
The GroupWise module may be used in three possible ways:
1Each call to GroupWise requires a user name and password to log on. Different calls may log
on as different users.
2Each call to GroupWise requires a logon using the same user name and password, but the
logon may proxy as another user. Proxying does not require a password, but requires the
proxy target to grant suitable access rights.
3Each call to GroupWise logs on using system-level defaults specified in the Novell Client or in
the GroupWise startup. There is no need for each script to specifically specify a logon name or
password. Proxy log on is available.
Tip: The third way is recommended. In particular, it is suggested that a dedicated GroupWise account
is created for the Document Distributor. To allow LDD to act on behalf of other users, the GroupWise
administrator or the users themselves should set up LDD to act as a proxy. Such proxy logons do not
require the user passwords to be exposed to LDD, and the LDD account logon may be setup as a
system-level default. This method allows the GroupWise administrator, rather than the Document
Server administrator to control security.
For more details on any of these prerequisites, consult the GroupWise Administrator, NetWare
Administrator, Novell Client, or GroupWise online Help.
89
GWMail
Purpose: Send mail using GroupWise.
Results: Mail may be sent to one or more recipients with or without file attachments in several formats.
There is control over message dispensation, priority, notification, and security.
Properties:
NameDescriptionData TypeAdditional information
RootAccountThe user ID for the
module to log on by way
of the Novell Client for
Windows.
stringThis is not necessarily the same as the
GroupWise user name. If not specified,
the system is searched for a suitable
default.
RootPasswordThe password for Novell
Client logon.
ProxyAccountThe proxy account, under
which the module
performs all its
GroupWise
manipulations.
ToList of e-mail addresses
to which this message is
sent.
FromThe e-mail address of the
sender.
stringIf not specified, the system is searched
for a suitable default.
stringThe account name specified here must
be a GroupWise account name and
must appear in the GroupWise System
Address Book. Name completion is
performed by GroupWise if necessary.
The user who is to be proxied, or the
GroupWise administrator, must have
provided suitable proxy access rights to
the logon specified by the root account.
If not specified, all GroupWise
manipulations take place under the root
account.
stringThe list may be comma-delimited, as
with other LDD mail modules, or it may
be semicolon-delimited as in the
GroupWise client. Addresses are
resolved against the sender’s address
books, including name completion.
External addresses such as SMTP and
MAPI will also function, if the
GroupWise server has such support.
Note: At least one recipient must be
specified in the To, From, cc, or bcc
fields.
stringThe proxied or root user’s name is
always appended to this field – it is not
possible to fraudulently set a From
address using this method. The default
is not to decorate the From address. A
suitable entry in this field could be
"Sent by LDD on behalf of" or similar
decoration.
ccList of e-mail addresses
to which copies are sent.
Bold names are required properties.
stringAs with the To field, the list may be
comma- or semicolon-delimited and
may include any addresses resolvable
through address books or external
GroupWise server connections.
90
NameDescriptionData TypeAdditional information
bccList of e-mail addresses
to which blind copies are
sent.
SubjectThe subject line of this
mail.
MessageThe message content of
this mail.
MessageFormatThe format in which the
ASCII message is
encoded.
AttachmentsThe file attachments to
append to this message.
ConvertAttachmentsSpecifies whether or not
the GroupWise post
office should change
attachments to forms that
are viewable within
GroupWise itself.
stringNo other recipients can see this
string
stringThe message body is subject to a
int
(LDD Constant)
docTo attach multiple files, create a
boolThe default is FALSE, which transmits
recipient in their received mail. The
same conditions apply as with the To
and cc fields.
GroupWise limitation of approximately
32,000 characters.
Valid values:
LDD_GWMSGTYPE_PLAINTEXT
LDD_GWMSGTYPE_RICHTEXT
Default:
LDD_GWMSGTYPE_PLAINTEXT
variable of type doc and call the doc
object’s AddFile () method to add the
files to the doc object before using it
here.
any attachments in their original format
as sent by LDD, and may require
recipients to use an external application
to view them. Setting this to TRUE
gives the post office the right to change
the attachment formats to forms that
are viewable within GroupWise itself.
Such modification may change file
format or compression, and is not
guaranteed to preserve formatting
codes or graphical detail. Consult your
post office administrator for details of
these conversions.
PriorityThe priority assigned to
this message.
PrivateSpecifies whether or not
this message is hidden
from proxy users and is
only viewable by the
intended recipient.
Bold names are required properties.
int
(LDD Constant)
boolRelevant only for GroupWise
This applies wherever possible
depending on the transport mechanism
used to send the mail. For GroupWise
destinations, the priority is denoted by
icon color in the recipients’ Inbox.
Valid values:
LDD_PRIORITY_LOW
LDD_PRIORITY_NORMAL
LDD_PRIORITY_HIGH
Default:
LDD_PRIORITY_NORMAL
destinations.
Default:
FALSE
91
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.