PSSetPrinter()

Syntax

Function PSSetPrinter(nPrinter)
TPageScript:SetPrinter(nPrinter)

Returns

The previous selected printer.

Description

Call PSSetPrinter() to set the printer to use for the next print job. If you want to select the default printer, pass 0 as the printer number. You may use PSGetPrinters() to get the list of all available printers. Select the printer before calling any PageScript function that query a printer's capability such as paper trays, paper sizes, fonts and so on. Call this procedure before starting a new document.

Arguments

nPrinter Printer must be in the range of 0 to PSGetPrinterCount()