# \*WINDEV\* Raw Print Mode

> Source: https://manual.pvxplus.com/file-handling/windev

## Formats

|  |  |  |
| --- | --- | --- |
| 1\. | [Open Device File](https://manual.pvxplus.com/file-handling/windev#Mark7)*:* | OPEN (*chan*\[,*fileopt*\])"\*WINDEV\*\[;*Q_name*\]" |
| 2\. | [Open for Read-Only Mode](https://manual.pvxplus.com/file-handling/windev#Mark9): | OPEN INPUT (*chan*\[,*fileopt*\])"\*WINDEV\*\[;*Q_name*\]" |
| 3\. | [Open for \[WDX\]](https://manual.pvxplus.com/file-handling/windev#Mark12): | OPEN \[INPUT\] (*chan*\[,*fileopt*\])"\[WDX\]\*WINDEV\*\[;*Q_name*\]" |

***Where:***

|  |  |
| --- | --- |
| *chan* | Channel or logical file number (e.g. open (1)"\*windev\*"). |
| *fileopt* | File options. Supported options for opening **\*WINDEV\*** include:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| **ERR**=*stmtref* \| Error transfer \|<br>\| **OPT**=*char$* \| File Open options \|<br>See **[About File OPEN Options](https://manual.pvxplus.com/directives/open#Mark5)** for the **OPEN** directive.<br>To obtain the current **OPT=** value, use the [OPT( )](https://manual.pvxplus.com/functions/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.)<br>Valid *Q_name* options include:<br>\|  \|<br>\| --- \|<br>\| - OS name of an existing physical print queue on the local Windows machine:  <br>    <br>   open (14)"\*WINDEV\*;HP LaserJet" \|<br>\| - OS name of print queue **ON** resource (UNC, format: **ON**\\\\machine\\resource for any shared resource or **ON*lpt***# for direct local access to a port):  <br>    <br>   open (14)"\*WINDEV\*;HPLaserJetON\\\\Main_Server\\P Laser"  <br>   open (14)"\*WINDEV\*;LP ON LPT1" \|<br>\| - One of the following queue selection keywords:<br>**ASIS**<br>Most recently selected printer and properties<br>**DEFAULT**<br>Printer currently "Set As Default" in the system (e.g. open (30,err=9900)"\*WINPRT\*;DEFAULT")<br>**NORMAL**<br>Normal dialogue with page range (no paper size, source tray)<br>**SETUP**<br>Setup dialogue with paper size, source tray (no page range) \|<br>The *Q_name* is optional. **\*WINDEV\*** does not support setting queue options (graphical printer properties in the Windows ***Printer*** dialogue box such as ORIENTATION=landscape;copies=3).<br>See **[\*WINPRT\* / \*WINDEV\* Queues](https://manual.pvxplus.com/file-handling/winprt-windev-queues)**. |
| **\[WDX\]** | **\*WINDEV\*** is specific to Windows operating systems. Under UNIX, PxPlus automatically directs **\*WINDEV\*** access to the WindX client:<br>open (14)"\*windev\*" ! For the PC client from UNIX host  <br>  <br>In a Windows NT environment, the **\*WINDEV\*** printer is opened relative to the host unless you prefix the printer name with **\[WDX\]**:<br>```<br>open (14)"*windev*" ! For the NT host<br>open (14)"[WDX]*windev*" ! For the NT PC client<br>``` |
| **\*WINDEV\*** | Keyword, not case sensitive. Special device filename, enclosed in quotation marks within the **[OPEN](https://manual.pvxplus.com/directives/open)** directive. (Include **\*** *asterisks* in syntax) |

## Description

Note:  
\*WINDEV\* is supported for use in *WindX* or *Windows only*.

Use **\*WINDEV\*** with your **OPEN** and/or **OPEN INPUT** directives to gain access to the Windows print subsystem in ***raw*** or ***pass-through*** mode. For standard API access, use [\*WINPRT\* Windows Printing](https://manual.pvxplus.com/file-handling/winprt).

You can identify the LPT for direct local access to the port or use UNCs (Universal Naming Conventions) for transmissions to a shared resource. For both LPT and UNC use, note that you can use raw escape sequences but graphical printing is not supported. LPT identification is not recommended under Windows NT.

Normally, you can take advantage of **\*WINDEV\*** to send data to the printer without having the driver strip out escape codes (for instance, to pass PCL code to the printer). That is, you ***can*** use escape sequences with **\*WINDEV\***, but these must be both valid and supported by your given printer and print driver.

PxPlus recognizes **\*WINDEV\*** 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".)

***Raw Printing Behavior***

PxPlus supports ***raw*** mode to send raw data to a Windows printer. You can control raw printing mode using the ['RP'](https://manual.pvxplus.com/parameters/rp) system parameter. This parameter's default is **ON**. When you turn it **OFF**, PxPlus uses the old ***pass through*** mode.

The printer drivers should not (but might) strip escape sequences from the data you send to **\*WINDEV\***. Support for raw mode is printer and driver-dependent. Some drivers can destroy certain escape sequences (removing them from the data stream). If escape sequences disappear from your **\*WINDEV\*** print jobs, check the sequences for validity and check printer/driver appetites with their manufacturers.

Note:  
Attempting to issue any form of graphical mnemonic to a raw printer connection (\*WINDEV\*) will result in an Error #13: File access mode invalid.

## Format 1

***Open Device File***

OPEN (*chan*\[,*fileopt*\])"\*WINDEV\*\[;*Q_name*\]"

Use this format to open the **\*WINDEV\*** device file to pass print jobs through in raw mode to the given queue on your open channel. See **[\*WINPRT\* / \*WINDEV\* Printing Examples](https://manual.pvxplus.com/file-handling/winprt-windev-printing)**.

Note:  
Some device drivers issue an extra blank page (some even hang) if an open channel is closed too quickly or if nothing is printed to the channel before it is closed. Use the [OPEN INPUT](https://manual.pvxplus.com/directives/open) directive to bypass problems of this nature.

## Format 2

***Open for Read-Only Mode***

OPEN INPUT (*chan*\[,*fileopt*\])"\*WINDEV\*\[;*Q_name*\]"

Use the **[OPEN INPUT](https://manual.pvxplus.com/directives/open)** directive to open **\*WINDEV\*** in read-only mode when you only want to determine the name and properties of a printer without sending a physical job. With an **OPEN INPUT** directive, you can open the printer, query the printer's properties, and close the channel without starting a physical job.

***Example:***

Use the **[WINPRT_SETUP READ PROPERTIES](https://manual.pvxplus.com/directives/winprt-setup)** directive or the **[MXC( ) / MXL( )](https://manual.pvxplus.com/functions/mxc)** functions without generating a Form Feed:

```
if WDX%<>$00$ then open input (30)"*WINDEV*;ASIS"
C=mxc(30)+1 ! Zero-based. For this printer mxc(30)=79, C=80 (0-79 columns)
L=mxl(30)+1 ! Also zero-based
winprt_setup read properties WHAT_PROP$
! WHAT_PROP$ returns printer-specific list (items such as COPIES=1, OFFSET=0:0)
```

Note:  
The ['FONT'](https://manual.pvxplus.com/mnemonics/font) mnemonic works with \*WINPRT\*, but not with any of the text-mode printers. To control fonts on a text mode device, send raw escape sequences to the printer using \*WINDEV\*, UNC (Universal Naming Conventions), or direct access to LPT ports. Your choice of fonts via \*WINDEV\*, UNC or LPT is limited to the fonts supported by the given printer.

## Format 3

***Open for \[WDX\]***

OPEN \[INPUT\] (*chan*\[,*fileopt*\])"\[WDX\]\*WINDEV\*\[;*Q_name*\]"

On an NT or PC server, if you include **\[WDX\]** in your **OPEN \[INPUT\]** directive (e.g. open (30)"\[WDX\]\*WINDEV\*"), then 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 **\*WINDEV\*** 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.

Note:  
You must install and use WindX to use \*WINDEV\* in a UNIX environment; however, you do not need the \[WDX\] tag on a UNIX server because PxPlus automatically directs \*WINDEV\* access to your WindX client PC.

## See Also

[WINPRT_SETUP Windows Printer Setup](https://manual.pvxplus.com/directives/winprt-setup)  
**[MXC( ) / MXL( ) Return Maximum Column/Line](https://manual.pvxplus.com/functions/mxc)**  
[\*WINPRT\* / \*WINDEV\* Printing Examples](https://manual.pvxplus.com/file-handling/winprt-windev-printing)  
[\[WDX\] Direct Action to Client Machine](https://manual.pvxplus.com/command-tags/wdx)
