Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

dxPrintDevice Method

Provides access to the global printer manager.

#Declaration

Delphi
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: Change the Active Printer

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