error to show pdf on dialog

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

error to show pdf on dialog

Post by Silvio.Falconi »

Error description: Error BASE/1004 No exported method: LOADFILE
Args:
[ 1] = U
[ 2] = C Fattura_n_000246-2018_del_02-10-2018.pdf

Stack Calls
===========
Called from: => LOADFILE( 0 )
Called from: => __OBJSENDMSG( 0 )
Called from: .\source\classes\ACTIVEX.PRG => TACTIVEX:DO( 96 )
Called from: test.prg => VISUALIZZAFILEPDF( 331 )
Called from: test.prg => XMLREADER( 232 )
Called from: test.prg => IMPORTXML( 28 )
Called from: test.prg => MAIN( 11 )


Code: Select all

 DEFINE DIALOG oDlgPdfFile  SIZE nWidth, nHeight TRANSPARENT ;
   TITLE cTitle COLOR CLR_BLACK,  nRgb( 245,244,234) ;
   STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION,  4 )

   oActiveX = TActiveX():New( oDlgPdfFile, "AcroPDF.PDF.1" ) 

   oDlgPdfFile:oClient = oActiveX // To fill the entire window surface

   oActiveX:Do( "LoadFile", cFile )
   oActiveX:Do( "SetCurrentPage", 1 )

    ACTIVATE DIALOG oDlgPdfFile CENTER






exist another method to show a pdf on a dialog ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: error to show pdf on dialog

Post by nageswaragunupudi »

Please try if this works for you.

Code: Select all

   local cPdfFile := "c:\fwh\samples\pdfharu1h.pdf" // your pdf file name
   local nDlgWidth   := 420
   local nDlgHeight  := 600

   if File( cPdfFile )
      HtmlView( TrueName( cPdfFile ), "TITLE", nil, nil, nil, nDlgWidth, nDlgHeight )
   else
      ? cPdfFile + " not found"
   endif
 
Image
Regards

G. N. Rao.
Hyderabad, India
Post Reply