![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
|||
|
|||
|
De esta forma envío el archivo con los códigos de escape y funciona muy bien y muy rápido.
procedure TForm2.PrintFile(const sFileName: string); const iBufferSize = 32768; var Count, BytesWritten: Cardinal; hPrinter, hDeviceMode: THandle; sDevice : array[0..255] of char; sDriver : array[0..255] of char; sPort : array[0..255] of char; DocInfo: TDocInfo1A; f: File; pBuffer: Pointer; begin Printer.PrinterIndex := etiqueta.ItemIndex ; Printer.GetPrinter(sDevice, sDriver, sPort, hDeviceMode); if not WinSpool.OpenPrinter(@sDevice, hPrinter, nil) then exit; DocInfo.pDocName := 'Etiqueta; DocInfo.pDatatype := 'RAW'; DocInfo.pOutputFile := nil; if StartDocPrinter(hPrinter, 1, @DocInfo) = 0 then begin WinSpool.ClosePrinter(hPrinter); exit; end; if not StartPagePrinter(hPrinter) then begin EndDocPrinter(hPrinter); WinSpool.ClosePrinter(hPrinter); exit; end; System.Assign(f, sFileName); try Reset(f, 1); GetMem(pBuffer, iBufferSize); while not eof(f) do begin Blockread(f, pBuffer^, iBufferSize, Count); if Count > 0 then begin if not WritePrinter(hPrinter, pBuffer, Count, BytesWritten) then begin EndPagePrinter(hPrinter); EndDocPrinter(hPrinter); WinSpool.ClosePrinter(hPrinter); FreeMem(pBuffer, iBufferSize); exit; end; end; end; FreeMem(pBuffer, iBufferSize); EndDocPrinter(hPrinter); WinSpool.ClosePrinter(hPrinter); finally System.Closefile(f); end; end; procedure TForm2.SpeedButton2Click(Sender: TObject); begin PrintFile('C:\........\fichero.txt'); end; |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Como imprimir un fichero con codigos escape | comba | Impresión | 3 | 05-08-2006 03:26:21 |
| codigos escape | bernat_f | Impresión | 4 | 17-06-2006 18:27:57 |
| Codigos Escape Impresora Sansumg | serhasae | Varios | 3 | 05-09-2005 10:40:17 |
| Codigos de escape con Zreport | Sick boy | Impresión | 0 | 22-07-2005 12:27:13 |
| Codigos de escape | jsanchez | Impresión | 1 | 17-05-2003 13:54:00 |
|