Trouble copying from Word to Javascript Window in PDF

Explorer ,
May 16, 2022 May 16, 2022

Copy link to clipboard

Copied

Does anyone else have issues when copying text from a Word document to the *JavaScript Window* in Adobe Acrobat DC Pro? Please note, I'm not trying to paste to the JavaScript Editor. This is a JavaScript Window with data fields for a custom stamp.

 

I am able to paste directly into PDF using the "Add Text" (from Word). It's only when I try to copy directly from Word to the JavaScript Window in PDF that doesn't work. As a workaround, I have to paste what I've copied into Notepad, then copy that text and paste it into the JavaScript window.

 

I have the latest versions of both programs, I'm using the latest version of Windows 10, and I have looked through all my settings. Am I missing something?

TOPICS
General troubleshooting , JavaScript , PDF forms

Views

131

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
community guidelines
Adobe Community Professional ,
May 16, 2022 May 16, 2022

Copy link to clipboard

Copied

You should never use Word for writing code! Use a plain-text editor only, such as Notepad++.

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
community guidelines
Explorer ,
May 16, 2022 May 16, 2022

Copy link to clipboard

Copied

Never said I was writing code. I'm simply copying *text* from a word document that is for a Custom Stamp in Acobat DC Pro.

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
community guidelines
Adobe Community Professional ,
May 16, 2022 May 16, 2022

Copy link to clipboard

Copied

Sorry, I misunderstood what you meant by "JavaScript Window"... Anyway, it could be that you're trying to paste characters that are not accepted into it, which is why the text is being rejected. This often happens with Word, especially if you use special characters such as quotes, but even a line-break can cause it.

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
community guidelines
Explorer ,
May 16, 2022 May 16, 2022

Copy link to clipboard

Copied

Sure. That's why I posted a picture of my JavaScript Window. Testing your theory now.... BRB

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
community guidelines
Explorer ,
May 16, 2022 May 16, 2022

Copy link to clipboard

Copied

So. To verify: I'm not using any special characters. It is simple text that I typed into Word, copied to my clipboard (CTRL+C), and tried to Paste (CTRL+V) into the Javascript Window (see image above). It accepts text from the clipboard, IF that text didn't come from Word. I just checked and it DOES work if I copy text from Excel. So, I don't think it's Microsoft. Lunch...BRB

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
community guidelines
Explorer ,
May 16, 2022 May 16, 2022

Copy link to clipboard

Copied

Also I tested using a simple phrase (typed into Word then copied from there), which contained no quotes, no line breaks, and characters all in the standard ASCII ranges (032, 065-090, 097-122) (space, A-Z, a-z). In other words, nothing special.

 

This is basic text from Word <-Did not paste into the JavaScript Window (see image provided earlier), but again, pastes fine into any other program (All tested: Notepad, Excel, Outlook, Publisher, Project).

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
community guidelines
Adobe Community Professional ,
May 17, 2022 May 17, 2022

Copy link to clipboard

Copied

Text in a Word doc can contain hidden non-ASCII characters.  Obviously there is more here than you can see with the naked eye. I've pasted text from word and other rich text formats many times, with mixed results. Any issues are always caused by non-ASCII characters or other data. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
community guidelines
Explorer ,
May 17, 2022 May 17, 2022

Copy link to clipboard

Copied

Sure. Thanks, Thom. I understand that completely; which brings me to the reason I'm here. Do you know of any settings (in Word or in PDF) that would prevent (or strip) those hidden characters from what is being copied/pasted? It gets tedious and annoying to have to open yet another program to act as an intermediary.

 

BTW, Thom, it has been a minute, but I believe you (or possibly someone else at PDF Scripting) helped me with these Stamps back in 2018. Any way you can help test what I have to see if you're also running into the same issue?

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
community guidelines
Adobe Community Professional ,
May 17, 2022 May 17, 2022

Copy link to clipboard

Copied

On Windows the Ctrl-Shift-V keyboard shortcut is supposed to "paste as (pure) text", have you tried?

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
community guidelines
Explorer ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

Thanks for that suggestion, JR. I had not tried it, but unfortunately it does not work. To top it off, here is another oddity: The Window+V keyboard shortcut opens the Windows Clipboard. Using the clipbaord, when I tried to paste what I had just copied from Word, it would not paste. However, when I pasted something else from the clipboard that text pasted successfully. THEN, I went back to the text I copied previously and (without copying again) that pasted successfully.

 

Anyways, I'm almost positive now it is Word. I'll just keep digging into my Word settings to see if there's something in there.

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
community guidelines
Explorer ,
May 19, 2022 May 19, 2022

Copy link to clipboard

Copied

Thanks, but I wouldn't call that a "correct answer". The solution still hasn't been resolved. I'm still unable to copy directly from Word into the JavaScript Window of Adobe Acrobat DC Pro. Any help or suggestions is still needed.

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
community guidelines
Adobe Community Professional ,
May 19, 2022 May 19, 2022

Copy link to clipboard

Copied

If you want further help you will need to provide an example, such as the Word document you're using to copy the text from, and the code that generates the window into which you're copying it.

Also, you never mentioned what version of Acrobat (and Word) you're using.

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
community guidelines
Explorer ,
May 19, 2022 May 19, 2022

Copy link to clipboard

Copied

Sure. I can attach the Word Document (.doc and .docx), but I do not want my stamps being out in public like this. Can I email or message them to you somehow?

Word Version 2204 (Build 15128.20224)

 

Acrobat DC Pro (32-bit):

Continuous Release | Version 2022.001.20117

Version File Version: 22.001.20117.0

AGM Version 4.030.00116

CoolType Version 5.017.00010

Core Version: 22.256

JP2K Version 2.000.00004.50016

 

I hope this helps.

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
community guidelines
Explorer ,
May 24, 2022 May 24, 2022

Copy link to clipboard

Copied

LATEST

I'm still in search of a solution here. I want to thank @try67 for attempting to help. Apparently my issue works fine on their system, but still does not work on mine. If anyone else has a suggestion, I'm willing to try it. I won't upload my Company Stamps here, but I can provide them to anyone using Word 365 and Acrobat DC Pro on Windows10, for testing. Thanks!

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
community guidelines