FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FW pdf viewer?
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: FW pdf viewer?
Posted: Tue Apr 30, 2013 03:07 PM

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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FW pdf viewer?
Posted: Tue Apr 30, 2013 05:07 PM

Brilliant! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: FW pdf viewer?
Posted: Wed May 01, 2013 04:06 AM
Dear Reinaldo,

I've use Activex and it work fine for me. I've got it from the Forum (somewhere) but it need to install Acrobat Reader.
Code (fw): Select all Collapse
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. )
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FW pdf viewer?
Posted: Wed May 01, 2013 06:42 PM

Dutch,

Thanks, we forgot about this way and it seems to be the simplest one :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: FW pdf viewer?
Posted: Wed May 15, 2013 11:06 PM
Antonio, how can I test Class FWPdf in FWH 13.01 to print REPORT into PDF?
I tested on PRINTER class:
Code (fw): Select all Collapse
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

after I did the changes you suggested to the function "FWSavePreviewToPDF()"

But I cannot manage it to work for REPORT
Can you give me some suggestion please?

Thanks
Boris
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FW pdf viewer?
Posted: Tue May 21, 2013 02:05 PM
Boris,

This is the right way to do it using FWH 13.04

Code (fw): Select all Collapse
#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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 208
Joined: Wed Dec 03, 2008 04:48 PM
Re: FW pdf viewer?
Posted: Tue May 21, 2013 03:01 PM

Thanks Antonio!
Works perfect!

Continue the discussion