I have Acrobat XI Pro installed on my machine.
I'm trying to write PowerShell code that will extract pages from PDF documents using techniques such as the ones at https://groups.google.com/forum/#!topic/comp.text.pdf/DNtcbUgjas4 and Convert pdf to Word document
When I invoke GetJSObject()
on the output from GetPDDoc()
I get an System._ComObject
that doesn't expose any of the methods used in the various pieces of sample code I have found:
PS> $JavaScriptObject
System.__ComObject
PS> $JavaScriptObject.GetType()
Value does not fall within the expected range.
At line:1 char:1
+ $JavaScriptObject.GetType()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException
PS> $JavaScriptObject.numPages -eq $null
True
Any clue?
Note: the exact same logic works in VBS using the code from https://groups.google.com/forum/#!topic/comp.text.pdf/DNtcbUgjas4