Lexmark X925 Lexmark Document Distributor - Page 32

Using the PrintClass service with forms merge scripts, Printing forms on printers with forms cards - printer supplies

Page 32 highlights

Developing workflow solutions 32 throw e; } } Using the PrintClass service with forms merge scripts As in all scripts, you can use the PrintClass service to send a document to a printer. Two fields are particularly important when using PrintClass in a forms merge script: • nativeSpooling-Normally, the destination printer is identified by its IP address, but input data for a forms merge may contain the name of the output queue. Set this field to true, to identify the printer by queue name instead of by IP address. • optionMode-This field should always be set to PrintClass.OPTION_MODE_IGNORE to make sure print settings from the form are used instead of settings that may be defined using PrintClass. Printing forms on printers with forms cards If you have printers with forms cards, you can choose to print forms using a dataset, an XML list of key‑value pairs that represent input data. Most of the information about the final output form is stored on the forms card, and only the dataset is sent to the printer. Because less data is transferred over the network, use of datasets may provide better performance with limited network bandwidth. To use a dataset, define mergeContext.endDataSet in main(), and then use the function assigned to the field to send the dataset to the printer. Using scheduled scripts Scheduled scripts can be created to assist with system maintenance. Since scheduled scripts are launched by the LDD system itself rather than a printer or software client, they cannot use objects that require user intervention, such as prompt objects and scan methods. You can use auto‑configure methods for making changes to the LDD system in scheduled scripts if the caller object is assigned as follows: var caller = context.getObject("autoconfigUtilities") You can also access an Additional Options field that an administrator can populate with free‑form text when scheduling the task in LMC. You should provide the LDD administrator with documentation on any values that the script expects in the field. Scripts access the value supplied by the administrator using the field taskInfo.additionalOptions. To create a scheduled script, create a new script in the src\scripts\scheduled\ folder. For more information about adding scheduled scripts in LMC, see the Lexmark Document Distributor Administrator's Guide. Examples of scheduled scripts can be found in the TestMFP and TestSNS example templates.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82

throw e;
}
}
Using the PrintClass service with forms merge scripts
As in all scripts, you can use the
PrintClass
service to send a document to a printer.
Two fields are particularly important when using
PrintClass
in a forms merge script:
nativeSpooling
—Normally, the destination printer is identified by its IP address, but input data for a forms
merge may contain the name of the output queue. Set this field to
true
, to identify the printer by queue name
instead of by IP address.
optionMode
—This field should always be set to
PrintClass.OPTION_MODE_IGNORE
to make sure print
settings from the form are used instead of settings that may be defined using
PrintClass
.
Printing forms on printers with forms cards
If you have printers with forms cards, you can choose to print forms using a dataset, an XML list of key
value pairs that
represent input data. Most of the information about the final output form is stored on the forms card, and only the
dataset is sent to the printer. Because less data is transferred over the network, use of datasets may provide better
performance with limited network bandwidth.
To use a dataset, define
mergeContext.endDataSet
in
main()
, and then use the function assigned to the field
to send the dataset to the printer.
Using scheduled scripts
Scheduled scripts can be created to assist with system maintenance. Since scheduled scripts are launched by the LDD
system itself rather than a printer or software client, they cannot use objects that require user intervention, such as
prompt objects and scan methods.
You can use auto
configure methods for making changes to the LDD system in scheduled scripts if the
caller
object
is assigned as follows:
var caller = context.getObject("autoconfigUtilities")
You can also access an Additional Options field that an administrator can populate with free
form text when scheduling
the task in LMC. You should provide the LDD administrator with documentation on any values that the script expects
in the field. Scripts access the value supplied by the administrator using the field
taskInfo.additionalOptions
.
To create a scheduled script, create a new script in the src\scripts\scheduled\ folder.
For more information about adding scheduled scripts in LMC, see the
Lexmark Document Distributor Administrator's
Guide
.
Examples of scheduled scripts can be found in the TestMFP and TestSNS example templates.
Developing workflow solutions
32