Skip to main content
Known Participant
September 19, 2017
Question

Copy text to clipboard

  • September 19, 2017
  • 2 replies
  • 11339 views

I have a PDF form, in which there's a button. When the user presses the button, I need to copy some text (an email address) to the clipboard, so that the user will be able to paste it in other applications. This text can be assumed to be constant (i.e. I can hardwire it in a JS).

I thought about creating a n invisible textfield in the form with the text, and the using selectNthPageWord and app.MenuItem("Copy"). But this works for only one word (an email address is processed as separate words), and also the clipboard seems to be erased once the JS finishes. I need the text to remain there.

Any help, please?

This topic has been closed for replies.

2 replies

JR Boulay
Adobe Expert
September 27, 2017

It works fine for me with the latest Acrobat Reader.

(I don't need to select the text in the reponse box, it comes already selected)

Acrobate du PDF, InDesigner et Photoshopographe
try67
Adobe Expert
September 27, 2017

Same here. Works just fine.

Known Participant
October 2, 2017

I asked a friend to try it on her computer, and it doesn't work. Maybe it's something in the system configuration? what can it be?

try67
Adobe Expert
September 19, 2017

JS in Acrobat is not capable of doing that.

On Tue, Sep 19, 2017 at 8:52 AM, akyd8807993 <forums_noreply@adobe.com>

Known Participant
September 19, 2017

Any other ideas?

try67
Adobe Expert
September 19, 2017

You can display the text in an alert window and ask the user to copy it

from there.

On Tue, Sep 19, 2017 at 10:44 AM, akyd8807993 <forums_noreply@adobe.com>