Jump to content



Photo

Acrobat IAC and AutoIT help


  • Please log in to reply
5 replies to this topic

#1 steveellis99

steveellis99

    Seeker

  • Active Members
  • 6 posts

Posted 29 May 2012 - 09:31 PM

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)








#2 water

water

    ?

  • MVPs
  • 10,716 posts

Posted 29 May 2012 - 09:35 PM

What do you want to do? Just display a PDF in a GUI or more?

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#3 steveellis99

steveellis99

    Seeker

  • Active Members
  • 6 posts

Posted 29 May 2012 - 09:42 PM

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.

#4 water

water

    ?

  • MVPs
  • 10,716 posts

Posted 29 May 2012 - 09:45 PM

To display a PDF in a GUI you could start here.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#5 water

water

    ?

  • MVPs
  • 10,716 posts

Posted 29 May 2012 - 09:50 PM

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.

UDFs:

Active Directory (2012-10-12 - Version 1.3.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

OutlookEX (2012-10-07 - Version 0.9.0.0 released) - Download - General Help & Support - Example Scripts - Wiki

ExcelChart (2013-01-21 - Version 0.3.1.1 released) - Download - General Help & Support - Example Scripts

WordEX (2012-12-29 - Version 1.3 released) - Download

ExcelEX (2013-05-11 - Alpha 4 released) - Download


#6 steveellis99

steveellis99

    Seeker

  • Active Members
  • 6 posts

Posted 29 May 2012 - 09:50 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users