views:

403

answers:

6

Hello

I bought an entry-level Brother label printer, and I need to print this type of label from Delphi:

http://img54.imageshack.us/img54/3557/delphiclothlabel2.jpg

(The barcode was simply created using the free 3of9 TTY font, although some VCL components are available to create a barcode directly.)

I read that the standard way is to use Rave Reports, but it looks like a pretty big tool and I've never used it before.

Before I go ahead and spend time learning Rave Reports, I'd like to ask experience Delphi developers whether there aren't easier ways to do this. For instace, what about creating some image on-the-fly and send this to the printer?

Thank you.

+2  A: 

If you have the barcode available as an image, you can just print it using the Printer object in unit Printers.

uses
  Printers;
...
Printer.BeginDoc;
try
  Printer.Canvas.Draw (PosX, PosY, FBarcodeBitmap);
finally
  Printer.EndDoc;
end;

If you just want to print the barcode, this might be easier than get yourself used to Rave Reports.

Smasher
A: 

Common barcodes contains CRC, so "barcode font" is not working. You have to use some reporting engine or create barcode by hand using some Barcode Component.

DiGi
Code 39 does not have a CRC, but it does have a start and stop character (*) that you must remember to include.
Scott W
That said, a true barcode component will provide better results with fewer headaches and is probably worth the money if this is a commercial project.
Scott W
A: 

You can use the standard TRichEdit component. It have the Print method. Simply:

  rich1.Print('title');

Regards.

Neftalí
A: 

While you certainly could render your canvas in code and then shove it off to the printer, I think that you will find value in using a reporting tool. We have used QuickReports for years to generate our barcode labels with great success.

The biggest value that I see of a reporting tool over rendering to a canvas in code is the WYSIWYG aspect of the reporting tool. You will be able to much of your layout and tweaking on screen at design-time.

Scott W
A: 

Thanks for the input. I'll start with QuickReports to see if it works OK for this and do some tests with the 3of9 font to see how it goes. I wonder how the label printer manages to know if the label is right where it's supposed to be so that the printing always starts right, though.

This is not an answer to your question. You should use comments or edit your question.
Smasher
I can't speak for all label printers, but I know that the Zebra printers that I have worked with actually have sensors to tell the difference between a "label" and a "gap" between the labels. As such, it always knows exactly where the labels are positioned.
Scott W
Too late, as I bought the Brother printer. If pre-cut stickers prove to be a problem, I'll use continuous stickers.
OverTheRainbow
A: 

I use Fast Reports to print my barcodes. it has built in barcode support which makes it pretty easy to use.

SeanX