Controlling Acrobat Reader with COM

Sam scorder at incigna.com
Tue Jun 27 12:07:08 EDT 2000


On Mon, 26 Jun 2000 21:59:51 -0400, "Andres Corrada-Emmanuel"
<andres at mail.mamey.com> wrote:

>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
Try typing these strings directly into the interpreter.

>>> print 'c:\test\readme.pdf'
c:	est
eadme.pdf
>>> print "c:\test\readme.pdf"
c:	est
eadme.pdf
>>> print 'c:\\test\\readme.pdf'
c:\test\readme.pdf
>>> print 'c:/test/readme.pdf'
c:/test/readme.pdf



More information about the Python-list mailing list