Send your PDFs Directly into Laserfiche
Use the scripts below, in conjunction with Laserfiche Import Agent, to send PDF forms directly into Laserfiche with the click of a button and streamline business processes such as open enrollment.
How to create and configure the button
Since Adobe does not allow you to automatically save the PDF at a specific location through a button, you need to configure this button with a two-part script. For the purposes of this example, we are saving all the files in a folder on our hard drive called C:pdfsubmission. You will have to modify the scripts to reference your preferred storage location.
Note: In this example we use Adobe Acrobat X. This process should also work with other versions of Adobe Acrobat.
- First you need to add a Submit Button to your form. Under Actions, make sure to select Mouse Up as the Trigger.


Double-click on Run a JavaScript to open the JavaScript Editor:
Here is the script to copy into the editor window://This script has the action (Save) and location where it will be saved.
// First make sure the function exists
if(typeof(mySaveAs) == "function")
{// Now split out the pure "Path" portion of file path
// for calling the function
var nLast = this.path.lastIndexOf("/");
var cPath = "/C/pdfsubmission/";
mySaveAs(this,cPath, this.documentFileName);
}
else{
app.alert("Missing Save Functionn" +
"Please contact forms administrator");
}
Note: Every person who will be eventually filling out this form must have a copy of the config.js file stored in the above directory on their hard drive for the button to work correctly.
var mySaveAs = app.trustedFunction(
function(oDoc,cPath,cFlName)
{
app.beginPriv();
// Ensure path has trailing "/"
cPath = "/C/pdfsubmission/";
//cPath.replace(/([^/])$/, "$1/");
try{
oDoc.saveAs("/C/pdfsubmission/" + cFlName);
}catch(e){
app.alert("Error during save");
}
app.endPriv();
});

Incorporate this button into your workflows
Laserfiche Workflow 8.3 brings a large number of new activities, including the following ones related to working with PDFs:
- Retrieve PDF Form Contents
- Fill Out PDF Form
- Verify PDF Signatures
You can incorporate both the new PDF activities and the form with the custom button into your workflow.
Example:
Z-Tech Fabrication Company would like to send out an Open Enrollment form to every employee. Z-Tech creates a form and adds a custom Submit to Laserfiche button using the scripts described above.

In order to simplify this process and reduce errors associated with entering incorrect data, Z-Tech has designed a workflow that pre-fills certain fields in the PDF form with employee information stored inside a database, and then e-mails this partially completed form to each employee.

After filling out the rest of the form, an employee clicks the Submit to Laserfiche button and the form gets routed directly to the C:pdfsubmission folder. From there, Laserfiche Import Agent imports the form into the Human Resourcestempsubmitted Open Enrollment Forms folder in the Laserfiche repository. The workflow pictured below runs and does the following:
- Extracts the content of the form.
- Stores the original file in a Record Series.
- Stores the file shortcut in the specified employee’s folder.
- Updates the employee database with the new data from the form.
- Notifies the HR Manager by email that the form has been submitted and the database updated.
If an employee didn’t sign the form before submitting, Workflow sends the form back to the employee to sign and re-submit.

All of the files associated with this process, including the code and sample workflows can be downloaded here.
*Please note that a Support Site account is necessary to download the zip file.*
