Hello Antonio, hello Reinaldo,
I use the same technique to preview word documents.
The advantage is that you have on a 22" screen a 100% size preview not only a small jpg like inside the docx file.
Best regards,
Otto
Function OpenPdf(cTempFile,cReport)
LOCAL oWnd, oPdf
Default cReport := cTempFile
DEFINE WINDOW oWnd TITLE cReport
oPdf = TActiveX():New( oWnd, "AcroPDF.PDF" )
oPdf:LoadFile := cTempFile
oWnd:oClient = oPdf
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT SETWINDOWPOS( oWnd:hWnd, -1, 0, 0, 0, 0, 3 ) ;
VALID (oPdf:End(), .T. )
FUNCTION TestPDF1()
*-----------------
local oPrn
PRINT oPrn PREVIEW
PAGE
oPrn:CmSay( 2, 2, "Hello world" )
ENDPAGE
oPrn:lMeta = .F.
ENDPRINT
FWSavePreviewToPDF( oPrn, "boris.PDF", .T. )
return nil
#include "FiveWin.ch"
#include "print.ch"
#include "report.ch"
FUNCTION TestPDF()
//------------------
LOCAL oFont1, oFont2
LOCAL oReport, oPrn
LOCAL aPodaci := {}
LOCAL nElement := 1
AADD(aPodaci, "AAAAAAAAAAAAAAA")
AADD(aPodaci, "BBBBBBBBBBBBBBB")
AADD(aPodaci, "CCCCCCCCCCCCCCC")
AADD(aPodaci, "DDDDDDDDDDDDDDD")
AADD(aPodaci, "EEEEEEEEEEEEEEE")
AADD(aPodaci, "FFFFFFFFFFFFFFF")
AADD(aPodaci, "GGGGGGGGGGGGGGG")
DEFINE FONT oFont1 NAME "Courier New CE" SIZE 0,-10
DEFINE FONT oFont2 NAME "Courier New CE" SIZE 0,-10 BOLD
PRINT oPrn FILE "boris09.pdf"
REPORT oReport TITLE " ", ;
"TEST REPORT" , ;
"(PRINTED DIRECTLY TO PDF)" ;
FOOTER "Page " + Str( oReport:nPage, 4, 0 ) CENTERED ; // "Page"
FONT oFont1, oFont2 ;
TO DEVICE oPrn
COLUMN TITLE " " DATA aPodaci[nElement] FONT 1
END REPORT
*oReport:CellView()
oReport:bSkip := {|| nElement++ }
ACTIVATE REPORT oReport ;
WHILE nElement <= LEN(aPodaci)
oPrn:End()
RETURN nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 88 guests