• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 398
  • Last Modified:

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?
0
ivylnm
Asked:
ivylnm
1 Solution
 
MarcGCommented:
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 ...)
0
 
wimmeyvaertCommented:
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.
0
 
ITugayCommented:
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.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
wimmeyvaertCommented:
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.
0
 
jswebyCommented:
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.
0
 
VSFCommented:
Take a look at this question:

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

Hope this helps!
VSF
www.victory.hpg.com.br
0
 
ivylnmAuthor Commented:
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
0
 
wimmeyvaertCommented:
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.





0
 
ivylnmAuthor Commented:
So what do you mean is it still depends on what kind of label printer that you are using ya.  
0
 
wimmeyvaertCommented:
As far as I know, it depends on the brand of printer you are using.
But I think that you always have to download The labelformat to the printer, before you can print any label
at all.
After all the printer should know where to put the data on the label.

Maybe I explain a bit more what's in a datafield-definition:
<STX>H3,TBatch   ;o230,130;f3;r0;c33;h1;w1;b0;d0,20;<ETX>
Where:
<STX>    = Start of TeXt
H3       = Third Human readable field  
TBatch   = FieldName (must be unique in the format)
o230,130 = origin (X,Y)
f3       = Field Direction (3 = 270? rotated)
r0       = Character rotation (0 = Horizontal)
c33      = Font number
h1       = FontHeight (1)
w2       = FontWidth (2)
b0       = Border around text (0 = None)
d0,20    = Field Data, Define Source
<ETX>    = End of TeXt.

The way of downloading (format + labeldata) is always the same : Just use the CopyFile-Function as I decribed in my previous comment.

Do you know which printerbrand(s) you are using ?
Maybe ther could be find something on the net/manuals.

Best regards,
The Mayor.
0
 
ivylnmAuthor Commented:
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.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now