Skip to main content
Participant
December 24, 2019
Question

Android buttons actions saved PDF, javascript

  • December 24, 2019
  • 1 reply
  • 3996 views

Good afternoon,

 

I have the necessity to create a fillable PDF document which have to be sent to an Android device. This have also to be able to filled it out and save it (with a specific name) in a selectable folder on this device. I tried to create some buttons and assign to them fixed actions, but these work only on the Win PC, is it possible to insert a javascript in the buttons to allow the Android device saving the document with a name? On the Android device I use Adobe Reader downloaded from the Play store.

Thanks to help me out here.

This topic has been closed for replies.

1 reply

ls_rbls
Community Expert
Community Expert
December 26, 2019

Hi,

 

In a computer with Adobe Acrobat DC, open your form and select the Prepare Form tool.

 

You can add a button with an action such as "Save As". Then save it and upload the form in your mobile device.

 

I personally haven't tested the Save As action button script but I do have a form with a Reset Button action that works in my Reader mobile app.

 

You should be able to use this button,.

 

However, It is my understanding that such feature is not necessarily needed in your case because you can select in your mobile device your PDFs documents default saving location directly from the Reader Mobile app.

 

When this Preferences setting is configured to locally save PDFs  to a location of your choice in that mobile device, any changes made to your PDF document are automatically saved and the file will remain accessible there in that folder unless you decide later to copy it somewhere else.

 

If what you're trying to achieve is to click on a button that will instruct the mobile app to automatically save  PDF document to a specific location in a mobile device,  that is not possible and not supported.

 

What you described in your post only works at a  desktop level of computing where applying a folder level script  to your form is also  exclusively dependent of the directory structure of the  operating system that the PDF application is locally installed and  executing from.

 

So for the mobile app you can set the default saving location, for example.

 

PDFs documents that you open and edit with the Reader Mobile App will  be saved automatically with changes to the default location you've selected in the Reader Mobile App Preferences.

 

You can manually configure this setting as shown in the following slide:

 

 

No manual intervention is needed when you use your files locally in your device, unless you want to rename the file shown in the following slides:

 

 Click on the three dots for More Options, right margin of the filename and a menu will open from the bottom up offering the rename option

 

Select rename and a prompt will allow you to retype the filename

 

As you can see, with the mobile app this is a simple two step procedure.

 

However, you have to test and verify how adding a button script with a Save As action to your form  will behave in the mobile devices where it will be used (both Android or iOS devices).

 

For example, if it actually works, it is very probable that the user will be prompted to save the file to the document cloud, shown in the next slide:

 

If this would be your case, It will always require manual intervention from the user on how such file  needs to be saved to or moved to.

 

If the file is saved to the document cloud, a folder needs to be created  first in order to be able to move that file later to another cloud folder:

 

 

 

 

 

So again, these are options that only work with manual intervention from the user. 

 

In my personal opinion, however, I think you're better off if you add to your form a Print action button script.

 

The reason why, is because it will  open up the print option in your mobile device and will offer the user the option to print to PDF.

 

This is by far the easiest way to have that PDF saved locally to a mobile device without going through the hassles illustrated above.

 

When and if you chose to test the print action button with your pdf form, the user will be prompted instead with a similar screen:

 

 

All the user needs to do is select from the pulldown menu "Save as PDF" and then click on the yellow icon to download/save to the mobile device  as PDF .

 

Then next screen that will popup next will allow the user  to select  then MyDocuments  folders or any other local folder in the SD Card of that mobile device or to the internal device storgae folders

 

 

 

Participant
December 27, 2019

Hi,

thank you for the reply.

I tried to set the buttons that allow me to run an item from the menu (save as, print, reset form) and save the file with the advanced functions for adobe reader. These buttons work on windows, but they don't work on android.

ls_rbls
Community Expert
Community Expert
December 27, 2019

I was not talking about Adobe Reader.

 

Your question was about how to add a javascript to a button.

 

At the beginning of my answer I clearly said, "In a computer with Adobe Acrobat DC, open your form and select the Prepare Form tool".

 

Adobe Acrobat is the PDF editor  program that will allow you to create PDF documents with additional objects and elements to aid the users of the form with workflow.

 

When you edit a PDF document with Acrobat (not Reader) you will be able to open and use that PDF document in other platforms, to include mobile devices.

 

The button that I was referring to is not a menu item, but an object that you can add inside of the actual PDF document, so when the users are interacting with that form they can click on it to manually execute a specific action such as Print, Save As, Reset.