Platforms to show: All Mac Windows Linux Cross-Platform
Back to WindowsPrinterMBS class.
WindowsPrinterMBS.AddForm(form as WindowsPageFormatMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Form.Mode gives level of the data. Must be either 1 (old version) or 2 (newer version).
Form: The form details.
Returns true if the function succeeds and false if the function fails.
Note: This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
An application can determine which forms are available for a printer by calling the GetPrinterFormats function.
If form points to a Mode 2 form, then AddForm will fail if either a form with the specified name already exists or the Keyword value already exists.
WindowsPrinterMBS.AdvancedDocumentProperties(InputDevMode as WindowsDeviceModeMBS, byref OutputDevMode as WindowsDeviceModeMBS, parent as DesktopWindow) as integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 22.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
This function is a special case of the DocumentProperties function.
parent: The parent window of the printer-configuration dialog box.
OutputDevMode: The device mode structure that will contain the configuration data specified by the user.
InputDevMode: The device mode structure that contains the configuration data used to initialize the controls of the printer-configuration dialog box.
If the DocumentProperties function with these parameters is successful, the return value of AdvancedDocumentProperties is 1. Otherwise, the return value is zero.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
This function can only display the printer-configuration dialog box so a user can configure it. For more control, use DocumentProperties.
See also:
Some examples using this method:
WindowsPrinterMBS.AdvancedDocumentProperties(InputDevMode as WindowsDeviceModeMBS, byref OutputDevMode as WindowsDeviceModeMBS, parent as window = nil) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
This function is a special case of the DocumentProperties function.
parent: The parent window of the printer-configuration dialog box.
OutputDevMode: The device mode structure that will contain the configuration data specified by the user.
InputDevMode: The device mode structure that contains the configuration data used to initialize the controls of the printer-configuration dialog box.
If the DocumentProperties function with these parameters is successful, the return value of AdvancedDocumentProperties is 1. Otherwise, the return value is zero.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
This function can only display the printer-configuration dialog box so a user can configure it. For more control, use DocumentProperties.
See also:
WindowsPrinterMBS.AllJobs as WindowsPrinterJobMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
PrinterName property must be set, so the function knows which printer.
Some examples using this method:
WindowsPrinterMBS.CanPrinterPassThroughPostScript as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Returns true for Postscript printers and false for other printers.
For more information on this function, visit this website:
http://msdn.microsoft.com/en-us/library/dd162831(v=VS.85).aspx
Some examples using this method:
WindowsPrinterMBS.ChangePrinterSettings(value as WindowsDeviceModeMBS, Mode as Integer=2) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
This function opens the printer, queries current settings using GetPrinter, applies all your changes, calls DocumentProperties to verify those settings are valid for the printer and uses SetPrinter to apply the changes.
To indicate which fiels in the WindowsDeviceModeMBS object are set by you, use the fields integer value with a combination of the DM_* constants.
Returns true on success and false on failure.
Mode can be 2 (general printer information), 8 (global settings) or 9 (user settings).
For more information on the GetPrinter function, check this website:
http://msdn.microsoft.com/en-us/library/dd144911(VS.85).aspx
For more information on the SetPrinter function, check this website:
http://msdn.microsoft.com/en-us/library/dd145082(VS.85).aspx
For more information on the DocumentProperties function, check this website:
http://msdn.microsoft.com/en-us/library/dd183576(VS.85).aspx
Even if you change printer settings, other parts of the application, e.g. Xojo framework may not care.
Some examples using this method:
WindowsPrinterMBS.ConfigurePort(name as string = "", parent as window = nil, PortName as string = "") as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Name: The name of the server on which the specified port exists. If this parameter is "", the port is local.
parent: The parent window of the port-configuration dialog box.
PortName: The name of the port to be configured.
Returns true on success and false on failure.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
Before calling the ConfigurePort function, an application should call the EnumPorts function to determine valid port names.
See also:
WindowsPrinterMBS.ConfigurePort(name as string, parent as DesktopWindow, PortName as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 22.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Name: The name of the server on which the specified port exists. If this parameter is "", the port is local.
parent: The parent window of the port-configuration dialog box.
PortName: The name of the port to be configured.
Returns true on success and false on failure.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
Before calling the ConfigurePort function, an application should call the EnumPorts function to determine valid port names.
See also:
WindowsPrinterMBS.ConnectToPrinterDialog(parent as DesktopWindow) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 22.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
If the user selects a printer, the function attempts to create a connection to it; if a suitable driver is not installed on the server, the user is given the option of creating a printer locally.
parent: Specifies the parent window of the dialog box.
If the function succeeds and the user selects a printer, this object points to the new printer and return value is true.
If the function fails, or the user cancels the dialog box without selecting a printer, the return value is true.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
The ConnectToPrinterDialog function attempts to create a connection to the selected printer. However, if the server on which the printer resides does not have a suitable driver installed, the function offers the user the option of creating a printer locally.
An application should call DeletePrinter to delete a local printer. An application should call DeletePrinterConnection to delete a connection to a printer.
See also:
Some examples using this method:
WindowsPrinterMBS.ConnectToPrinterDialog(parent as window = nil) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
If the user selects a printer, the function attempts to create a connection to it; if a suitable driver is not installed on the server, the user is given the option of creating a printer locally.
parent: Specifies the parent window of the dialog box.
If the function succeeds and the user selects a printer, this object points to the new printer and return value is true.
If the function fails, or the user cancels the dialog box without selecting a printer, the return value is true.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
The ConnectToPrinterDialog function attempts to create a connection to the selected printer. However, if the server on which the printer resides does not have a suitable driver installed, the function offers the user the option of creating a printer locally.
An application should call DeletePrinter to delete a local printer. An application should call DeletePrinterConnection to delete a connection to a printer.
See also:
WindowsPrinterMBS.Constructor(PrinterName as string, admin as boolean = false)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Admin: whether you want to get permissions to administrate.
Raises exception if printer can't be opened. Use OpenPrinter function to avoid exception.
WindowsPrinterMBS.DeleteForm(name as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
name: The form name to be removed.
Returns true on success and false on failure.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
DeleteForm can only delete form names that were added by using the AddForm function.
WindowsPrinterMBS.DeleteJob(JobID as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Returns true on success and false on failure.
WindowsPrinterMBS.DeletePrinter as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Returns true on success and false on failure.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
If there are print jobs remaining to be processed for the specified printer, DeletePrinter marks the printer for pending deletion, and then deletes it when all the print jobs have been printed. No print jobs can be added to a printer that is marked for pending deletion.
A printer marked for pending deletion cannot be held, but its print jobs can be held, resumed, and restarted. If the printer is held and there are jobs for the printer, DeletePrinter fails with ERROR_ACCESS_DENIED.
Lasterror is set.
WindowsPrinterMBS.DocumentProperties(InputDevMode as WindowsDeviceModeMBS, byref OutputDevMode as WindowsDeviceModeMBS, Prompt as boolean = false, parent as window = nil) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Printername property must be set.
parent: The parent window of the printer-configuration property sheet. Can be nil.
Prompt: Whether to show dialog.
OutputDevMode: Devmode variable that receives the printer configuration data specified by the user.
InputDevMode: Optional input data which the operating system uses to initialize the property sheet controls.
Prompt: Whether the function presents the printer driver's Print Setup property sheet and then changes the settings in the printer's DeviceMode data structure to those values specified by the user.
If you provide object for InputDevMode, the function will read settings from there. If you don't pass an object (nil) or you pass incomplete settings, default settings are used to complete.
If prompt is true, the dialog is shown and user can change settings.
On the end, the current new data is stored in OutputDevMode where you can find it.
If the function displays the property sheet, the return value is either IDOK (1) or IDCANCEL (2), depending on which button the user selects.
If the function does not display the property sheet and is successful, the return value is IDOK (1).
If the function fails, the return value is less than zero.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation-factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
see also
http://msdn.microsoft.com/en-us/library/windows/desktop/dd183576(v=vs.85).aspx
See also:
Some examples using this method:
WindowsPrinterMBS.DocumentProperties(InputDevMode as WindowsDeviceModeMBS, byref OutputDevMode as WindowsDeviceModeMBS, Prompt as boolean, parent as DesktopWindow) as integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 22.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Printername property must be set.
parent: The parent window of the printer-configuration property sheet. Can be nil.
Prompt: Whether to show dialog.
OutputDevMode: Devmode variable that receives the printer configuration data specified by the user.
InputDevMode: Optional input data which the operating system uses to initialize the property sheet controls.
Prompt: Whether the function presents the printer driver's Print Setup property sheet and then changes the settings in the printer's DeviceMode data structure to those values specified by the user.
If you provide object for InputDevMode, the function will read settings from there. If you don't pass an object (nil) or you pass incomplete settings, default settings are used to complete.
If prompt is true, the dialog is shown and user can change settings.
On the end, the current new data is stored in OutputDevMode where you can find it.
If the function displays the property sheet, the return value is either IDOK (1) or IDCANCEL (2), depending on which button the user selects.
If the function does not display the property sheet and is successful, the return value is IDOK (1).
If the function fails, the return value is less than zero.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation-factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
see also
http://msdn.microsoft.com/en-us/library/windows/desktop/dd183576(v=vs.85).aspx
See also:
WindowsPrinterMBS.GetForm(name as string) as WindowsPageFormatMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
name: The string that specifies the name of the form. To get the names of the forms supported by the printer, call the GetPrinterFormats function.
On failure returns nil, on success the form details.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
If the caller is remote, and the Form Mode is 2, the StringType value of the returned WindowsPageFormatMBS will always be STRING_LANGPAIR.
WindowsPrinterMBS.GetJob(JobID as Integer) as WindowsPrinterJobMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Returns nil on any error.
PrinterName property must be set, so the function knows which printer.
Some examples using this method:
WindowsPrinterMBS.GetPrinterFormats as WindowsPageFormatMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
On failure the array is empty.
This function uses the EnumForms for which you can find more information on this website:
http://msdn.microsoft.com/en-us/library/dd162624(v=VS.85).aspx
Some examples using this method:
WindowsPrinterMBS.GetPrinterSettings(Mode as Integer=2) as WindowsDeviceModeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Mode can be 2 (general printer information), 8 (global settings) or 9 (user settings).
For more information on the GetPrinter function, check this website:
http://msdn.microsoft.com/en-us/library/dd144911(VS.85).aspx
Some examples using this method:
WindowsPrinterMBS.GetPrinterTechnology as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 10.4 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Opens the printer, queries the print technology and returns that string.
For postscript printers the string should contain the word "postscript".
Returns an empty string on any error.
For details on this function, check the following website:
http://msdn.microsoft.com/en-us/library/dd144931(VS.85).aspx
Some examples using this method:
WindowsPrinterMBS.PauseJob(JobID as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Returns true on success and false on failure.
WindowsPrinterMBS.PausePrinter as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Requires application to be run by administrator and printer opened with admin option. Else you get error 5.
Returns true on success and false on failure.
WindowsPrinterMBS.PrinterProperties(parent as DesktopWindow) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 22.0 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Returns true on success (dialog shows) or false on error.
Parent is the parent window for the new dialog. Can be nil.
See also:
Some examples using this method:
WindowsPrinterMBS.PrinterProperties(parent as window = nil) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop only |
Returns true on success (dialog shows) or false on error.
Parent is the parent window for the new dialog. Can be nil.
See also:
WindowsPrinterMBS.PurgePrinter as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Requires application to be run by administrator and printer opened with admin option. Else you get error 5.
Returns true on success and false on failure.
WindowsPrinterMBS.ResumeJob(JobID as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Returns true on success and false on failure.
WindowsPrinterMBS.ResumePrinter as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Requires application to be run by administrator and printer opened with admin option. Else you get error 5.
Returns true on success and false on failure.
WindowsPrinterMBS.SetForm(name as string, form as WindowsPageFormatMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Printing | MBS Win Plugin | 12.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
name: The string that specifies the form name for which the form information is set.
Form: The form data. Mode property must be either 1 (older format) or 2 (newer format).
Returns true on success and false on failure.
This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.
SetForm can be called multiple times for an existing WindowsPageFormatMBS, each call adding additional pairs of DisplayName and LangId values. All languages versions of the form will get the Size and ImageableArea values of the WindowsPageFormatMBS in the most recent call to SetForm.
If the caller is remote and the form's Mode is 2, the StringType value of the WindowsPageFormatMBS cannot be STRING_MUIDLL.
The items on this page are in the following plugins: MBS Win Plugin.