*WINPRT* |
Windows Printing |
1. |
OPEN (chan[,fileopt])"*WINPRT*[;Q_name[Q_options]" | |
2. |
OPEN INPUT (chan[,fileopt])"*WINPRT*[;Q_name[Q_options]" | |
3. |
OPEN [INPUT] (chan[,fileopt])"[WDX]*WINPRT*[;Q_name[Q_options]" |
chan |
Channel or logical file number (e.g. open (1)"*winprt*"). | |||||||||||||||
fileopt |
File options. Supported options for opening *WINPRT* include:
See About File OPEN Options for the OPEN directive. To obtain the current OPT= value, use the OPT( ) function. | |||||||||||||||
Q_name |
Print queue to open. (If you omit the queue name, a printer selection dialogue appears at run time to let the user select the printer and its properties.)
While the Q_name is optional, it is mandatory in directives if you want to assign or override queue properties (Q_options below). See *WINPRT* / *WINDEV* Queues. | |||||||||||||||
Q_options |
Override printer properties. String expressions. You can override printer and driver specific values by assigning a new value to the queue (e.g. copies=2 instead of copies=1). Example: | |||||||||||||||
*WINPRT* is specific to Windows operating systems. Under UNIX, PxPlus automatically directs *WINPRT* access to the WindX client: open (14)"*winprt*" ! For the NT host The *WINPRT* Keyword is not case sensitive. Special device filename, enclosed in quotation marks within the OPEN directive. (Include * asterisks in syntax) |
Use *WINPRT* with your OPEN and/or OPEN INPUT directives to gain standard API access to the Windows print subsystem. For raw or pass-through mode, use *WINDEV* Raw Print Mode.
The device driver for your given printer interprets the data you send to the *WINPRT* channel and then sends the output to the Windows spooling subsystem for transmission to its destination. You can identify the LPT for direct local access to the port or use UNCs (Universal Naming Conventions) for transmissions to a shared resource. LPT identification is not recommended under Windows NT.
PxPlus recognizes *WINPRT* as a special device file in your OPEN [INPUT] directive and deals with it internally in the language at run time. PxPlus returns an Error #12: File does not exist (or already exists) on the OPEN if no printers are installed or if the user selects the Cancel button in a printer selection dialogue. (This error can also occur if no printer is "Set As Default".)
Some printer device drivers are unable to handle invalid Q_options; i.e. unknown property assignments and/or syntax errors (e.g. range=1,5 instead of the correct range=1:5). The result can be unpredictable. The driver can even cause your PxPlus session to hang during the open. If you encounter unexpected problems, invalid Q_options for the given driver are the likely cause.
OPEN (chan[,fileopt])"*WINPRT*[;Q_name[Q_options]"
Use this format to open the *WINPRT* device file. PxPlus will recognize and deal with this special device file at run time to give you access to the Windows print subsystem. Then you can send print jobs to the given queue on your open channel.
See *WINPRT* / *WINDEV* Printing Examples.
OPEN INPUT (chan[,fileopt])"*WINPRT*[;Q_name[Q_options]"
Use the OPEN INPUT directive to open *WINPRT* in read-only mode when you only want to determine the properties (Q_options) of a printer without sending a physical job. With an OPEN INPUT directive, you can open the printer, process your queries, and close the channel without starting a physical job.
Use the WINPRT_SETUP READ PROPERTIES directive, a 'FONT'(LIST) graphics mnemonic or the MXC( ) / MXL( ) functions without generating a Form Feed:
if WDX%<>$00$ then open input (30)"*WINPRT*;ASIS"
X$='font'(list*,30) ! Get font list
?X$
System,Fixedsys,Terminal,MS Serif,MS Sans Serif,Courier,Symbol,Small Fonts,Modern,FrameMakerSmallFont,Marlett,Arial,CourierNew,Times New Roman, ... etc.
Maximum column and line values are zero-based. In the following example, the MXC( ) value returned is 79, for 0-79 = 80 columns:
C=mxc(30)+1 ! For this printer MXC(30) returns 79, C=80 (0-79)
L=mxl(30)+1 ! For this printer MXL(30) returns 55, L=56 (0-55)
Your string variable in reading properties returns a printer-specific list (in the following example, it is for the ASIS printer):
winprt_setup read properties WHAT_PROP$
?WHAT_PROP$
RANGE=ALL;COLLATE=NO;COPIES=1;ORIENTATION=PORTRAIT;PAPERSIZE=1;SOURCE=1;RESOLUTION=300:300;OFFSET=0:0;TRUETYPE=2;DRIVER=WINSPOOL
close (30)
OPEN [INPUT] (chan[,fileopt])"[WDX]*WINPRT*[;Q_name[Q_options]"
On an NT or PC server, if you include [WDX] in your OPEN [INPUT] directive (e.g. open (30)"[WDX]*WINPRT*"), that signals PxPlus to direct any print jobs and dialogues to the WindX client PC, which will in turn use its Windows print subsystem to send jobs to the given printer.
If you are using *WINPRT* on an NT Server and do not use [WDX] in your OPEN directive, then the printer selection dialogue will appear on the server console, and any print queue you name directly must exist on the NT server in the Control Panel Printers folder.
WINPRT_SETUP Windows Printer Setup
MXC( ) / MXL( ) Return Maximum Column/Line
'FONT' Define/List Fonts
'TEXT' Draw Text
*WINPRT* / *WINDEV* Printing Examples
[WDX] Direct Action to Client Machine