Printer do not use my settings (Linux CUPS, Labelwriter)
Original Reporter info from Mantis: mmvisual
-
Reporter name: Markus Müller
Original Reporter info from Mantis: mmvisual
- Reporter name: Markus Müller
Description:
I have a labelwriter "Brother PTouch QL560".
I have install the driver under Linux and it print labels.
Printer.Orientation := poPortrait;
Printer.Canvas.Pen.Color := clBlack;
Printer.Canvas.Brush.Color := clWhite;
Printer.Canvas.Font.Color := clBlack;
Printer.BeginDoc;
Printer.Canvas.TextOut(i2, i1, 'TEXT');
Printer.EndDoc;
1)
The printed text is 3mm to much right and 3mm to much on the top then the text is cutted. The calculation from the right orientation with printing area offset do not work good.
My Bugfix an the text is on the right position:
rect := Printer.PaperSize.PaperRect.WorkRect;
Printer.Canvas.TextOut(i2 - rect.Left, i1 + rect.Left, 'TEXT');
(With Windows is no problem, only Linux)
2)
The second Problem is, I cannot define the paper length.
Sometime, I need only 20mm, sometimes 50mm or else. But the printer do print always the driver defined length from 90mm.
Here the code fro my test:
VAR rect: TRect;
VAR cuo: Pcups_option_t;
VAR i: Integer;
VAR s: String;
rect := Printer.PaperSize.PaperRect.PhysicalRect;
i := TCUPSPrinter(Printer).CopyOptions(cuo);
s := '[' + IntToStr(rect.Right) + ' 450]';
i := cupsdyn.cupsAddOption(PChar('PageSize'), PChar(s), i ,@cuo);
TCUPSPrinter(Printer).MergeOptions(cuo, i);
TCUPSPrinter(Printer).DebugOptions();
I want set the parameter 'PageSize', but when I want see the parameter it is not listen with DebugOptions();
Additional information:
Sorry for this bugreport. I'm not so good in Linux. I have looking a lot and test and google, but not found a solution.
But I think, there must be a solution, the Standard driver can make a label with 90mm.
With Windows, it works good, but there I use the
PDev := TPrinterDevice(Printer.Printers.Objects[Printer.PrinterIndex]);
PDev.DevMode^.dmPaperLength := 450;
And this command have the TCUPSPrinter not.
Here links for the installation the driver:
http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/instruction_esp1.html
http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_esp.html
And use this commands if you have a QL-560 Label writer:
lpadmin -p QL-560 -E -v usb://Brother/QL-560 -P /usr/share/cups/model/brql570.ppd
lpadmin -x QL-570
Mantis conversion info:
- Mantis ID: 22672
- Version: 1.1 (SVN)