Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Creating AVGrafSelect via python and com

New Here ,
Sep 13, 2021 Sep 13, 2021

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?

TOPICS
Windows
735
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 14, 2021 Sep 14, 2021

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

Translate
LEGEND ,
Sep 14, 2021 Sep 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 14, 2021 Sep 14, 2021

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

Screenshot (1).pngexpand image

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 14, 2021 Sep 14, 2021

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 14, 2021 Sep 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++.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 14, 2021 Sep 14, 2021
LATEST

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.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines