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

Copy selected text in a PDF to clipboard

Participant ,
May 18, 2018 May 18, 2018

Copy link to clipboard

Copied

Hi,

I have a few text string paragraph in a pdf file, I need to put a button for each paragraph so operator by selecting/highlighting that paragraph and clicking the related button I need to copy that string into clipboard so it can be pasted into another area in another application.

I am using following JavaScript on Mouse Up/On Focus:

app.execMenuItem("SelectAll");

app.execMenuItem("Copy");

but it does not copy into clipboard... what am I doing wrong?

Regards,

Jeff P.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.2K

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 ,
May 18, 2018 May 18, 2018

Copy link to clipboard

Copied

By making the user select a button, you are telling Acrobat that the button has the focus. "SelectAll" on a button does nothing and unless you are in Prepare Form mode, copying a button does nothing. Additionally, "SelectAll" won't limit the selection to just the paragraph even when done through the menu item.

I suggest you rethink your approach.

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
Participant ,
May 19, 2018 May 19, 2018

Copy link to clipboard

Copied

LATEST

Hi,

I ran it with out SelectAll, Just Copy still my clipboard did not get populated with my selection... I tested both ways before I post it hear.

Regards,

Jeff P.

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