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?
Copy link to clipboard
Copied
I really need help. Perhaps there is another way, how to select multi-line text?
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.
Copy link to clipboard
Copied
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