// // Copyright (c) 1997-2003 JAZZAge Software SARL http://www.jazzagesoft.com // // Using the Acrobat OCX in an Xbase++ application // // Warning: to run the sample, you will need the Acrobeat 4.0 Reader, // downloadable from the following web page: // http://www.adobe.com/products/acrobat/readstep.html #include "Gra.ch" #include "Xbp.ch" #include "Appevent.ch" #include "Font.ch" #include "THREAD.CH" #include "\JACE31\INCLUDE\JACE31XPP.ch" #define _Pdf_ #include "\JACE31\Samples\Xbase++\Acrobat.PRG" PROCEDURE OpenPropertyPage(oAcrobat) LOCAL ret ret=JAXPPOpenControlPropertyPage(oAcrobat:GetPUnk(),JAHANDLE_PUNK) RETURN PROCEDURE Main LOCAL oDlg LOCAL oAcrobat LOCAL w,h LOCAL punk LOCAL nEvent, mp1, mp2 LOCAL path LOCAL oPBPropertyPage LOCAL cCode oDlg := XbpDialog():new( AppDesktop(), , {100,100}, {600,600}, , .F.) oDlg:taskList := .T. oDlg:title := "Acrobat OCX Test Form" oDlg:MaxButton:=.F. oDlg:MinButton:=.F. oDlg:create() // Create an ActiveX instance in the Form client area, and wrap it in an Xbase++ class instance oAcrobat:= Pdf():new() w:=oDlg:drawingArea:currentSize()[1] h:=oDlg:drawingArea:currentSize()[2] // for Acrobat 4.0 cCode="ProgID:PDF.PdfCtrl.1" punk:=JAXPPCREATECONTROL(oDlg:drawingArea:getHWND(),"Acrobat1",8,32,w-2*8,h-(32+8),cCode,0) // for Acrobat 5.0 //cCode="ProgID:PDF.PdfCtrl.5" //punk:=JAXPPCREATECONTROL(oDlg:drawingArea:getHWND(),"Acrobat1",8,32,w-2*8,h-(32+8),cCode,0) JAXPPSetControlResizeStyle(punk,JAHANDLE_PUNK,JARESIZESTYLE_X2RIGHT + JARESIZESTYLE_Y2BOTTOM) oAcrobat:Connect(punk) oPBPropertyPage:=XbpPushButton():new( oDlg:drawingArea, , {12,5}, {80,20} ) oPBPropertyPage:create() oPBPropertyPage:setcaption("&PropertyPage") oPBPropertyPage:activate := {|| OpenPropertyPage(oAcrobat)} JAXPPSetControlAccelerator(oPBPropertyPage:getHWND(),JAHANDLE_HWND,"P") oDlg:show() path:=CURDRIVE()+":\Jace31\Doc\JACE31.pdf" oAcrobat:LoadFile(path) nEvent := xbe_None DO WHILE nEvent <> xbeP_Close nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO // Required oAcrobat:Disconnect() RETURN