From RAD Studio API Documentation
Jump to: navigation, search


function SetPrinter(const NewPrinter: TPrinter): TPrinter;


extern DELPHI_PACKAGE TPrinter* __fastcall SetPrinter(TPrinter* const NewPrinter);


Type Visibility Source Unit Parent
function public
FMX.Printer FMX.Printer


Replaces the global instance of TPrinter that manages any interaction with the printer.

SetPrinter replaces the global TPrinter object with another TPrinter object. This allows applications to change the way they handle printing by substituting a TPrinter descendant for the default TPrinter object.

NewPrinter is the new TPrinter object that replaces the current global TPrinter object.

SetPrinter returns the previous global TPrinter object.

Note: The global TPrinter object is freed automatically when the application shuts down. After a call to SetPrinter, the printer that is returned is not automatically freed. It is the caller's responsibility to either free the return value, or replace it using another call to SetPrinter and to free the substitute printer that the second SetPrinter call returns.

See Also