| Special File Handling |
|
This section provides some general printing information, tips, and examples for using both *WINDEV* and *WINPRT* special device files. |
||||||
| Abort | You
can abort a print job at any time by printing the
mnemonic 'AB' to the printer channel. Example:
|
|||||
| *Note* | How
much data prints when you abort is determined by the
printer driver, the Windows print spooling subsystem, and
your setting in the print spooler options "Start
Printing After the First Page" |
|||||
| Look for the name (title bar caption) of your current ProvideX window to find your print job in the Windows print spooler job listing. | ||||||
| Initial Settings | Before
you print data to the *WINDEV* and *WINPRT*
special device files, you should always set the initial
font and point size of the printer to a known state and
make it the default (using the 'DEFAULT' or 'DF'
Mnemonic). Example:
We suggest that you use
negative sizes to define specific point sizes (e.g.,
PRINT |
|||||
| Point Size | = Logical LPI | = Logical CPI | ||||
| -12 | =6 LPI | =10 CPI | ||||
| -10 | =7.2 LPI | =12 CPI | ||||
| -7 | =10 LPI | =16 CPI | ||||
| Column and row addressing are based on the default font. Switching fonts will not alter the column or row addressing. You can use the 'CPI' Mnemonic, and 'LPI' Mnemonic, to simplify text alignment. The following example scales the text to allow for 200 characters across but addresses the page based on 132 characters.
|
||||||
| Text Mode, Fixed Pitch Font | The
example below uses a fixed-pitch font for text mode
printing (e.g., for report printing). The application
adjusts the font to allow for the number of columns in
COLS_REQD. The MXC( ) and MXL( )
functions return maximum available column and line for
the channel, based on the current default settings for
paper size, printable area, offset, margin, default font
height, width, pitch. Example:
This method of printing
works with any Windows printer, with no adjustments
necessary for legacy code. 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. Note that
your choice of fonts with *WINDEV*, UNC,
or an LPT number is limited to the fonts supported by the
given printer. |
|||||
| Text Mode, Proportional Font | Proportional
fonts are supported using *WINPRT* and
can be scaled to fit the page. You can print fields
individually for proper alignment. That is, use the
@(col) position for each element or field. A dimensioned
string like DIM X$(80);
X$(1)="Customer",X$(46)=" Balance"
would not be properly aligned. ProvideX left-justifies
any string variable at the specified column based on the
default font. Decimal alignment is supported for the STR(
) function or format masks. Numeric variables
print right-justified with decimal alignment, provided a
format mask is used.
You can use text justification mnemonics to override the normal handling of string and numeric data. Normally, these mnemonics are required only when the individual fields are grouped into a single variable which is being sent to a printer using a proportionally spaced font.
You can use the '+S' mnemonic to automatically replace the underscore, dash and equals sign ( _ - and =) with solid underlines. The solid line technique also only applies to fields that are printed separately. See also '+S' & '-S' Mnemonics. Example:
|
|||||
| GUI API and Mnemonics | ||||||
| *Restriction* | All access to the Windows print subsystem must use standard Windows print API calls. Since only ProvideX predefined mnemonics are mapped to Windows API calls, you are limited to using ProvideX predefined mnemonics. | |||||
| You can mix and match varying fonts and attributes, use graphics mnemonics ('ARC', 'CIRCLE', 'FILL', 'FONT', 'FRAME', 'LINE', 'PEN', 'PICTURE', 'PIE', 'POLYGON', 'RECTANGLE', and 'TEXT'), and include text mode printing all on the same page. Move line positioning (column and row) around as desired. Printing is page-oriented rather than line-oriented. In GUI API, you can access any part of the entire page at any time. Top to bottom ordering is not necessary. This also applies when using WindX under UNIX. The following routine illustrates some of the available graphic mnemonics.
You can use all of the foreground and background colours with colour printers. Use the 'PEN' and 'FILL' mnemonics to control the colour settings for graphics mnemonics. The following routine prints each of the available 16 colours.
|
||||||
| [WDX]*WINDEV* Escape Sequences | If you are opening [WDX]*WINDEV* and defining/creating mnemonics that will send escape sequences to the printer channel, you must send the mnemonic definitions to the WindX client instead of defining them on the server. (This is because internally there are actually two channels open: one ProvideX is using to route printing to WindX and one WindX opens, connected to the actual port on the client. Your mnemonic is run locally on the server's channel and not sent to WindX for the remote client.) | |||||
| *Note* | As of Version. 4.20, WindX supports the use of the MNEMONIC directive via the [WDX] tag. | |||||
| To
send the mnemonic to the client in older versions of
ProvideX / WindX, you can either: Create a device driver containing mnemonic definitions on the WindX client PC and then use a CALL directive;
|
||||||
| or | ||||||
|
Use an EXECUTE directive from the server
side for mnemonic definitions on the client; e.g.,
EXECUTE "[WDX]MNEMONIC (LFO)'XX'=....". For further information, refer to the MNEMONIC Directive and the [WDX] Tag. |
||||||
| *Reminder* | With *WINPRT*, escape sequences are not allowed and may have an unpredictable effect on the device and/or printer driver. With *WINDEV*, you can use escape sequences, but both the validity of sequences and the printer's support for raw mode (if any) are printer- and driver-dependent. | |||||
| Pages and Form Feeds in Printing | You can access an entire page and print to it. However, you can only print to the current page at any one time. To complete a page, either use a form feed or close the channel. For proper spooler operation, do not include leading or trailing form feeds within the print job. Spoolers always assume the paper is at top-of-form when a job begins. | |||||
| *Note* | A form feed is automatically appended to every print job sent. | |||||