Controlling Acrobat Reader with COM

Andres Corrada-Emmanuel andres at mail.mamey.com
Mon Jun 26 21:59:51 EDT 2000


Hi,

I'm trying to develop an application that will print (as in a paper copy) a PDF file automatically on Win32. I've used Mark Hammond's genpy utility to create a wrapper around "Acrobat Control for ActiveX". I'm able to get a handle on Acrobat but cannot execute any of its registered methods:

>>> from win32com.client import Dispatch
>>> acro = Dispatch('PDF.PdfCtrl.1')
>>> acro.LoadFile(fileName='C:\Temp\ReadMe.pdf')
Traceback (innermost last):
  File "<interactive input>", line 1, in ?
  File "C:\Program Files\Python\win32com\gen_py\CA8A9783-280D-11CF-A24D-444553540000x0x1x3.py", line 30, in LoadFile
    return self._oleobj_.InvokeTypes(0x2, LCID, 1, (11, 0), ((8, 0),),fileName)
com_error: (-2147418113, 'Unexpected failure', None, None)

I'm very much a COM newbie, so this traceback means very little to me. Could someone enlighten me on what is going wrong in this case? I have no problem controlling Word with my setup so I'm stumped on this one.

Andres Corrada




More information about the Python-list mailing list