Can I leave the filled text but remove the form fields automatically?
At work, we use a Microsoft Excel file that links to an Adobe file that is used to generate multiple tax forms at once. I did not make this file, but have been able to keep it running, which is no small feat.
The way I understand it is:
1. We enter information into Microsoft Excel. Two tabs of this file are set to pull this information and arrange it in a way that upon the push of a button, blank lines are deleted and each tab is saved as a comma delineated file.
2. The macro then goes to find Adobe and Adobe runs javascript (I think?) that matches the comma delineated files to form names and fills the forms and saves in successive order (A1, A2, A3, etc.). Sometimes I have generated up to 64 forms this way. It's useful - a lot of the information is the same but a few lines on the tax form change with each form.
My issue: The forms that are saved still have the fields in them, meaning we cannot easily combine them into a PDF binder. They need to remain individual files (or maybe be a PDF portfolio, which is less ufesul than a binder to me). Is there script I can add that would LEAVE the text that was entered into the form, but make it just.... text, and not a fillable form field?
Please go close to ELI5 if you can - I don't know javascript at ALL. I'm just the most techy one on the team. I've anonymized file paths below but not changed anything else.
// specify the filename of the data file
var fileName1 = "/Text_File_Path/Acq.txt"; // the tab delimited text file containing the data
var fileName2 = "/Text_File_Path/Rehab.txt";
var outputDir = "/Directory_In_Which_To_Save_PDFs_Path/"; // make sure this ends with a '/'
var err1 = 0;
var err2 = 0
var idx1 = 0;
var idx2 = 0;
while (err1 == 0) {
err1 = this.importTextData(fileName1, idx1); // imports the next record
if (err1 == -1)
app.alert("Error: Cannot Open File");
else if (err1 == -2)
app.alert("Error: Cannot Load Data");
// else if (err1 == -3)
// We are not reporting this error because it does
// indicate the end of our data table: We've exhausted
// all rows in the data file and therefore are done with
// processing the file. Time to exit this loop.
// app.alert("Error: Invalid Row");
else if (err1 == 1)
app.alert("Warning: User Cancelled File Select");
else if (err1 == 2)
app.alert("Warning: User Cancelled Row Select");
else if (err1 == 3)
app.alert("Warning: Missing Data");
else if (err1 == 0) {
this.saveAs(outputDir + this.getField("ProjectName").value + "_" + this.getField("AcqOrRehab").value + this.getField("BuildingNo").value + ".pdf"); // saves the file
idx1++;
}}
while (err2 == 0) {
err2 = this.importTextData(fileName2, idx2); // imports the next record
if (err2 == -1)
app.alert("Error: Cannot Open File");
else if (err2 == -2)
app.alert("Error: Cannot Load Data");
// else if (err2 == -3)
// We are not reporting this error because it does
// indicate the end of our data table: We've exhausted
// all rows in the data file and therefore are done with
// processing the file. Time to exit this loop.
// app.alert("Error: Invalid Row");
else if (err2 == 1)
app.alert("Warning: User Cancelled File Select");
else if (err2 == 2)
app.alert("Warning: User Cancelled Row Select");
else if (err2 == 3)
app.alert("Warning: Missing Data");
else if (err2 == 0) {
this.saveAs(outputDir + this.getField("ProjectName").value + "_" + this.getField("AcqOrRehab").value + this.getField("BuildingNo").value + ".pdf"); // saves the file
idx2++;
}}
