Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsPrinterMBS class.

Next items

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
The AddForm function adds a form to the list of available forms that can be selected for the specified printer.
Example
// query default printer
dim w as new WindowsPrinterMBS(WindowsPrinterMBS.GetDefaultPrinter)

dim form as new WindowsPageFormatMBS

form.Mode = 1
form.Name = "MyTest"
form.DisplayName = "MyTest"
form.Flags = 0
form.SizeHeight = 100000
form.SizeWidth = 100000
form.ImageableAreaLeft = 0
form.ImageableAreaTop = 0
form.ImageableAreaRight = 100000
form.ImageableAreaBottom = 100000

if w.AddForm(form) then
MsgBox "OK"
else
MsgBox "Failed"
end if

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
Displays a printer-configuration dialog box for the specified printer, allowing the user to configure that printer.

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
Displays a printer-configuration dialog box for the specified printer, allowing the user to configure that printer.

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
Queries all jobs for the printer.
Example
dim w as new WindowsPrinterMBS( WindowsPrinterMBS.GetDefaultPrinter)
dim jobs() as WindowsPrinterJobMBS = w.AllJobs
MsgBox str(UBound(jobs)+1)+" jobs"

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
Whether this printer can pass through postscript data.

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
Changes printer settings.

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
Displays the port-configuration dialog box for a port on the specified server.

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
Displays the port-configuration dialog box for a port on the specified server.

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
Displays a dialog box that lets users browse and connect to printers on a network.

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
Displays a dialog box that lets users browse and connect to printers on a network.

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
Opens the printer so you can operate on it.

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
The DeleteForm function removes a form name from the list of supported forms.

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
Delete the print job.

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
Deletes the specified printer object.

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
The DocumentProperties function retrieves or modifies printer initialization information or displays a printer-configuration property sheet for the specified printer.
Example
// get default printer
dim p as WindowsPrinterMBS = WindowsPrinterMBS.OpenPrinter(WindowsPrinterMBS.GetDefaultPrinter)

// ask for printer settings
dim s as new WindowsDeviceModeMBS
dim n as Integer = p.DocumentProperties(nil, s, true, window1)

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
The DocumentProperties function retrieves or modifies printer initialization information or displays a printer-configuration property sheet for the specified printer.
Example
// get default printer
dim p as WindowsPrinterMBS = WindowsPrinterMBS.OpenPrinter(WindowsPrinterMBS.GetDefaultPrinter)

// ask for printer settings
dim s as new WindowsDeviceModeMBS
dim n as Integer = p.DocumentProperties(nil, s, true, window1)

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
The GetForm function retrieves information about a specified form.
Example
// query default printer
dim w as new WindowsPrinterMBS(WindowsPrinterMBS.GetDefaultPrinter)

// get a page format
dim f as WindowsPageFormatMBS = w.GetForm("Letter")

// and show details
MsgBox f.DisplayName+" "+str(F.SizeWidth/10000,"0.0")+" x "+str(f.SizeHeight/10000,"0.0")

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
Query job with given ID from printer.

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
Queries the page formats supported by this printer.

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
Queries printer settings.
Example
dim w as new WindowsPrinterMBS(WindowsPrinterMBS.GetDefaultPrinter)
dim dm as WindowsDeviceModeMBS = w.GetPrinterSettings

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
Queries the printer technology.
Example
dim w as new WindowsPrinterMBS("my printer")
msgbox w.GetPrinterTechnology

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
Pause the print job.

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
Pauses the printer.
Example
dim name as string = WindowsPrinterMBS.GetDefaultPrinter
dim p as WindowsPrinterMBS = WindowsPrinterMBS.OpenPrinter(name, true)

if p.PausePrinter then
MsgBox "OK"
else
MsgBox "Failed: "+p.LasterrorMessage+" "+str(p.Lasterror)
end if

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
The PrinterProperties function displays a printer-properties property sheet for the specified printer.
Example
// get default printer
dim w as new WindowsPrinterMBS(WindowsPrinterMBS.GetDefaultPrinter)

// open properties dialog
if w.PrinterProperties(window1) then
MsgBox "OK"
else
MsgBox "Failed"
end if

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
The PrinterProperties function displays a printer-properties property sheet for the specified printer.
Example
// get default printer
dim w as new WindowsPrinterMBS(WindowsPrinterMBS.GetDefaultPrinter)

// open properties dialog
if w.PrinterProperties(window1) then
MsgBox "OK"
else
MsgBox "Failed"
end if

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
Purges the printer.
Example
dim name as string = WindowsPrinterMBS.GetDefaultPrinter
dim p as WindowsPrinterMBS = WindowsPrinterMBS.OpenPrinter(name, true)

if p.PurgePrinter then
MsgBox "OK"
else
MsgBox "Failed: "+p.LasterrorMessage+" "+str(p.Lasterror)
end if

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
Resume a paused print job.

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
Resumes the printer.
Example
dim name as string = WindowsPrinterMBS.GetDefaultPrinter
dim p as WindowsPrinterMBS = WindowsPrinterMBS.OpenPrinter(name, true)

if p.ResumePrinter then
MsgBox "OK"
else
MsgBox "Failed: "+p.LasterrorMessage+" "+str(p.Lasterror)
end if

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
The SetForm function sets the form information for the specified printer.

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.

Next items

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...