Special File Handling
*VIEWER* Print Preview
   
Formats 1. Open for Preview: OPEN (chan)”*VIEWER* [ ; options ]”
2. Via WindX: CALL "*WindX.utl;SPAWN","*VIEWER* -XT=1 -ARG filename[ DELETE]"
3. Via Command Line: path\PVX\PVXWIN32.EXE"*VIEWER* -XT=1 -ARG filename[ DELETE]"

Where:

chan Channel or logical file number; e.g., OPEN (1)"*viewer*"
DELETE Optional keyword. Use the DELETE to tell ProvideX to erase the file when the viewer closes.
filename$ Name of the file that the print job is stored in or being spooled to. The file must be a serial file and not locked. See the SERIAL Directive. To override the normal requirement that a serial file be locked, use 'LU' System Parameter.
PVX | PVXWIN32.EXE Command to launch ProvideX. See also: ProvideX Installation Guide, Launching ProvideX.
*VIEWER* Keyword, not case-sensitive. Special interface, enclosed in quotation marks within OPEN directive. (Include asterisks in syntax.)
options A series of semi-colon separated options that can be used to set the Margins, Orientation, Papersize, etc of the printer that the viewer is to emulate. Specific properties are listed under WINPRT_SETUP Properties.
*WINDX.UTL;SPAWN ProvideX utility;function. See also: Format 10: [WDX] and *WindX.utl.


*Note* For use in WindX or Windows only.


   
Description The *VIEWER* is a special device file for previewing reports. The *VIEWER* is able to:
  • Capture a print job to a file
  • View currently spooling print jobs, or print jobs stored on the disk
  • Work on the local Windows client via WindX
  • Zzoom in/out in four states
  • GoTo: Page, First Page, Last Page, Previous Page, Next Page, Specific Page Number
  • Search text
  • Copy to clipboard
  • View a job while it is still spooling.


*Note* If the Global variable %PDF_DEFAULT$ contains the option VIEWER, the system built in PDF driver and external PDF viewer will be used whenever the application opens *VIEWER*.


   
Examples The following example illustrates how to open and use the *VIEWER* for print preview:

0010 LET CHAN=UNT; OPEN (CHAN)"*VIEWER*"
0020 PRINT (CHAN)'FONT'("Courier New",-10),'DF',
0030 PRINT (CHAN)'FONT'("Arial",2),'TEXT'(@X(2),@Y(2),"Fonted Text"),
0040 PRINT (CHAN)'PICTURE'(@X(3),@Y(5),@X(43),@Y(30),"*win/nomads2"),



*Note* Set the 'BM' Mnemonic, to ON to have the *VIEWER* send all data directly to the print file without interpretation. This allows you to send print jobs to any Windows printer that is available on the client PC. The *VIEWER* filters out the first and/or last page if either is blank.


  The *VIEWER* does not return values for maximum column / line; i.e., in MXC( ) and MXL( ) functions. The following example illustrates how to approximate the number of columns:

CHAN=UNT; OPEN (CHAN)"*WINPRT*" POINTSZ=-10
LOOP:
PRINT (CHAN)'FONT'("Courier New",POINTSZ),'DF', IF MXC(CHAN)<132 THEN POINTSZ+=2; GOTO LOOP LINES=MXL(CHAN),COLS=MXC(CHAN)
PRINT (CHAN)'AB', ! <--- aborts print job
CLOSE (CHAN)
OPEN (CHAN)"*VIEWER*"
PRINT 'FONT'("Courier New",POINTSZ),'DF',mn/line