Ver Mensaje Individual
  #1  
Antiguo 24-08-2017
Avatar de oscarac
[oscarac] oscarac is offline
Miembro Premium
 
Registrado: sep 2006
Ubicación: Lima - Perú
Posts: 2.010
Reputación: 20
oscarac Va por buen camino
Impresion linea por linea en Impresora Termica

buenos dias

tengo una rutina de impresion (que la saque de aqui) y que me funciona bien en las impresoras matriciales que es esta de aqui

Código Delphi [-]
function WriteRawDataToPrinter(PrinterName: String; Str: String): Boolean;
var
  PrinterHandle: THandle;
  DocInfo: TDocInfo1;
  i: Integer;
  B: Byte;
  Escritos: DWORD;
begin
  Result:= FALSE;
  if OpenPrinter(PChar(PrinterName), PrinterHandle, nil) then
  try
    FillChar(DocInfo,Sizeof(DocInfo),#0);
    with DocInfo do
    begin
      pDocName:= PChar('Printer Test');
      pOutputFile:= nil;
      pDataType:= 'RAW';
    end;
    if StartDocPrinter(PrinterHandle, 1, @DocInfo) <> 0 then
    try
      if StartPagePrinter(PrinterHandle) then
      try
        while Length(Str) > 0 do
        begin
          if Copy(Str, 1, 1) = '\' then
          begin
            if Uppercase(Copy(Str, 2, 1)) = 'X' then
              Str[2]:= '$';
            if not TryStrToInt(Copy(Str, 2, 3),i) then
              Exit;
            B:= Byte(i);
            Delete(Str, 1, 3);
          end else B:= Byte(Str[1]);
          Delete(Str,1,1);
          WritePrinter(PrinterHandle, @B, 1, Escritos);
        end;
        Result:= TRUE;
      finally
        EndPagePrinter(PrinterHandle);
      end;
    finally
      EndDocPrinter(PrinterHandle);
    end;
  finally
    ClosePrinter(PrinterHandle);
  end;
end;


el problema esta que cuando lo utilizo en la impresora termica, la impresion sale linea por linea y no de golpe, como se acostumbra a imprimir en esas impresoras.

la idea que tengo es crear un reporte (con quickreport) elaborar el ticket y mandarlo a imprimir de forma directa
la pregunta es, como hago para que se haga el corte de papel, como mando la secuencia de escape
Código Delphi [-]
  WriteRawDataToPrinter('Epson',#27+'m' + Chr(10) + Chr(13));

en el quickreport

se entiende?
alguien tiene una solucion?
__________________
Dulce Regalo que Satanas manda para mi.....
Responder Con Cita