Link to home
Start Free TrialLog in
Avatar of ivylnm
ivylnm

asked on

Label Printing

Anyone has experience in doing label printing? Can you kindly guide me how to do such printing? What method? Using Quick Report?? or other text format?
Avatar of MarcG
MarcG

You can use normal TPrinter.
With Printer.StartDoc you can start the Printing and then Paint on the printers canvas. With Printer.EndDoc you finish printing, that means now the document is ready and sent to the printer.

To get the right dimensions you have to get the printer resolution that is set and adjust your painting on the printer.canvas to the resolution (with resolution 600dpi you would need a rectangle that is two times bigger than with a 300 dpi resolution ...)
Is the data in a DataBase ?
If so, then I would suggest to use QuickReports.

Is the printer parrallel or serail ?
If serial, then it is better to put your labeldata in i.e.
a TMemo or TRichEdit, and then Dump the contents to the COM-Port.

Best regards,
The Mayor.
Hi ivylnm,

I recommend you to use QuickReport. There is no problems if your data in database or not. QR is easy tool to create labels layout, and it's easy to fill data in runtime.

-----
Igor.
ITugay is right, but I think using QuickReports is not recommended if you have to send the data to a serial printer (most label-printers are NOT parrallel).

You then have to dump the data to the COM-Port in a specific format (with sepcial charachter). This data is then a String of characters. Thats why i think it is then better to use a Tmemo to dump the data.
We use the excellent (and highly-rated) ReportBuilder from Digital Metaphors (www.digital-metaphors.com) which has inbuilt support for label printing, they have included a large range of the standard Avery labels for example in their Labels Wizard.

J.
Take a look at this question:

Mailing Labels
https://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=20168180

Hope this helps!
VSF
www.victory.hpg.com.br
Avatar of ivylnm

ASKER

The Mayor,

  I am interested in what you mentioned about Com Port thing.  May I know where I can find more details on that?  As I do realize that label printer is not working parallel.

Thanks,
Ivy
Hi Ivy,

We use Intermec labelprinters, Model 4400.
In the manuals you can find info on how to print labels to the printer.

There are 2 things to know :

1) First you have to define a label-format. You can build this format in a simple texteditor (notepad). Each format has an identity (number : E1 .. E18), and has also fields defined in it.
Example of one of our formats :
<STX><ESC>P<ETX>
<STX>E1;F1;<ETX>
<STX>L39;D0;<ETX>
<STX>D39;<ETX>
<STX>H1,TType    ;o310,130;f3;r0;c33;h1;w1;b0;d0,20;<ETX>
<STX>H2,TArtCode ;o270,130;f3;r0;c33;h1;w1;b0;d0,20;<ETX>
<STX>H3,TBatch   ;o230,130;f3;r0;c33;h1;w1;b0;d0,20;<ETX>
<STX>H4,TSpuiter ;o190,130;f3;r0;c33;h1;w1;b0;d0,20;<ETX>
<STX>H5,TKlever  ;o150,130;f3;r0;c33;h1;w1;b0;d0,20;<ETX>
<STX>H6,TDatum   ;o110,130;f3;r0;c33;h1;w1;b0;d0,20;<ETX>
<STX>H7,TUur     ;o070,130;f3;r0;c33;h1;w1;b0;d0,20;<ETX>
<STX>H8,TControle;o030,130;f3;r0;c33;h1;w1;b0;d0,20;<ETX>
<STX>H9,DType    ;o310,300;f3;r0;c33;h1;w1;b0;d0,40;<ETX>
<STX>H10,DArtcode;o270,300;f3;r0;c33;h1;w1;b0;d0,40;<ETX>
<STX>H11,DBatch  ;o230,300;f3;r0;c33;h1;w1;b0;d0,40;<ETX>
<STX>H12,DSpuiter;o190,300;f3;r0;c33;h1;w1;b0;d0,40;<ETX>
<STX>H13,DKlever ;o150,300;f3;r0;c33;h1;w1;b0;d0,40;<ETX>
<STX>H14,DDatum  ;o110,300;f3;r0;c33;h1;w1;b0;d0,40;<ETX>
<STX>H15,DUur    ;o070,300;f3;r0;c33;h1;w1;b0;d0,40;<ETX>
<STX>R;<ETX>
(With <STX> = Start of TeXt, and <ETX> = End of TeXt).

To donwload the format to the printer (on COM1) :
I use the FileCopy-Funtion of Delphi :
  CopyFile(PChar('Format.Txt') , PChar('COM1') , False);


Now making labels is pretty much the same. I put all the data in a textfile and then use the same FileCopy-Function to dump this datafile to the printer.
Example of a datafile (= data of 1 label) :
The first line is needed in order to let the printer know which format it must use. The other lines are just data, that must appear on the label (Type, Code Art, ...)
Each line MUST begin with <STX> and ends with <ETX>

<STX><ESC>E1<ETX>
<STX><CAN><ETX>
<STX>Type     :<CR><ETX>
<STX>Code Art :<CR><ETX>
<STX>Nr Batch :<CR><ETX>
<STX>Encoll.  :<CR><ETX>
<STX>Elabor.  :<CR><ETX>
<STX>Date     :<CR><ETX>
<STX>L'heure  :<CR><ETX>
<STX>Controle :<CR><ETX>
<STX>Arriere Gauche K  -  Acier<CR><ETX>
<STX>A3042908<CR><ETX>
<STX>31.15.79.81<CR><ETX>
<STX>Hilde Verhoeven<CR><ETX>
<STX>e de keyser ann<CR><ETX>
<STX>ma 03/09/2001<CR><ETX>
<STX>08:45:47<CR><ETX>
<STX><ETB><ETX>


I hope i have give you enough information to start your reseacrh.

Best regards,
The Mayor.

P.S. : The main thing is that you create a textfile and dump it to the com-port with FileCopy.
The contents of the file is linked to the brand of printer you are using. this info should be available in the manuals.





Avatar of ivylnm

ASKER

So what do you mean is it still depends on what kind of label printer that you are using ya.  
ASKER CERTIFIED SOLUTION
Avatar of wimmeyvaert
wimmeyvaert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ivylnm

ASKER

Oh thanks for your detailed description.  Now I realize that there is so much different in label printing.  Actually I have not had any idea that what kind of label printer that I will be using.  But I need to pick up the method to do the printing now.  So from your information and explaination, I can see that label printing will use another kind of printer and every kind of label printer will have its own format.  At first, I thought I will be using normal printer to print the labels.  Maybe if I find out what kind of label printer I will be using later on.  Thanks a lot.