In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Printer and TPrinter

Xailer professional forum in English
Responder
Avatar de Usuario
emeasoft
Mensajes: 1088
Registrado: Mié Abr 01, 2009 4:12 pm
Ubicación: emeasoft
Contactar:

Printer and TPrinter

Mensaje por emeasoft »

Good afternoon,

When you create an object of the TPrinter class and change the nPrinterIndex parameter, even after you call the Destroy() method,
the nPrinterIndex parameter of the public variable Printer also changes.
This causes the printer selected by default in the print dialog window to be the last printer selected with the TPrinter object.
If after destroying the TPrinter object ( TPrinter:Destroy() ), you also destroy and recreate the public variable Printer ( Printer:Destroy() and Printer:Create() ),
the printer selected the next time you print, returns to be the default.
The question is, when creating an object of class TPrinter, changing its parameters and then destroying it, the instance of the public variable Printer should also be changed?

Thanks,

André Corrêa
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: Printer and TPrinter

Mensaje por jfgimenez »

André,

most TPrinter propierties are sent to windows print subsystem and printer driver. That's why changing those properties in a TPrinter instance is propagated to others. So, I'm affraid the programmer is responsible of restoring those values after printing.
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder