BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delphi 7 Printing problems

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting
View previous topic :: View next topic  
Author Message
BF
Guest





PostPosted: Thu Feb 16, 2006 4:03 pm    Post subject: Delphi 7 Printing problems Reply with quote



Hi everybody,
i'm finding several problems in development of a simple printing
application.

If this isn't the right NG for this kind of issue, please redirect me to
the right one.

[i'm sorry for my bad English]

I have to print simple text from a file on a thermal printer (a Zebra
Z4M), on a set of labels, for industrial purpose.
Code is the following

Function _Print(fileToPrint:String):boolean;
var fileIn:File Of Char;
fileOut:TextFile;
sRow:String;
cBuffer:Char;
begin
If Printer.ExecuteSetup then
begin
AssignFile(FileIn, fileToPrint);
AssignPrn(FileOut,Printer);
Reset(FileIn);
ReWrite(FileOut);
sRow:='';
cBuffer:=#0;
while not Eof(FileIn) do
begin
Read(FileIn,cBuffer);
sRow:=sRow+cBuffer;
end;
Write(fileOut,sRow);
CloseFile(FileIn);
CloseFile(FileOut);
_Print:=True;
end
Else _Print:=False;
end;

As you see, this routine is very simple.
When it starts printing, all seem to go in the right way.
But it can happen that some labels to print are missed during printing
process. For example, I printed a job of about 700 labels; at the end, i
noticed that about 10 labels (randomly distributed) were not printed.
Than i tried to run that job again... exactly the same result (same
labels missed)!!!
So i thought that those missed labels could contain special characters,
not correctly "recognized" by printer: so i tried to "cut" those labels
from text file they came from and print them manually. No problems...
printing was successful, no label missed.
All these tests were done on a machine with Windows 2000.

Could it be a buffering problem? And, if so, is it possible that exactly
the same labels were not printed in two following jobs?

What can I do? Is there another way to print text files in delphi?

Thank you very much for your support.

Fabrizio
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.