Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Contolling Adobe Acrobat reader from VFP
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00403587
Message ID:
00403595
Views:
22
I use the following routine to generate a report and open the acroreader to show it. Jus must check www.west-wind.com where Rick has a good documentation and the classes to generate your PDF file Download from http://www.west-wind.com/Webtools.asp)
Also is importatn the Acrobat doc. to understand how to control the acro Object.
Hope help you.


*SET PROCEDURE TO WWAPI ADDITIVE && west-wind class
SET PROCEDURE TO WWPDF ADDITIVE && west-wind class

myreport_name="test.frx"

oPDF=CREATE("wwPDF40")
*- Pdf path and name - sys(2023) current temp directory
lcOutfile=SYS(2023)+"\"+LEFT(myreport_name),4)+RIGHT(SYS(3),4)+".pdf"

*- Call a method of Rick's class
lcpdf=oPDF.PrintReport(ALLTRIM(myreport_name),lcOutfile,"")

*- View Document .Using Acroreader,can be used other window
IF TYPE("oAcroRead")<>"O"
oAcroRead=CREATEOBJECT("AcroExch.app")
ENDIF
IF TYPE("oAcroRead")=="O"
oAcroRead.SHOW
IF TYPE("oAcrodoc")<>"O"
oAcrodoc=CREATEOBJECT("AcroExch.Avdoc")
ENDIF
IF TYPE("oAcrodoc")=="O"
oAcrodoc.SetviewMode(1)
oAcroRead.MenuItemExecute("ShowHideBookMarks")
oAcrodoc.OPEN(lcOutfile,"MY REPORT")
oAcroRead.Maximize(.T.)
oAcroRead.MenuItemExecute("ShowHideBookMarks")
ELSE
WAIT WIND "Acrobat View Server Not Created" TIMEOUT 3
ENDIF
ELSE
WAIT WIND "Acrobat Server Not Created" TIMEOUT 3
ENDIF

Juan C.
"Anyone who has never made a mistake has never tried anything new." A.E
"The important thing is not to stop questioning. Curiosity has its own reason for existing." A.E
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform