Skip to main content
Participating Frequently
September 14, 2021
Answered

Creating AVGrafSelect via python and com

  • September 14, 2021
  • 2 replies
  • 1023 views

I'm trying to select a rectangular area of a page via python, but I can't manage to do it. From what I've read, a rectangular selection is an AVGrafSelect object, but the command

selection = Dispatch("AcroExch.AVGrafSelect")

 is resulting in the error message 'Invalid class string'. What am I doing wrong? How do I make an AVGrafSelect object?

This topic has been closed for replies.
Correct answer Bernd Alheit

May be that the use of this is only possible in a plugin.

2 replies

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
September 14, 2021

May be that the use of this is only possible in a plugin.

Legend
September 14, 2021

You are right Bernd, I missed that. You cannot mix and match the different APIs. The plug-in API is only accessible to plug-ins (not external apps) and plug-ins can only be written in C++.

Participating Frequently
September 14, 2021

Thanks for explaining. If I can't create an AVGrafSelect object from an external program, is there another way I can select a rectangular area?

(what I actually want to do is copy a rectangular area, but I want to copy it in the form that selecting and copying it gives, not as an image like CopyToClipboard does, so I was wanting to select a rectangular area and use MenuItemExecute to copy it.)

Legend
September 14, 2021

What specific product is installed? Acrobat Pro, Acrobat Standard, Acrobat Reader, Adobe Reader, other?

What specific version is installed?

And: Please give documentation link for AVGrafSelect. I do not see it in the Acrobat developer info. Indeed, what would "select a rectangular area" even mean? Perhaps the bigger picture will be helpful.

Participating Frequently
September 14, 2021

By "select a rectangular area" I mean like this:

The cursor for doing it is a standard arrow-shaped cursor with a rectangle to the bottom right.