RT_
asked on
Delphi 2007 printer setup problem
Hi All,
i am using delphi 2007 and try to print barcodes and A4 pages on tlp2844 zebra and hp 1020.
My problem is, when i switch the printerindex to the 1020 from the 2844, then the printed a4 page is OK, but when i switch back to the 2844, the barcode is faulty, because the page size remains the A4.
I have tried some workarounds, but can't resolve it.
need help
thank you
i am using delphi 2007 and try to print barcodes and A4 pages on tlp2844 zebra and hp 1020.
My problem is, when i switch the printerindex to the 1020 from the 2844, then the printed a4 page is OK, but when i switch back to the 2844, the barcode is faulty, because the page size remains the A4.
I have tried some workarounds, but can't resolve it.
need help
thank you
how you print barcode? using quickreport?
ASKER
nope
here is the code
Printer.BeginDoc;
Printer.Canvas.TextOut(0,1 28,leftstr (VarToStr( DBGrid3.Da taSource.D ataSet.Fie ldByName(' NAME').Val ue),25));
Printer.Canvas.TextOut(0,1 55,'www.microstore.hu/'+DBtext4.Caption);
Barcode1D_Code1281.Barcode := VarToStr(DBGrid3.DataSourc e.DataSet. FieldByNam e('VONALKO D_SN').Val ue);
Barcode1D_Code1281.Print(2 ,-3,1,30,1 7,0);
Printer.EndDoc;
here is the code
Printer.BeginDoc;
Printer.Canvas.TextOut(0,1
Printer.Canvas.TextOut(0,1
Barcode1D_Code1281.Barcode
Barcode1D_Code1281.Print(2
Printer.EndDoc;
This component (Barcode1D_Code1281 - any link to this?) seems to be not getting information of printer change. Try to do this:
Printer.BeginDoc;
Printer.Canvas.TextOut(0,128,leftstr(VarToStr(DBGrid3.DataSource.DataSet.FieldByName('NAME').Value),25));
Printer.Canvas.TextOut(0,155,'www.microstore.hu/'+DBtext4.Caption);
Barcode1D_Code1281 := <create component here>
try
Barcode1D_Code1281.Barcode := VarToStr(DBGrid3.DataSource.DataSet.FieldByName('VONALKOD_SN').Value);
Barcode1D_Code1281.Print(2,-3,1,30,17,0);
finally
<destroy component Barcode1D_Code1281 here>
end;
Printer.EndDoc;
ASKER
not working, i think the problem is with the printer component, i have writed out the page parameters to the screen and see that the dimensions not changing.
showmessage(vartostr(print er.PageHei ght));
showmessage(vartostr(print er.Pagewid th));
when i'll start the program with default set to tpl2844, they are working, but when i set the default printer to the 2020 or another A4 printer, the settings going to a4 size, but when i am setting the printerindex back to tlp2844, the width and height are not changing back.
starting :
200,320
changing the def printer to the a4:
2374,831
after set the printer. printerindex back to tlp2844
Printer.PrinterIndex := g_barcode_prn_idx;
remains to 2374,831
so that is the problem
showmessage(vartostr(print
showmessage(vartostr(print
when i'll start the program with default set to tpl2844, they are working, but when i set the default printer to the 2020 or another A4 printer, the settings going to a4 size, but when i am setting the printerindex back to tlp2844, the width and height are not changing back.
starting :
200,320
changing the def printer to the a4:
2374,831
after set the printer. printerindex back to tlp2844
Printer.PrinterIndex := g_barcode_prn_idx;
remains to 2374,831
so that is the problem
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
now i am trying to modify the printers.pas, maked a local copy to the project dir, but doesn't work , giving some erros :
http://www.rekettyei.hu/files/printerpas/printer.png
http://www.rekettyei.hu/files/printerpas/printer.png
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you, those 2 was ok