Ver Mensaje Individual
  #5  
Antiguo 18-09-2012
Avatar de newtron
[newtron] newtron is offline
Membrillo Premium
 
Registrado: abr 2007
Ubicación: Motril, Granada
Posts: 3.474
Reputación: 21
newtron Va camino a la fama
Hola.

Te monto un pequeño ejemplo (sin probar).

Código Delphi [-]
if not OpenPrinter(PChar(NombreImpresora), Handle, nil) then begin
    ShowMessage('Error en OpenPrinter : ' + NombreImpresora);
    Exit;
end;
with DocInfo1 do begin
  pDocName    := PChar('Etiqueta ');
  pOutputFile := nil;
  pDataType   := 'RAW';
end;

StartDocPrinter(Handle, 1, @DocInfo1);

StartPagePrinter(Handle);

// Suponemos que hemos abierto el fichero de texto, leido sus lineas
// y que las tenemos en una lista llamada fslLineaImpreso
// También puedes abrir el fichero de texto y mandar el WritePrinter directamente

for f:=0 to fslLineaImpreso.Count-1 do begin
  Linea := fslLineaImpreso[f] + #10 + #13;
  WritePrinter(Handle, PChar(Linea), Length(Linea), N);
end;

EndPagePrinter(Handle);

EndDocPrinter(Handle);

Saludos
__________________
Be water my friend.
Responder Con Cita