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

How to select multi-line text

Explorer ,
Feb 13, 2020 Feb 13, 2020

Copy link to clipboard

Copied

Hi,

I need to select text that is on several lines. I do not want to generate a PDTextSelect using the PDTextSelectCreateWordHilite method, as it turned out that the word numbers used in this method and the word numbers obtained using PDWordFinder are different. There is a PDDocCreateTextSelect method, which also allows you to generate a PDTextSelect. But there is one problem. I generate a PDTextSelect for one line:
PDTextSelect textSelection;
textSelection = PDDocCreateTextSelect (pdDoc, numPage, & fRect1);
AVDocSetSelection (avDoc, ASAtomFromString ("Text"), (void *) textSelection, true);
Then PDTextSelect for another line:
textSelection = PDDocCreateTextSelect (pdDoc, numPage, & fRect2);
AVDocSetSelection (avDoc, ASAtomFromString ("Text"), (void *) textSelection, true);
When the statement is executed
AVDocShowSelection (avDoc);
Only one line is selected.
Is there any way to solve this problem?

TOPICS
Acrobat SDK and JavaScript

Views

517

Translate

Translate

Report

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
Explorer ,
Mar 25, 2020 Mar 25, 2020

Copy link to clipboard

Copied

I really need help. Perhaps there is another way, how to select multi-line text?

Votes

Translate

Translate

Report

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
Explorer ,
Mar 31, 2020 Mar 31, 2020

Copy link to clipboard

Copied

I have solved this problem. Perhaps this is useful to anyone.

When creating a PDTextSelect using the PDDocCreateTextSelect method, you can really select text on only one line. To select multi-line text, you must use the PDTextSelectCreateWordHiliteEx method. To ensure that the word numbers used in this method and the word numbers obtained using PDWordFinder do not differ, you must use the default settings for PDWordFinder.

Votes

Translate

Translate

Report

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 Beginner ,
Apr 25, 2023 Apr 25, 2023

Copy link to clipboard

Copied

LATEST

Hi @sorin.n 

I have text which can be multiple lines. I am also in the same boat, I can highlight a word but not multiple words. Do you have code which I can learn from to highlight multiple lines? Please advise, I am trying since a week on this. Thanks

Votes

Translate

Translate

Report

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