steveellis99 Posted May 29, 2012 Share Posted May 29, 2012 Greetings all, I'm wondering if anyone can post a sample script/snippet of working AutoIT code that opens a PDF into an AutoIT GUI? I have Acrobat professional installed and can use the object methods to drive most parts, but I have been simply unable to get the AVDoc.OpenInWindowEx method to work. I can use the DrawEx, but can't figure out what's wrong with actually opening a file in the window. The stripped-down test code I'm using (below) draws the GUI OK, but then crashes saying "The requested action with this method has failed." Then there's a bit of a line with AutoIT3.exe ended.rc:1. I get the same error whether the OpenInWindowEx attempt is before or after the @SW_Show. I'm quite a newbie with all this, but have been searching to no avail here and on the SDK forums. Thanks, in advance, for any help anyone can provide. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase $sFile="C:\My Documents\AutoIt\Test\Test.pdf" $oApp = ObjCreate("AcroExch.App") $oAcrobat = ObjCreate("AcroExch.AVDoc") $hGUI=GUICreate("TestApp", 1225, 900,0,0,$WS_CLIPCHILDREN) $GUI_ActiveX = GUICtrlCreateObj($oApp, 10, 10, 800, 875) GUISetState (@SW_SHOW) sleep(2000) $result = $oAcrobat.OpenInWindowEx($sFile,$GUI_ActiveX,"AV_DOC_VIEW",0,0,0,0,0,0,0) Link to comment Share on other sites More sharing options...
water Posted May 29, 2012 Share Posted May 29, 2012 What do you want to do? Just display a PDF in a GUI or more? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
steveellis99 Posted May 29, 2012 Author Share Posted May 29, 2012 Ultimately, I'd want to display and navigate through the document (Find target words and move through). But just displaying would be a big step forward for me! I'm workign with a pretty restricted environment, so we can't install other PDF readers and such. It has to work with/through Acrobat. Link to comment Share on other sites More sharing options...
water Posted May 29, 2012 Share Posted May 29, 2012 To display a PDF in a GUI you could start My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted May 29, 2012 Share Posted May 29, 2012 Never done it myself but when you search the forum for "AcroExch" you will find a lot of threads. Hopefully there is something useful in the search result. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
steveellis99 Posted May 29, 2012 Author Share Posted May 29, 2012 I had started there a while back and actually got an embedded version of the Acrobat Reader working OK based on that example. The challenge has been how to embed the actual Acrobat window (because more of the IAC controls are available through AcroExch than the AcroReader). The OpenInWindowEx is supposed to do the trick...but so far not for me. My other scripts to drive and control actual Acrobat windos work fine, so it doesn't seem like and Acrobat installation problem. Many thanks for the feedback and suggestions. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now