Custom Save As Script
Copy link to clipboard
Copied
I have a PDF inspection form that I would like to use on an Android tablet for our shop personnel. Ideally, the form would have a custom Submit / Save As button for the user to click once completed. I am unfamiliar with Java Script and am looking for some guidance.
Ideally this is what I would like the button to do when clicked...
All in the background so user does not see the file explorer or prompts.
Step 1. Save form in specified folder on our network.
1a. Form Name name should be a consistent name "Inspection Form" plus the value from specified text box (Serial Number).
Step 2. Clear Form
I know this can be completed in Excel, so that is my backup plan, but can this be done within an Adobe Form?
Copy link to clipboard
Copied
Read This:
https://www.pdfscripting.com/public/How-to-Save-a-PDF-2.cfm?sd=40
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Thom - I appreciate the help. Possibly I'm not doing something correctly or there is something off within the settings? I copy/pasted the basic script to save to a differnt folder just to try, but it doesn't do anything. I have ensured the file path does exist, but no luck. I have this triggered with Mouse Up.
Here is the script I'm trying to use, but again, it doesn't do anything.
// build file name
var NewFileName = this.documentFileName + this.getField("Serial_Number").value + ".pdf";
// save file
this.saveAs("/c/test/" + NewFileName);
//reset form
this.resetForm();
Copy link to clipboard
Copied
This will not work in Acrobat Reader on Android.
Copy link to clipboard
Copied
Excellent point Bernd!
Although I haven't tested this idea on a WebDav folder.
But in general, mobile devices don't have an exposed file system, so there is nothing to save to. The best way to do this from mobile, is to submit the PDF to a server script (on the computer that also houses the shared folder), that then writes the file to the correct location and file name.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Thanks Bernd and Thom. We are attempting to eliminate the hand written forms and replace with an electronic form that will allow our QC director to email the completed forms (preferably in pdf format) to our clients. My plan of excel will not work either as I realized VBA will not work on mobile devices and I don't really want to use a form app because we want the completed forms to be on our physical servers and not on the form app's cloud. If we can't do this with a simple pdf form, does anyone have any other suggestions?
Copy link to clipboard
Copied
Try using the PDF Embed API
https://developer.adobe.com/document-services/apis/pdf-embed/
Use the Acrobat JavaScript Reference early and often

