revPrintText | ||||||||||||||||
Type | command | |||||||||||||||
Dictionary | LCS | |||||||||||||||
Library | LiveCode Script | |||||||||||||||
Syntax |
| |||||||||||||||
Associations | printing library | |||||||||||||||
Summary | Prints formatted or unformatted text. | |||||||||||||||
Introduced | 1.0 | |||||||||||||||
Changes | The fieldTemplate parameter was added in version 2.0. | |||||||||||||||
OS | mac, windows, linux | |||||||||||||||
Platforms | desktop | |||||||||||||||
Parameters |
| |||||||||||||||
Example |
| |||||||||||||||
Related | Property: textStyle, properties, HTMLText, textFont, textSize Message: startup, openBackground, preOpenStack, openStack, preOpenCard Library: Printing library, library Keyword: field Glossary: LiveCode custom library, application, standalone application, evaluate, property, text, execute, HTML, command, object reference, expression, main stack, group, Standalone Application Settings, message, parameter, statement, handler Function: platform Command: revPrintReport, answer printer, revPrintField Object: field | |||||||||||||||
Security | printing | |||||||||||||||
Description | Use the revPrintText command to print any text from within a handler.
Instead, use a form that evaluates to a field reference, like this:
The revPrintText command can be used to print either formatted text (via the htmlText property's format) or plain text. If you are generating formatted text, see the htmlText property for a description of the differences between the htmlText property's formatting and standard HTML. If the textToPrint, headerText, or footerText contains <p> or a start/end tag pair, the revPrintText command assumes the text is in the same format as the htmlText property. Otherwise, the revPrintText command assumes the text is plain text. If the text being printed is plain text, and a fieldTemplate is specified, the text is printed with that field's textFont, textSize, and textStyle. Otherwise, the text is printed in plain 12-point, with the default font of the platform being used. (The field specified in the fieldTemplate does not need to contain any text; only its appearance properties are used, not its contents. If you want to print the contents of the field, use the revPrintField command instead.) If the textToPrint, headerText, or footerText contains any expressions of the form <%expression%>, the expression is evaluated and replaced with the value before the text is printed. For example, if the textToPrint contains the text Today's date is <%the long date%> the printed text reads Today's date is Friday, February 15, 2002 (assuming, of course, that the revPrintText command is executed on that date). You can also use the special values <%pageNumber%> and <%numPages%> in the textToPrint, headerText, or footerText. These expressions are replaced with the current page number or total number of pages respectively. The headerText and footerText can contain up to two tab characters:
If the headerText or footerText contain more than two tab characters, everything after the third tab is ignored. To show the standard print dialog box, use the revShowPrintDialog command before the revPrintText command.
| |||||||||||||||
Tags | printing |