Pessoal problemas ao imprimir com TPrinter

Delphi

04/02/2004

Estou usando o seguinte código p/ imprimir uns pedidos, aqui no meu computador funciona tudo normal, quando chega no cliente ele começa a imprimir picado gera 80 paginas, ja olhei a configuração do papel da impressora eu utilizo o windows98 tudo a mesma coisa o que será ?.
Obrigado a tds !!



Procedure TFrmPedidos.Imprimir ;
Var
Pr : TextFile ;
Linha,Pular,Copia,Cont : Integer ;
Produto : String[50];
Valor,Total,Qde : String[8];
TotalCompra : Currency ;
begin
Fonte:=TFontDialog.Create(nil);
Fonte.Device:=FdPrinter ;
TotalCompra := 0 ;
Cont := 0 ;
Copia := 0 ;
Pular := 0 ;
Fonte.Font.Name:=´Courier New´;
Fonte.Font.Size:=10 ;
// Printer.Orientation := poLandscape;
// assignFile(pr,´Teste.txt´);
assignprn(pr);
rewrite(pr); //Inicia a rotina de impressão
printer.canvas.Font:=Fonte.Font; //Define a fonte de printer, como uma TFont
While Copia <> 2 do
begin
if Copia = 1 then
begin
if Cont =1 then
Pular:= 15 ;
if Cont =2 then
Pular:= 14 ;
if Cont =3 then
Pular:= 11 ;
if Cont =4 then
Pular:= 10 ;
if Cont =5 then
Pular:= 9 ;
if Cont =6 then
Pular:= 8 ;
if Cont =7 then
Pular:= 7 ;
if Cont =8 then
Pular:= 6 ;
if Cont =9 then
Pular:= 5 ;
if Cont =10 then
Pular:= 4 ;
if Cont =11 then
Pular:= 3 ;
if Cont =12 then
Pular:= 2 ;
if Cont =13 then
Pular:= 1 ;
if Cont =14 then
Pular:= 0 ;
for linha:=0 to pular do
Writeln(pr,´´);
end;
Writeln(pr,DateTostr(now)+´ ORCAMENTO ´) ;
Writeln(pr,TimeTostr(now));
Writeln(pr,´==============================================================================================´);
Writeln(pr,´ADEGA JUNQUEIRA´ +´ ´+´(0XX12)3144-1416´);
Writeln(pr,´R: SETE DE SETEMBTO,157 VL PAULISTA´) ;
Writeln(pr,´==============================================================================================´);
Writeln(pr,´CLIENTE....: ´+Module.TableClientes.FieldBYname(´Nome´ ).Text ) ;
Writeln(pr,´ENDEREÇO...: ´+Module.TableClientes.FieldBYname(´Endereco´).Text ) ;
Writeln(pr,´BAIRRO.....: ´+Module.TableClientes.FieldBYname(´Bairro´ ).Text ) ;
Writeln(pr,´==============================================================================================´);
Writeln(pr,´PRODUTO ´+´QDE ´+´VALOR ´+
´DESCONTO ´+´TOTAL´ ) ;
Tb_Vendas.First ;
While not Tb_Vendas.Eof do
begin
Produto :=Format(´¬-50s´,[Tb_Vendas.FieldByname(´Produto´ ).AsString]) ;
Qde :=Format(´¬-8s´, [Tb_Vendas.FieldByname(´Quantidade´).AsString]) ;
Valor :=FormatFloat(´#,0.00´,Tb_Vendas.FieldByname(´Valor´ ).Value) ;
Valor :=Format(´¬-8s´, [Valor]);
TotalCompra:=TotalCompra+Tb_Vendas.FieldByname(´Total´).Value ;
Total :=FormatFloat(´,0.00´,Tb_Vendas.FieldByname(´Total´ ).Value) ;
Total :=Format(´¬-8s´,[Total]);
Writeln(pr,Produto+´ ´+Qde+´ ´+Valor+´ ´+´ ´+´ ´+Total); //Escreve uma linha na memória de Printer
Tb_Vendas.Next ;
Inc(Cont)
end;
Writeln(pr,´==============================================================================================´);
Writeln(pr,´TOTAL ========> ´+FormatFloat(´#,0.00´,TotalCompra));
Inc(Copia)
end;
Tb_Vendas.First ;
// CloseFile(pr);
printer.enddoc;//Termina a impressão
Fonte.Free ;
end;


Essistemas

Essistemas

Curtidas 0

Respostas

Marconi

Marconi

04/02/2004

Eu designo a saída lpt1 assim : e funciona bem

assignfile(ArqP,´lpt1´);
rewrite(arqP);

Marconi


GOSTEI 0
Marconi

Marconi

04/02/2004

Completando

Onde voce escreveu

assignprn(pr);
rewrite(pr);

troque por

assignfile(pr,´lpt1´);
rewrite(pr);

Para mim funciona bem

Marconi


GOSTEI 0
POSTAR