Print Text
Verb: printRawString
Prints text on a specific printer.
Syntax
printRawString --text(String) [--selectPrinter(Boolean)] --printer(String) (Boolean)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--text | Text | Required | Text | Text that should be printed. |
--selectPrinter | Select Printer | Optional | Boolean | When enabled, the name of the printer responsible for printing the text is informed. |
--printer | Printer Name | Only whenSelect Printer is True | Text | Name of the printer that should be set as the system default.
The printer name is changed according to the printers available on the machine where the command is executed. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Success(Obsolete) | Boolean | Returns "True" if the print is successful, or "False" otherwise. |
Example
The Print Text command prints the text imported by the Import Asset command, using a standard printer obtained with Get Default Printer. At the end, printing success is returned.
import --name printText --type "File" --content VGVzdGUgZGUgaW1wcmVzc+NvIHBhcmEgbyBjb21hbmRvICJJbXByaW1pciBUZXh0byIu --extension ".txt"
defVar --name success --type Boolean
defVar --name printer --type String
defVar --name filePath --type String
export --asset "${asset.printText}" filePath=value
// Get the default printer.
getDefaultPrinter printer=value
// Print the text.
printRawString --text "${filePath}" --selectPrinter --printer "${printer}" success=value
logMessage --message "${success}" --type "Info"
// Returns the success of the impression.