Solved

Label Printing

Posted on 2001-08-30
11
371 Views
Last Modified: 2010-04-06
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
Comment
Question by:ivylnm
11 Comments
 
LVL 3

Expert Comment

by:MarcG
ID: 6439956
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
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6439987
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
 
LVL 9

Expert Comment

by:ITugay
ID: 6440015
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
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6440029
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
 
LVL 4

Expert Comment

by:jsweby
ID: 6440229
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Expert Comment

by:VSF
ID: 6440230
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
 

Author Comment

by:ivylnm
ID: 6446990
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
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6449884
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
 

Author Comment

by:ivylnm
ID: 6452055
So what do you mean is it still depends on what kind of label printer that you are using ya.  
0
 
LVL 6

Accepted Solution

by:
wimmeyvaert earned 200 total points
ID: 6452269
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
 

Author Comment

by:ivylnm
ID: 6452502
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now