Description
The TEXTRTF message is used to send Rich Text Format (RTF) text to the printer.
Parameters
Parameter | Description of Fields | Comments | Default |
---|---|---|---|
Parm1 – TextRTF | <1> TextRTF | RTF text | "" |
See also
TEXT Set_Printer message
Remarks
In order to place colors or anything that is a not single font and its simple attributes (bold, italic, underline), you need to provide the RTF header yourself in the code. The easiest way to do this is to create a document in WordPad, save it, open it in Notepad and copy the code into your Basic+ code. (See the below example).
Example
/* The following example shows how to use the TEXTRTF message to bold text in the middle of a paragraph. */ declare function Set_Printer stat = Set_Printer("INIT") ;* Start printing stat = Set_Printer("TEXTRTF", "This is a {\b simple} RTF test.") stat = Set_Printer("TERM") ;* End printing
Example 2
/* using RTF headers */ this = '{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}{\f1\fmodern\fprq1\fcharset0 Courier New;}{\f2\fswiss\fprq2\fcharset0 Arial;}}' this: = '{\colortbl ;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;}' this: = '{\*\generator Msftedit 5.41.15.1503;}\viewkind4\uc1\pard\b\f0\fs20 Hello.\b0 This is Arial and this is \f1 Courier.\par' this: = '\f2 This is \cf1 red\cf0 , \cf2 green\cf0 and \cf3 blue\cf0 .\par' this: = '\i OpenInsight OIPI TEXTRTF example.\i0\f0\par}' stat = Set_printer("TEXTRTF",this)