Copy link to clipboard
Copied
Hello everyone!
I apologize in advanced if this has been done before but it is not the easiest thing to google! Also I'm not sure if this should be under JavaScript or a different forum so I'm sorry if this is the wrong place to ask!
Let me briefly explain what I'm doing first.
I work for as a contractor and twice every year my company goes out and does preventive maintenance (PM) on a large amount of traffic camera's and message signs. What I have set up in the field is a master PDF file for each type of device we PM that I'll open with a Laptop or iPad and enter in the state's district number, the ID of the site (CAM-09-001 etc..), the date is was done, the PM cycle number, and a long list of drop down boxes that declare the working order or condition of the things we check at each site (cabinet condition, visibility due to trees/obstructions, etc..). They're all a simple "Excellent, Good, Fair, Poor" drop-down list for the conditions fields and the other fields are just a simple fillable text field like the date or device ID. Now currently, I use this master list and fill everything out for a site and save it as "PM Form - sitenamehere" where the master PDF is named "PM Form - CCTV's" or similar. I now have essentially 2 copies where one will be submitted or forwarded to the bosses and one (the master) that I will fill out again for the next item. The problem is that it will already be filled out with the previous items' entries; which is mildly annoying and - albeit small - a waste of time to change when time is essential!
I'm looking to make the process of editing and saving my completed form more streamlined and quicker! What would be ideal would be that when I open the master, the Date auto fills, my district stays the same unless changed last time it was opened (same for pm cycle and a few other fields as we'll do a full districts' items before moving to another district), and all the drop-down lists get defaulted back to say "Excellent". Then when I go to save the completed form, it flattens it (so they cannot be edited and when all sites are down I can easily combine them into one GIANT PDF that will be kept and also sent in), and automatically tries to save it as "PM Form - sitenamehere". Rinse and repeat.
I understand leaving the input fields' properties as default will cause them to keep whichever the last input was the next time I open it (pm cycle, district #, etc..) as well as the drop-downs though I can assign a default value for each of those (defaulting to "Excellent" and only changing if something is wrong). As for the date, I figured out a way to automatically fill it out to the date it is opened and formatted to m/d/yy with a document JavaScript:
var f = this.getField("Date");
if (!f.value) f.value = util.printd ("m/d/yy", new Date());
My questions, I guess, are:
Or if someone has a simpler way or an alternative to ANY of these, I would love to hear it. I like learning new things.
I am fairly new at Acrobat and don't know much JavaScript but have worked with code, and this is one of the first times I've been tasked with creating a functional PDF form since we made the transition from paper, so again.. I apologize if what I've asked comes off as trivial or even impractical. I'm just looking for some advice!
Sorry for the wall of text!
I'm currently using Adobe Acrobat Pro 11 and Windows 10.
Thank you so much for your time,
-Lance R.
Copy link to clipboard
Copied
You can transfer field values between Acrobat forms created with Acrobat by exporting and importing FDF files. One could also use global variables but the use of this approach eats up a lot of memory. Then one can open more than PDF form, make sure each has a unique object name, and copy the values from one form field in one form to another form field in the other form.