I have a console application in Delphi and I have to print a label with a barcode.
How would I do that? Create a print service? Or would I use a QuickReport
?
The application is to run in telnet.
program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils, Printers, Graphics;
var
bmp: TBitmap;
begin
try
bmp := TBitmap.Create;
try
bmp.Width := 400;
bmp.Height := 400;
// your Barcode - Code here
bmp.Canvas.Ellipse(10,10,300,300);
Printer.BeginDoc;
Printer.Canvas.Draw(10,10,bmp);
Printer.EndDoc;
finally
bmp.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
我们使用TppDBBarcode
ReportBuilder 中的组件来打印条形码。
我使用过连接到串行端口的标签打印机,它们中的大多数都知道如何打印条形码,您需要做的就是告诉他们在哪里、什么代码和什么共生体。根据标签打印机的品牌和类型,您的手册应该告诉您如何让打印机打印标签。例如:Epson ESC (pdf) page C-195 或datamax-oneil 的 Compact4 (pdf) page 15