With code that looks like this:
instance = win32com.client.gencache.EnsureDispatch("InDesign.Application")
doc = instance.Open("some_path")
pages = doc.Pages
page0 = pages.FirstItem()
opposing_corners=((0.0, 0.0), (72.0, 72.0))
expects an array containing two arrays, where each of those two arrays contains two doubles.
If I pass in a scalar like 5.0
or a 1-D array like (1.0, 1.0)
or even if I add an extra item to the array like ((0.0, 0.0), (72.0, 72.0), 5.0) or ((0.0, 0.0), (72.0, 72.0), None), the exception coming back from InDesign references the value that I passed to the Reframe method. However, if I pass ((0.0, 0.0), (72.0, 72.0)), then InDesign says that it is receiving "()"
This thread looks similar: http://stackoverflow.com/questions/10166064/python-win32com-and-2-dimensional-arrays/10167882#10167882 and the solution there is to use comtypes instead of win32com.
Is this a known issue with win32com? I tried looking at the underlying InvokeTypes call but stopped when I saw this mailing list post saying that it's poorly documented: http://mail.python.org/pipermail/python-win32/2005-December/004031.html
Log in to post a comment.