Skip to main content
Known Participant
May 18, 2018
Question

Copy selected text in a PDF to clipboard

  • May 18, 2018
  • 1 reply
  • 1574 views

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.

This topic has been closed for replies.

1 reply

Participating Frequently
May 18, 2018

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.

Known Participant
May 20, 2018

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.