Jump to content
Sign in to follow this  
steveellis99

Acrobat IAC and AutoIT help

Recommended Posts

steveellis99

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)

Share this post


Link to post
Share on other sites
water

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


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
steveellis99

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.

Share this post


Link to post
Share on other sites
water

To display a PDF in a GUI you could start


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
steveellis99

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×