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

Copy text to clipboard

Community Beginner ,
Sep 18, 2017 Sep 18, 2017

Copy link to clipboard

Copied

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?

TOPICS
Acrobat SDK and JavaScript

Views

9.1K

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
Community Expert ,
Sep 19, 2017 Sep 19, 2017

Copy link to clipboard

Copied

JS in Acrobat is not capable of doing that.

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

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
Community Beginner ,
Sep 19, 2017 Sep 19, 2017

Copy link to clipboard

Copied

Any other ideas?

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
Community Expert ,
Sep 19, 2017 Sep 19, 2017

Copy link to clipboard

Copied

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>

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
Community Beginner ,
Sep 19, 2017 Sep 19, 2017

Copy link to clipboard

Copied

Text in an alert box is unselectable. I tried a response box, and the text there can be selectable (and editable, which is regrettable), but when the user selects it and presses Cntrl+C, and the text is copied to the clipboard, it doesn't stay there for long. The clipboard is erased when the response box is closed, and the text is no longer available.

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
Community Expert ,
Sep 19, 2017 Sep 19, 2017

Copy link to clipboard

Copied

Yes, I meant a response box. What you're describing is very strange, and not how it works for me. If I copy text from such a window it will remain in the Clipboard until I copy something else which overwrites it. That is a system-wide setting.

Edit: fixed type-o

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
Community Beginner ,
Sep 25, 2017 Sep 25, 2017

Copy link to clipboard

Copied

Can I upload a sample? I tried to attach a file to this reply, and it doesn't seem to work.

It's not a system-wide behaviour. In other application it works (the info remains in the clipboard after the original application is closed). Only in response boxes in PDFs (as far as I can tell).

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
Community Expert ,
Sep 26, 2017 Sep 26, 2017

Copy link to clipboard

Copied

Can I upload a sample? I tried to attach a file to this reply, and it doesn't seem to work.

Acrobat : File menu : Send File : Send & Track : Create anonymous link

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
Community Beginner ,
Sep 26, 2017 Sep 26, 2017

Copy link to clipboard

Copied

Okay, it's here:

Shared Files - Acrobat.com

When I open in Chrome (pdfium plugin), it works fine. However, in Acrobat (Reader version 2017.012.20098) it behaves as follows:

I open the PDF. It displays a response box. I select (by mouse) the text in the editable field. I press Cntrl-C. I open MsWord, and press Cntrl-V. Works fine. I then close the response box (either by "OK" or "Cancel"), return to the same MsWord windows, press Cntrl-V again and nothing happens.

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
Community Expert ,
Sep 26, 2017 Sep 26, 2017

Copy link to clipboard

Copied

Yes, I meant a response box. What you're describing is very strange, and now how it works for me. If I copy text from such a window it will remain in the Clipboard until I copy something else which overwrites it. That is a system-wide setting.

I confirm.

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
Community Expert ,
Sep 27, 2017 Sep 27, 2017

Copy link to clipboard

Copied

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)

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
Community Expert ,
Sep 27, 2017 Sep 27, 2017

Copy link to clipboard

Copied

Same here. Works just fine.

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
Community Beginner ,
Oct 01, 2017 Oct 01, 2017

Copy link to clipboard

Copied

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?

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
Community Expert ,
Oct 02, 2017 Oct 02, 2017

Copy link to clipboard

Copied

What's your OS version?

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
Community Beginner ,
Oct 03, 2017 Oct 03, 2017

Copy link to clipboard

Copied

Windows 10 Pro

1703

The native language here is Hebrew, in case it matters.

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
Community Expert ,
Oct 03, 2017 Oct 03, 2017

Copy link to clipboard

Copied

Is the text you're displaying in the box also in Hebrew?

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
Community Beginner ,
Oct 03, 2017 Oct 03, 2017

Copy link to clipboard

Copied

No. As I said, it's an email address.

In the example I sent you (linked, actually), the text is purely English.

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
Community Beginner ,
Oct 04, 2017 Oct 04, 2017

Copy link to clipboard

Copied

Another approach I can think of is, give up the alert & response boxes. I can write the information I want in a textfield in the documents itself, make it hidden, and when the user finishes, I can make that field visible.

However, if this field is read-only, then its value is unselectable. And I prefer not to make it editable. Any ideas?

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
Community Expert ,
Oct 04, 2017 Oct 04, 2017

Copy link to clipboard

Copied

Make the field editable and as its custom validation script enter this code:

event.rc = false;

On Wed, Oct 4, 2017 at 2:41 PM, akyd8807993 <forums_noreply@adobe.com>

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
Community Beginner ,
Oct 14, 2017 Oct 14, 2017

Copy link to clipboard

Copied

LATEST

Good idea. Thank you!

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