Impressao na porta serial
Ola,
Estou com uma impressora com saida serial (COM2). Como faco em Delphi para imprimir nessa impressora. No caso, seria um cupom simples com dados da venda.
Desde já obrigado.
Estou com uma impressora com saida serial (COM2). Como faco em Delphi para imprimir nessa impressora. No caso, seria um cupom simples com dados da venda.
Desde já obrigado.
Canuto
Curtidas 0
Respostas
G!ov@nny_porto
11/09/2003
Ola,
Estou com uma impressora com saida serial (COM2). Como faco em Delphi para imprimir nessa impressora. No caso, seria um cupom simples com dados da venda.
Desde já obrigado.
Caro colega
Se for uma impressora fiscal voce deve procurar o fabricante caso nao seja pode ser paralela ou ate serial se for serial tambem possui dlls ou camandos para comunicação pela serial
GOSTEI 0
Anjomd
11/09/2003
não sei se isso vai te ajudar.
Código:
Const
ECF_FIM = ´|´ + #27;
ECF_LEITURA_X = 27 + ´|06´ + ECF_FIM;
.
.
.
procedure TfrmCAIXA_bematech.LeiruraX1Click(Sender: TObject);
var iResp : Integer;
begin
if MessageDlg(´Confirma a impressão de leitura X?´,mtConfirmation,[mbYes,mbNo],0)<>mrYes then exit;
iResp := FormataTX( PChar( ECF_LEITURA_X ) );
If iResp<>0 then
Begin
MessageDlg(´Falha ao tentar efetuar leitura X.´, mtError, [mbOk], 0 );
End;
Analisa_Retorno;
end;
Bematech - Leitura X (Nova DLL)
Código:
Function Bematech_FI_LeituraX:Integer; StdCall; External ´BEMAFI32.DLL´ ;
.
.
.
procedure TfrmCAIXA_bematech.LeiruraX1Click(Sender: TObject);
begin
if MessageDlg(´Confirma a impressão de leitura X?´,mtConfirmation,[mbYes,mbNo],0)<>mrYes then exit;
iRetorno := Bematech_FI_LeituraX;
if iRetorno <> 1 then
Begin
MessageDlg(´Falha ao tentar efetuar leitura X.´, mtError, [mbOk], 0 );
End;
Analisa_iRetorno;
end;
Sigtron - Daruma (ActiveX) [mais de três anos sem atualização]:
Código:
procedure TfrmPDV.LeituraX1Click(Sender: TObject);
begin
if MessageDlg(´Confirma a impressão da leitura X (Início do expediente)?´,mtConfirmation,[mbYes,mbNo],0)<>mrYes then
begin
Exit;
end;
Sig.LibName := ´Fiscal´;
Sig.CmdName := ´LeituraX´;
cbRet := Sig.Send;
end;
Sweda [mais de quatro anos sem atualização]
Código:
Function ECFWrite( Comando: PChar ): // String para impressão
LongInt; StdCall; // 0=Sucesso
External ´SWECF.DLL´ Index 3;
Const
ECF_FIM = ´}´;
ECF_LEITURA_X = #27 + ´.13´ + ECF_FIM;
procedure TfrmCaixa_Sweda.LeiruraX1Click(Sender: TObject);
begin
If ECFWrite( PChar( ECF_LEITURA_X ) ) <> 0 Then
Begin
TratarErro( ´Efetuar leitura X´ );
End;
end;
Código:
Const
ECF_FIM = ´|´ + #27;
ECF_LEITURA_X = 27 + ´|06´ + ECF_FIM;
.
.
.
procedure TfrmCAIXA_bematech.LeiruraX1Click(Sender: TObject);
var iResp : Integer;
begin
if MessageDlg(´Confirma a impressão de leitura X?´,mtConfirmation,[mbYes,mbNo],0)<>mrYes then exit;
iResp := FormataTX( PChar( ECF_LEITURA_X ) );
If iResp<>0 then
Begin
MessageDlg(´Falha ao tentar efetuar leitura X.´, mtError, [mbOk], 0 );
End;
Analisa_Retorno;
end;
Bematech - Leitura X (Nova DLL)
Código:
Function Bematech_FI_LeituraX:Integer; StdCall; External ´BEMAFI32.DLL´ ;
.
.
.
procedure TfrmCAIXA_bematech.LeiruraX1Click(Sender: TObject);
begin
if MessageDlg(´Confirma a impressão de leitura X?´,mtConfirmation,[mbYes,mbNo],0)<>mrYes then exit;
iRetorno := Bematech_FI_LeituraX;
if iRetorno <> 1 then
Begin
MessageDlg(´Falha ao tentar efetuar leitura X.´, mtError, [mbOk], 0 );
End;
Analisa_iRetorno;
end;
Sigtron - Daruma (ActiveX) [mais de três anos sem atualização]:
Código:
procedure TfrmPDV.LeituraX1Click(Sender: TObject);
begin
if MessageDlg(´Confirma a impressão da leitura X (Início do expediente)?´,mtConfirmation,[mbYes,mbNo],0)<>mrYes then
begin
Exit;
end;
Sig.LibName := ´Fiscal´;
Sig.CmdName := ´LeituraX´;
cbRet := Sig.Send;
end;
Sweda [mais de quatro anos sem atualização]
Código:
Function ECFWrite( Comando: PChar ): // String para impressão
LongInt; StdCall; // 0=Sucesso
External ´SWECF.DLL´ Index 3;
Const
ECF_FIM = ´}´;
ECF_LEITURA_X = #27 + ´.13´ + ECF_FIM;
procedure TfrmCaixa_Sweda.LeiruraX1Click(Sender: TObject);
begin
If ECFWrite( PChar( ECF_LEITURA_X ) ) <> 0 Then
Begin
TratarErro( ´Efetuar leitura X´ );
End;
end;
GOSTEI 0