Controlling the Printer - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

By default, windows are printed using the global printer device. This is initialized to the default Windows printer or the MapInfo Pro preferred printer, depending on how the user has set preferences. Using the Name clause an application, workspace, or the MapBasic window can override the printer preferences for an individual document. Several settings for the printer can also be controlled by using additional command clauses. Also, when the printer settings are changed through the user interface, appropriate MapBasic commands are generated internally. These overrides are saved with the workspace commands for the affected windows, so they will be reapplied when the workspace is reopened. An override can be removed from a window by running a Set Window Printer Default command.

If Scale Patterns is set to On, fill patterns are scaled based on the ratio of the output device's resolution to the screen resolution.

Attribute parameters, WIN_INFO_PRINTER_NAME (21), WIN_INFO_PRINTER_ORIENT (22) or WIN_INFO_PRINTER_COPIES (23), are also returned with WindowInfo( ) function.

Example

Set Window frontwindow( )
	Printer Name "\\Discovery\HP 2500CP"
		Orientation Portrait
		Copies 10
Note: To find out the window's printer name, start MapInfo Pro, go to select the Page Setup command on the HOME tab. Click the Printer button. Use the printer name found in that dialog box.