Copy selected text in a PDF to clipboard

Participant ,
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

432

Likes

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

Copy selected text in a PDF to clipboard

Participant ,
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

433

Likes

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

Likes

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
Reply
Loading...
May 18, 2018 0
Participant ,
May 19, 2018

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
May 19, 2018 0