| Directives |
|
| Formats | 1. Read
Current Selection: WINPRT_SETUP [SERVER]
READ var$ [,ERR=stmtref] 2. Read Properties: WINPRT_SETUP [SERVER] READ PROPERTIES var$ [,ERR=stmtref] 3. Update Selection: WINPRT_SETUP [SERVER] WRITE printer$ [,ERR=stmtref] 4. Update Properties: WINPRT_SETUP [SERVER] WRITE PROPERTIES settings$ [,ERR=stmtref] 5. List Available Printers: WINPRT_SETUP [SERVER] LIST var$ [,ERR=stmtref] 6. List Printer Names Only: WINPRT_SETUP [SERVER] DIRECTORY var$ [,ERR=stmtref] 7. Display Printer Dialogue: WINPRT_SETUP INPUT var$ [,ERR=stmtref] Where
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | Use the WINPRT_SETUP directive to control settings for the currently-selected Windows printer and its properties. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WINPRT_SETUP Properties | The default
properties of a printer are determined by the individual
printer/driver manufacturers. Some properties (e.g.,
collate, ordered printing) are not available for all
drivers. Others (e.g., font, point size) vary from
printer to printer. Default paper size seems to be
consistently letter size (8 1/2" x 11",
expressed as PAPERSIZE=1 for DMPAPER_LETTER). Refer to Paper
Sizes
below for the complete list of PAPERSIZE=num
codes. The properties that can be assigned to your Windows printer (printer/driver dependent) include the following:
Most properties are self-explanatory, like COPIES=1. Some need a little explanation. For instance, the assignment used for the offset property OFFSET=x:y is in thousandths of an inch and is the offset to the print area from the upper left corner of the page. (e.g., OFFSET=750:500 offsets the print area three-quarters of an inch from the left margin and half an inch down from the top margin.) Valid numeric settings for TRUETYPE=num:
Valid numeric settings for DUPLEX=num (if capable of double-sided printing):
Valid numeric settings for QUALITY=num:
The TITLE option allows the programmer to specify the Windows Spooler title for the report. If not specified the system will use the window caption line.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FORCE6X10 option | Normally
when printing a proportional font to a graphical Print
device, the system will determine the logical column
width based on the average width of the characters for
the font requested. This can cause minor problems with
output alignment since fonts often vary slightly between
operating systems and at different resolutions. To resolve this problem the application may include FORCE6X10=YES which will force the system to set the logical column width as 60% of the line height (which is what is specified in font size specifications). The 6x10 ratio is derived from the fact that historically printers printed 6 lines to the inch and 10 characters per inch -- thus the character width was 60% the line height. Most common fixed width fonts also adhere to this ratio. Specifying FORCE6X10=YES will automatically adjust the column width to 60% of the line height given in the FONT specification, thus outputting to *WINPRT*, *PDF*, and *BITMAP* regardless of the chosen font will remain consistent in terms of general page layout. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Margin Control | The MARGINS=
property accepts values for left, top, right
and bottom in 1000ths of an inch. These values
affect both text mode printing (e.g., PRINT
(x)"ABC",) and graphical printing (e.g., PRINT
(x)'PICTURE(...),). The following example indicates a 1
inch margin on all sides of the page. WINPRT_SETUP WRITE PROPERTIES "MARGINS=1000:1000:1000:1000" The default values are -1:-1:-1:-1, which is the equivalent of no margin setting. If only two values are given, the right and bottom margins default to the hardware-imposed print margins. A value of -1 indicates that the printer is to use its default physical margin. The software internally adjusts the top and left margins by any hardware imposed printing offsets. Most laser or ink jet printers impose a margin around the edge of the paper where they cannot print. These values are taken into account by the property settings in order to assure consistent output positioning regardless of printer type. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *Note* | Due to printer wear and tear, paper slippage, and other outside factors, the output position is never guaranteed to be 100% correct. However, the ProvideX logic for handling margins is consistent with most other Windows-based software. The alignment will be similar to the output from other programs printed on the same printer using the same OS and printer drivers. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The keyword MARGIN may be used instead of MARGINS, if preferred; however, WINPRT_SETUP READ PROPERTIES always returns MARGINS= as the property name. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Paper Sizes | The chart
below lists paper sizes according to the Windows system
definition file print.h, with the Internal Name
followed by the number to use as the PAPERSIZE=num
option for the print drivers, followed by a more general
description of the paper.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *Warning* | The PostScript driver mistakenly uses DMPAPER_ values between * 50 and 56. Do not use this range when defining new paper sizes. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format 1 | Read Selection
Use the WINPRT_SETUP READ format to read the currently selected default printer name. The value returned in var$ will be the OS name of an existing physical queue. Example:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format 2 | Read Properties
Use the WINPRT_SETUP READ PROPERTIES format to read the current settings of the properties associated with your current printer. The values are returned in a semicolon-separated list.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format 3 | Update Selection
Use the WINPRT_SETUP WRITE format to write or change the currently selected default printer, using a string expression to pass the system the name of the printer to use.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format 4 | Update Properties
Use the WINPRT_SETUP WRITE PROPERTIES format to write or change the current properties, using a string expression to pass the system the property assignments to use. Example:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format 5 | List Available Printers
Use WINPRT_SETUP LIST to obtain a comma-delimited list of all the printers defined in the system. Note that if you use this format on a workstation which does not have printers installed, there will be no value in your string variable and ProvideX returns an Error #12: File does not exist (or already exists).
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format 6 | List Printer Names Only
Using the DIRECTORY keyword returns a comma-delimited list of printers with just the printer portion of the names, excluding the ON Device portion.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format 7 | Display Printer Dialogue
Use the WINPRT_SETUP INPUT format to display the Windows Printer Selection dialogue box, allowing the user to select a printer. The string variable returns the name of the printer selected by the user.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| See Also | *WINPRT* Windows Printing, *WINDEV* Raw Print Mode, *WINPRT* / *WINDEV* Queues *WINPRT* / *WINDEV* Printing Examples *PDF* PDF Print Interface |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||