PRINTFILE()

From Recital Documentation Wiki
Jump to: navigation, search

Purpose

Used to provide client-side printing for Windows Recital Mirage clients


Syntax

PRINTFILE(<expC1>[,<expC2> [ , <expC3> ] ] )


See Also

SET PRINTER, GETENV()


Description

The PRINTFILE() function is used to provide client-side printing for Windows Recital Mirage clients. When the PRINTFILE() function is called, the Windows Print Dialog will be displayed allowing the user to select a printer before printing the specified file.


Keyword Description
<expC1> The full path name of the file to be printed. The <expC1> can also contain printing options. See below for available options
<expC2> Optional header text to be displayed on each page of the printout.
<expC3> Optional footer text to be displayed on each page of the printout.


Printing options are separated from the file name by a question mark '?' and have an option=value syntax. The second and subsequent options must be preceded by an ampersand '&'. The options can include the following:


Option Description
autoNumber If set to true, the file printout will include line numbers.
bottomMargin Bottom margin in pixels.
font Font definition, e.g. font=Helvetica,plain,10
fontBold If set to true, font will be bold.
fontItalic If set to true, font will be italic.
fontSize Font size.
leftMargin Left margin in pixels.
tabs Number of spaces per tab.
topMargin Top margin in pixels.


Header and footer text is made up of three comma-separated sections. Text preceding the first comma is printed left justified on the page. Text following the first comma (and preceding the second) is printed centered on the page. Text following the second comma is printed right justified on the page. The header and footer text can also contain special options:


Option Description
{DATE} Replaced in the header or footer text with the current system date.
{FILE} Replaced in the header or footer text with the file name.
{PAGE} Replaced in the header or footer text with the current page number.


If "&printfile('%s')" is placed in the Recital Mirage Server DB_PRINT environment variable, then SET PRINTER TO \\SPOOLER will automatically print the spooled file to a client-side printer after displaying the Windows Print Dialog allowing the user to select the printer that they want to print on.

putenv("DB_PRINT","&printfile('%s')")


Example

printFile("c:\Program files\Recital\UAS\Mirage\Mirage_demo\mirage_demo.prg" + ;
"?tabs=4&topMargin=50&autoNumber=true",;
"{FILE},,{DATE}",",-- Page {PAGE} --,")


Products

Recital Mirage