Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #8  
Antiguo 06-12-2011
Avatar de ethangio
ethangio ethangio is offline
Miembro
 
Registrado: jul 2008
Posts: 63
Poder: 19
ethangio Va por buen camino
No he podido conseguir que corte el papel, sigue imprime los caracteres ascii correspondientes ...
Miren encontré este ejemplo en el foro
enviandole como parametros, el nombre de la impresora ya sea local o en red y la cadena pero la cadena con la que corta es esta
\x1B@\x0A\x0D\x1Bi\x0A\x0D
.... Pero por que no quiere cortar con #27 # 109 o #105

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;

Dejo la liga por si alguien le sirve asi :
http://delphi.jmrds.com/?q=node/50

y este

http://www.clubdelphi.com/foros/showthread.php?t=54626

En el segundo esta el codigo ..
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
FastReport+Corte de papel+tamaño de papel Cheerpipe Impresión 3 25-03-2008 17:55:53
Corte de papel de epson tm u220b BBTO Impresión 2 12-05-2006 19:44:59
Como forzar corte de papel en una impresora de tickets Javi2 Impresión 1 20-01-2006 18:46:49
Traer los tipos de papel de una impresora ElCherchu Impresión 2 07-05-2005 15:47:17
Corte papel en impresora Epson superfer17 Impresión 4 01-04-2004 17:08:49


La franja horaria es GMT +2. Ahora son las 06:46:44.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi