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

Save PDF in local network with JavaScript

New Here ,
Mar 28, 2018 Mar 28, 2018

Good Morning

I need to know if the following can be done.
I have a PDF form, which collects various data and uses part of them to give a name to the final file, through a save button which is supported by a file that contains the mySaveAs function:

File saveForm.js in Acrobat\Javascripts:

mySaveAs = app.trustPropagatorFunction(function(doc,path) {

app.beginPriv();

doc.saveAs(path);

app.endPriv();

})

myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path) {

app.beginPriv();

mySaveAs(doc,path);

app.endPriv();

});

Button Save in PDF form:

var dt = new Date();

var month = dt.getMonth()+1;

var day = dt.getDate();

var year = dt.getFullYear();

var myFileName = this.getField("text1").value +"-"+day+"-"+month+"-"+year+".pdf";

myFileName = "/c/test/" + myFileName

myTrustedSpecialTaskFunc(this, myFileName);

app.alert("This Form ( "+myFileName+" ) has saved successfully to the following location: /C/test/" , 3);

The problem is in the following:

I want to distribute this form between mobile devices with Android operating system. These devices use the adobe reader version downloaded from google play store.

I need to know if there is any way, through javascript or any other method, that by pressing the save button, these pdfs, filled through the mobile devices, are stored in a network folder on a server. Is this possible ?

Thanks for any help!!

Adrian.

TOPICS
PDF forms
5.3K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Mar 28, 2018 Mar 28, 2018

The answer is no, not without assistance from a server script. The closest you can get is the Readdle PDF Expert viewer for iPad, which provides a method for renaming files on submit. Getting the submit to store the PDF onto a local network would mean having a local server app that would do this, which is not a  difficult task.

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

View solution in original post

Translate
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
LEGEND ,
Mar 28, 2018 Mar 28, 2018

Direct save, absolutely not. Yes, maybe, but not with Reader (the last I read) by submitting the form to a web server. I believe some Android PDF apps support submit. Submit does NOT mean sending an email, but sending to a web script on an internet or intranet server.

Translate
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
Enthusiast ,
Mar 28, 2018 Mar 28, 2018

??? I need to know if there is any way, through javascript or any other method, that by pressing the save button, these pdfs, filled through the mobile devices, are stored in a network folder on a server. Is this possible ?

Note: certain limitations may apply to Adobe Reader for mobile users, and Non-Adobe plugins may not fully support submissions or javascripts.

My Answer: HTML forms may be more compatible for mobile devices.

Let me know if you need help converting the PDF to HTML.

Translate
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 ,
Mar 28, 2018 Mar 28, 2018

thanks for you answer!

the option to create a web app with the html form supported by jsf or jsp has always existed, I just wanted to know if you could do a similar approach with a button in a pdf. and from what I see it is not possible.

I will discard this option and program a web form. I was just curious to know if I could or could not do something like that.

Translate
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 ,
Mar 28, 2018 Mar 28, 2018

The answer is no, not without assistance from a server script. The closest you can get is the Readdle PDF Expert viewer for iPad, which provides a method for renaming files on submit. Getting the submit to store the PDF onto a local network would mean having a local server app that would do this, which is not a  difficult task.

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

Translate
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
Participant ,
Aug 08, 2020 Aug 08, 2020
LATEST

I have a pdf form with fillable fields and a submit button, can this same form be converted to html, with all forms of filling in the PDF? Even with the actions of the send button? Could you help me with this?

Translate
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
LEGEND ,
Mar 28, 2018 Mar 28, 2018

Adobe don't make a big thing of it, but they seem to be quietly moving to HTML5 forms. There is a big-ticket product which consumes PDF forms on a web server and somehow delivers HTML5 (not a conversion, a dynamic service) but little is said of it. Sometimes Adobe mention this by way of explaining that certain things will never happen in the tablet Readers.

Translate
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