Nice, made a proof of concept for generating native Zebra label printer commands (ZPL) from FastReport (this is much faster and sharper than Windows printing)
Nice, made a proof of concept for generating native Zebra label printer commands (ZPL) from FastReport (this is much faster and sharper than Windows printing)
http://en.wikipedia.org/wiki/Zebra_(programming_language)
http://www.zebra.com/id/zebra/na/en/documentlibrary/manuals/en/zpl_ii_programming2.File.tmp/45541L-002_RA.pdf
for i := 0 to page.Objects.Count - 1 do
begin
c := TObject(page.Objects[i]) as TfrxComponent;
if c is TfrxMemoView then
begin
fm := (c as TfrxMemoView);
x := Round(fm.Left); //is in pixels
y := Round(fm.Top);
raw.DrawLabel(x, y, Trim(fm.Text), Abs(fm.Font.Height), fm.Font.Size);
end
...
procedure TRAWLabel.DrawLabel(x,y: Integer; const Text: string; aHeight: Integer = 20; aWidth: Integer = 20);
begin
FData.Add( Format('^FO%d,%d^ADN,%d,%d^FD%s^FS',
[x, y, aHeight, aWidth, Text]) );
end;
Note: ZPL positioning works with pixels, FastReport components also have pixel based positions so it should be "exact the same" (only the font can be different)
http://www.zebra.com/id/zebra/na/en/documentlibrary/manuals/en/zpl_ii_programming2.File.tmp/45541L-002_RA.pdf
http://en.wikipedia.org/wiki/Zebra_(programming_language)
http://www.zebra.com/id/zebra/na/en/documentlibrary/manuals/en/zpl_ii_programming2.File.tmp/45541L-002_RA.pdf
for i := 0 to page.Objects.Count - 1 do
begin
c := TObject(page.Objects[i]) as TfrxComponent;
if c is TfrxMemoView then
begin
fm := (c as TfrxMemoView);
x := Round(fm.Left); //is in pixels
y := Round(fm.Top);
raw.DrawLabel(x, y, Trim(fm.Text), Abs(fm.Font.Height), fm.Font.Size);
end
...
procedure TRAWLabel.DrawLabel(x,y: Integer; const Text: string; aHeight: Integer = 20; aWidth: Integer = 20);
begin
FData.Add( Format('^FO%d,%d^ADN,%d,%d^FD%s^FS',
[x, y, aHeight, aWidth, Text]) );
end;
Note: ZPL positioning works with pixels, FastReport components also have pixel based positions so it should be "exact the same" (only the font can be different)
http://www.zebra.com/id/zebra/na/en/documentlibrary/manuals/en/zpl_ii_programming2.File.tmp/45541L-002_RA.pdf
I am using Delphi 6,7 xe can i apply your concept to them?
ReplyDeleteAnd if yes can you show a REAL test PROGRAM to test the concept?
On xe i have fast report 4
Now i use BarTender Suite and Delphi
shlomo abuisak yes I think I can make it, but not this week I'm afraid. But for raw printing you need to write specific codes, e.g. for Zebra label printers it is ZPL but other brands have their own. So are you using Zebra right now?
ReplyDeleteYes. with bar tender. i will be glad to see a demo program
ReplyDeletemy mail is
limelect at gmail dot com or publish it here thanks
shlomo abuisak sorry for the delay, but I could test it only lately on a real zebra printer. Font is still not perfect (each font has it own scaling?) but at least it is possible :)
ReplyDeletehttps://github.com/andremussche/AndrewsDelphiStuff/tree/master/FastReport2ZebraZPL
Right now I am developing a small program for Intermec
ReplyDeletePc4 with Delphi,
It workers in raw printer mode. I have only a small problem of sending graphics to it.
1. If you want this pease of program?
2 I have a nice idea to make labeled with delphi
If you want to here about it get in touch
Limelect at gmail dot com
I used delphi 7
ReplyDeleteshlomo abuisak sorry, I don't have right now because we won't continue (at least for now) with raw mode, because with FastReport it is fast enough and better font support (default zebra fonts are ugly)
ReplyDelete