[Android/Javascript] Can't paste string from clipboard to a text field

New Here ,
Dec 15, 2019 Dec 15, 2019

Copy link to clipboard

Copied

Hi everyone !

 

I am using Adobe Acrobat Pro DC and I have to write a script that paste a string from the clipboard to a text field when the user clicks on a specific button. The user uses a tablet with Acrobat Reader for Android. I already wrote a script that convert the string into a value. The string in the clipboard is generated by an another Android app that listen to the RS232 communication.

 

But I didn't find any function for pasting a string from the clipboard in the Android Acrobat Reader JavaScript API (https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/androidapi/index.html). I also noticed that this API is very incomplete compared to the Acrobat Reader JavaScript API (https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/js_api_reference.pdf).

 

I saw solutions in this forum and in Stack Overflow forums that involve the user to paste the string him/herself to the text field but I would like to not allow that for ergonomic and security purposes. I also tried to put the string in a file that the PDF reader could read but it doesn't work because there is no function in the Android Acrobat Reader JavaScript API to open the file ( the importTextData function should be here).

 

Any solutions or remarks are welcome ! 😉

TOPICS
PDF forms

Views

354

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

correct answers 1 Correct answer

Community Expert , Dec 15, 2019 Dec 15, 2019

Acrobat JavaScript can't paste text from the clipboard due to security reasons. Not on mobile devices and not on regular computers.

Likes

Translate

Translate
Community Expert ,
Dec 15, 2019 Dec 15, 2019

Copy link to clipboard

Copied

Acrobat JavaScript can't paste text from the clipboard due to security reasons. Not on mobile devices and not on regular computers.

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
New Here ,
Sep 19, 2022 Sep 19, 2022

Copy link to clipboard

Copied

LATEST

The reply below is not the correct answer.

Go find an old coder and you will find the answer. I mean a person, not an app. That person would have written all of their code - HTML, Javascrpt, etc. - all on Notepad.

Adobe has pity on us old coders, so allows it to copy and paste from Notepad, so all you have to do is save your code as .txt files, or simply copy and paste it into Notepad, then copy it from there and paste it straight into the Acrobat JavaScript editor. Voila!

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