Skip to main content
Participating Frequently
Nov 24, 2020 7:30 PM UTC
Question

Using getSelectedContent to retrieve the selected text

I have selected three lines of text in a pdf ....
These lines contain three words LEADERSHIP,  ECONOMY and LIFESTYLE.

I am using the "PREVIEW_SELECTION_END" event ,this returns the 3 bounding boxes for the lines of text.

 

I then call the api getSelectedContent and this is working succesfully, but unfortunately the result it is returning is LEADERSHIPECONOMYLIFESTYLE.

 

As you can see all three lines of text have been concatenated and I can't see how I can turn it into anything meaningful.

 

Any idea how to get usable strings from getSelectedContent?

 

TIA

Rob

    This topic is closed to new replies. Start a new post to keep the conversation going.

    5 replies

    Adobe Employee
    Dec 3, 2020 8:35 PM UTC

    Thanks for using PDF Embed API. Currently, it looks like a limitation of PDF Embed API. We will consider this suggestion in our future enhancements.

    Translate
    Participant
    Jun 5, 2021 3:38 PM UTC

    Team, Is this resolved? if not any date for this feature release?

    Translate
    Adobe Employee
    Jun 9, 2021 11:54 AM UTC

    We have taken note of this request and will let you know when it is resolved. Stay tuned!

    Translate
    Participating Frequently
    Nov 25, 2020 6:55 AM UTC

    I compared selecting the same 3 lines and clicking the "copy" button in Acrobat and in the Viewer and then pasting

    In Acrobat the 3 lines paste in as 3 crlf seperated lines, in the Viewer they paste in as a single line without spaces between the words.

    FWIW they paste as 3 seperate lines in PDFJS and in Chrome Native. 

     

    From what I can see this bug has no current workaround, any suggestions?

     

    Rob

    Translate