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

Get selected text content

New Here ,
Jan 13, 2017 Jan 13, 2017

Hello,

I created a plugin to add a custom menu which will get the selected text and then I can do the operation on that text.

AVDoc avDoc = AVAppGetActiveDoc();
// if a PDF is open, get its number of pages
PDDoc pdDoc = AVDocGetPDDoc(avDoc);

// Get the selected text as a text select

PDTextSelect pdtext =static_cast<PDTextSelect>(AVDocGetSelection(avDoc));

Now, I want to get the actual text content with this object. How can I achieve that?

Thanks

Best Regards,

Navnath

TOPICS
Acrobat SDK and JavaScript
1.0K
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 ,
Jan 13, 2017 Jan 13, 2017

1. Verify the selection type is Text or your code will surely crash Acrobat (when it isn't)

2. PDTextSelectEnumText.

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 ,
Jan 13, 2017 Jan 13, 2017
LATEST

And bear in mind, per the documentation, that the text passed to the callback may not be in reading order.

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