Imprimir archivo .TXT con Printer.prg
- karinha
- Posts: 7948
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Imprimir archivo .TXT con Printer.prg
Buenos dias, como hago para imprimir archivos *.TXT con PRINTER.PRG?
Gracias, saludos.
Gracias, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: Imprimir archivo .TXT con Printer.prg
Code: Select all | Expand
#include "fivewin.ch"
function Main()
local cText := MEMOREAD( "c:\fwh\samples\yunus.prg" )
local oPrn, oFont
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "COURIER NEW" SIZE 0,-10 OF oPrn
do while !Empty( cText )
PAGE
@ 1,1 PRINT TO oPrn TEXT @cText SIZE 7,10 INCHES FONT oFont
ENDPAGE
enddo
ENDPRINT
RELEASE FONT oFont
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- karinha
- Posts: 7948
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Imprimir archivo .TXT con Printer.prg
Perfecto Mister Rao y Aun, puedo generar el PDF del .TXT.
Regards, saludos.
Code: Select all | Expand
#Include "FiveWin.ch"
FUNCTION Main()
LOCAL cText := MEMOREAD( "c:\fwh\samples\yunus.prg" )
LOCAL oPrn, oFont
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "COURIER NEW" SIZE 0, -10 OF oPrn
WHILE .NOT. EMPTY( cText )
SYSREFRESH()
PAGE
@ 1, 1 PRINT TO oPrn TEXT @cText SIZE 7, 10 INCHES FONT oFont
ENDPAGE
ENDDO
IF lPdfImp
// Problem:
oPrn:lMeta = .F. // .T. -> Defecto - .F. Genera el PDF.
ENDIF
ENDPRINT
IF lPdfImp
FWSavePreviewToPDF( oPrn, "ARCHIVO.pdf", .F. )
ENDIF
RELEASE FONT oFont
RETURN NIL
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: Imprimir archivo .TXT con Printer.prg
This generates the pdf silently.
This generates pdf first and then shows the pdf file in default application.
Code: Select all | Expand
#include "fivewin.ch"
function Main()
local cText := MEMOREAD( "c:\fwh\samples\yunus.prg" )
local oPrn, oFont
PRINT oPrn FILE "archivo.pdf"
DEFINE FONT oFont NAME "COURIER NEW" SIZE 0,-10 OF oPrn
do while !Empty( cText )
PAGE
@ 1,1 PRINT TO oPrn TEXT @cText SIZE 7,10 INCHES FONT oFont
ENDPAGE
enddo
ENDPRINT
RELEASE FONT oFont
return nil
This generates pdf first and then shows the pdf file in default application.
Code: Select all | Expand
PRINT oPrn PREVIVEW FILE "archivo.pdf"
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- karinha
- Posts: 7948
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Imprimir archivo .TXT con Printer.prg
Perfeito... Perfect Mister Nages!!! Many thanks.
Regards, saludos.
Code: Select all | Expand
#Include "FiveWin.ch"
FUNCTION Main()
LOCAL WNOMBREARQPDF
MsgRun( "GENERANDO ARCCHIVO *.PDF...", ;
"Por Favor, Aguarde... ", ;
{ || WinExec( Generar_PDF() ), 3 } )
// Perfect, mister Nages, Thank You
IF FILE( "ARCHIVO.PDF" )
WNOMBREARQPDF := "c:\fwh\samples\archivo.pdf"
ShellExecute( 0, "Print", WNOMBREARQPDF,,, 3 )
ENDIF
RETURN NIL
FUNCTION Generar_PDF()
LOCAL cText := MEMOREAD( "c:\fwh\samples\arq.txt" )
LOCAL oPrn, oFont
PRINT oPrn FILE "archivo.pdf"
DEFINE FONT oFont NAME "COURIER NEW" SIZE 0,-10 OF oPrn
WHILE .NOT. EMPTY( cText )
SYSREFRESH()
CURSORWAIT()
PAGE
@ 1,1 PRINT TO oPrn TEXT @cText SIZE 7,10 INCHES FONT oFont
ENDPAGE
ENDDO
ENDPRINT
RELEASE FONT oFont
CURSORARROW()
RETURN NIL
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- FranciscoA
- Posts: 2164
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: Imprimir archivo .TXT con Printer.prg
nageswaragunupudi wrote:This generates the pdf silently.Code: Select all | Expand
#include "fivewin.ch"
function Main()
local cText := MEMOREAD( "c:\fwh\samples\yunus.prg" )
local oPrn, oFont
PRINT oPrn FILE "archivo.pdf"
DEFINE FONT oFont NAME "COURIER NEW" SIZE 0,-10 OF oPrn
do while !Empty( cText )
PAGE
@ 1,1 PRINT TO oPrn TEXT @cText SIZE 7,10 INCHES FONT oFont
ENDPAGE
enddo
ENDPRINT
RELEASE FONT oFont
return nil
This generates pdf first and then shows the pdf file in default application.Code: Select all | Expand
PRINT oPrn PREVIVEW FILE "archivo.pdf"
Sr. Rao.
A partir de cual versión funciona esto?
Gracias.
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
- FranciscoA
- Posts: 2164
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: Imprimir archivo .TXT con Printer.prg
nageswaragunupudi wrote:FWH1304
Muchas gracias.
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
Chinandega, Nicaragua.
Fwxh-MySql-TMySql