Buenos dias, como hago para imprimir archivos *.TXT con PRINTER.PRG?
Gracias, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Buenos dias, como hago para imprimir archivos *.TXT con PRINTER.PRG?
Gracias, saludos.
#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#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#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 PRINT oPrn PREVIVEW FILE "archivo.pdf"#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 NILnageswaragunupudi wrote:This generates the pdf silently.
#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.
PRINT oPrn PREVIVEW FILE "archivo.pdf"
FWH1304
nageswaragunupudi wrote:FWH1304