How can I select the printer with printer?
Posted on 2006-04-07
I have three printers installed in my computer, One of them is for a special printer for labels, I can leave this printers as default in my system only to set the drivers when I use the system for labels. In my cod I am using a this line
Printer.PrinterIndex := Printer.Printers.IndexOf('NAME_OF_MY_PRINTER'), but it is not working fine I think that something is missing, maybe to load another driver. Below you can see the code of my system. Maybe, there is a way to change default printer and after printing I can come back it.
Printer.PrinterIndex := Printer.Printers.IndexOf('ETIQUETACLIENTE');
With Printer do
Orientation := poLandscape;
Canvas.Pen.Width := 2;
Canvas.Font.Name := 'Times New Roman';
Canvas.Font.Size := 16;
Canvas.TextOut(150,110 ,'Romaneio :' + Rom);
Canvas.Font.Size := 12;
Canvas.TextOut(10,195,'Quantidade: ' + Qtd);
Canvas.TextOut(10,255,'Código....: ' + Cod);
Canvas.TextOut(10,315,'Descrição.: ' + Desc);
Canvas.TextOut(10,375,'Locação...: ' + loc);