PrintScreen() Function
- Last UpdatedNov 19, 2025
- 2 minute read
You can write a script to print the entire WindowViewer screen with the PrintScreen() function.
Syntax
PrintScreen (ScreenOption, PrintOption)
Parameters
ScreenOption
Determines how much of the WindowViewer screen is to be printed. A literal integer value, integer tagname, or integer expression.
1 - Print the client area, no menus (default)
2 - Print the entire window area, including menus
PrintOption
Determines how the printed image is to be stretched to fit on the printout.
-
1 - Best Fit:
image is stretched so that it fits either horizontally or vertically on the printout without changing the aspect ratio. (default) -
2 - Vertical Fit:
image is stretched so that it fits vertically on the printout without changing the aspect ratio. The image may be cut off horizontally. -
3 - Horizontal Fit:
image is stretched so that it fits horizontally on the printout without changing the aspect ratio. The image may be cut off vertically. -
4 - Stretch to Page:
image is stretched so that it fits horizontally and vertically on the printout. The aspect ratio may change but the image is not truncated. -
Invalid options, including 0, default to Best Fit.
Note: Popup windows that extend beyond the WindowViewer screen area are cut off.
Example(s)
This script sends a printout of the current entire WindowViewer screen area without menus to the printer queue. The printout contains the screen area stretched so that it fills the printout dimensions.
PrintScreen(1,4);
In the above example, the first parameter passed by the function is ScreenOption (1). This specifies that the client area without menus will be printed.
The second parameter passed is the PrintOption (4). This specifies that area will be stretched to fill the dimensions of the printed page.