Skip to main content
All docs
V24.1

dxPrintDevice Method

Provides access to the global printer manager.

Declaration

function dxPrintDevice: TdxPrintDevice;

Returns

Type Description
TdxPrintDevice

The global printer device manager.

Remarks

Call the dxPrintDevice function to access and manage printer devices in your application. For example, you can use dxPrintDevice.PrinterCount and dxPrintDevice.PrinterIndex properties to obtain the number of available printer devices and switch between them.

Refer to the TdxPrintDevice class description for detailed information on all available options.

Code Example

The following code example sets Microsoft XPS Document Writer as the active printer device for TdxComponentPrinter:

uses
  dxPrnDev;  // This unit declares the dxPrintDevice function

// ...
var
  APrinterIndex: Integer;
begin
  APrinterIndex := dxPrintDevice.FindPrintDevice('Microsoft XPS Document Writer', '');
  if APrinterIndex <> -1 then  // If the specified printer device is available
    dxPrintDevice.PrinterIndex := APrinterIndex;  // Changes the active printer device
end;
See Also