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
User avatar
emeasoft
Posts: 1075
Joined: Wed Apr 01, 2009 4:12 pm
Location: emeasoft
Contact:

Printer and TPrinter

Postby emeasoft » Wed Aug 30, 2017 6:47 pm

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
User avatar
jfgimenez
Site Admin
Posts: 5629
Joined: Mon Apr 06, 2015 8:48 pm
Contact:

Re: Printer and TPrinter

Postby jfgimenez » Wed Aug 30, 2017 8:23 pm

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

Return to “English”