Acrobat activex - problems with old Acrobat versions

Acrobat activex - problems with old Acrobat versions

Postby Marco Turco » Fri Jun 06, 2008 9:09 am

Hi to all,
I have a problem using the activex class to open a pdf file because if the Acrobat Reader installed is an old version my app crash.

Is there any way to check the Acrobat Reader version before to call the activex or another way to check if we can use the Acrobat activex in that environment ?

Thanks in advance.

Sample code (from FWH):

function Main()

local oWnd, oActiveX

DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"

oActiveX = TActiveX():New( oWnd, "AcroPDF.PDF.1" )
oWnd:oClient = oActiveX // To fill the entire window surface
oActiveX:Do( "LoadFile", "fwintro.pdf" )
oActiveX:Do( "SetCurrentPage", 1 )

ACTIVATE WINDOW oWnd

return nil
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Postby MGA » Fri Jun 06, 2008 11:06 am

if ! PDFActivex(@arq)
return(.f.)
endif

DEFINE WINDOW oWndpdf MDICHILD OF oWnd vscroll icon oico TITLE ALLTRIM(cFile)
pdfoActiveX = TActiveX():New( oWndpdf, arq )
oWndpdf:oClient = pdfoActiveX
pdfoActiveX:Do( "LoadFile", cFile )
pdfoActiveX:Do( "SetCurrentPage", 1 )
ACTIVATE WINDOW oWndpdf MAXIMIZED valid(oWndpdf:=NIL,pdfoActiveX:end(),.t.)

***********************************
Function PDFActivex(MyProgID)
***********************************
LOCAL adretor:=.T.
if IsActivex( "PDF.PdfCtrl.1" ); MyProgID := "PDF.PdfCtrl.1"; endif
if IsActivex( "PDF.PdfCtrl.2" ); MyProgID := "PDF.PdfCtrl.2"; endif
if IsActivex( "PDF.PdfCtrl.3" ); MyProgID := "PDF.PdfCtrl.3"; endif
if IsActivex( "PDF.PdfCtrl.4" ); MyProgID := "PDF.PdfCtrl.4"; endif
if IsActivex( "PDF.PdfCtrl.5" ); MyProgID := "PDF.PdfCtrl.5"; endif
if IsActivex( "PDF.PdfCtrl.6" ); MyProgID := "PDF.PdfCtrl.6"; endif
if IsActivex( "PDF.PdfCtrl.7" ); MyProgID := "PDF.PdfCtrl.7"; endif
if IsActivex( "acroPDF.PDF.1" ); MyProgID := "acroPDF.PDF.1"; endif
if IsActivex( "acroPDF.PDF.2" ); MyProgID := "acroPDF.PDF.2"; endif
if Empty( MyProgID )
msg( "PDF Activex não instalado !!!"+CRLF+" É necessário que seja instalado o programa ADOBE READER, consulte o suporte do sistema.",.f.)
adretor:=.F.
endif
return(adretor)
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests