Cloudcon
Cloudcon

Reputation: 21

Print label with barcode delphi console

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.

Upvotes: 1

Views: 2509

Answers (3)

awmross
awmross

Reputation: 3839

We use the TppDBBarcode component from ReportBuilder to print barcodes.

Upvotes: 0

Stijn Sanders
Stijn Sanders

Reputation: 36850

I've worked with label printers that connect to a serial port, and most of them know how to print a barcode, all you need to do is tell them where, what code and which symbiology. Depending of the brand and type of the label printer, your manual should tell you how to make the printer print a label. For example: Epson ESC(pdf) page C-195 or datamax-oneil's Compact4(pdf) page 15

Upvotes: 0

bummi
bummi

Reputation: 27385

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.

Upvotes: 1

Related Questions