Copy link to clipboard
Copied
I have a bunch of PDF fillable forms that have data. The form itself has been updated recently and I would like to extract the data from the old version of the form to the new version of the form. The New form will be saved to the same file name as the old form. Is this something that can be accomplished with the Action Wizard or Java Script?
I found a way in "Prepare Forms" to extract the data to a file named as the original document name and with an extension of *.fdf.
Maybe there is a way to batch convert these files to .fdf files from the old forms and then import to the new form.
Copy link to clipboard
Copied
On the old form run the following script in the console:
this.exportAsFDF();
Remember where you saved the file, then drill down to it in the new form by running this script in the console:
this.importAnFDF();
Copy link to clipboard
Copied
This is not working as expected. I still have to process each file one at a time. I have 198 files to get done and this one at a time is not working.
I tried setting up an Action wizard but its not working. When you say run the following script in the console. What console are you talking about?
I was able to get through the extraction of all the old forms, of course one at a time.
Now I have a folder with 198 .fdf files. each file has different data.
I now need to use the new form to import each data file and save it as a seperate PDF file with the same name as the .fpf file.
Copy link to clipboard
Copied
The JavaScript Console. You said "form" not "forms" so I assumed it was a one-form process. There are few a ways to do this. First, by "extract data" do you mean form field data? Are the field names the same (old form/new form)? Are you trying to process a batch of old form/new form combinations? Is there naming consistency between the old and new file names? Can you provide an example?
Copy link to clipboard
Copied
I used the code you sent this.exportAsFDF(); and it allowed me to extract all of the data files from all 198 old forms. The old formes were named HML0873000.pdf and the extracted file became HML0873000_data.fdf, then the next file was HML0873001.pdf and extracted the file named HML0873001_data.fdf etc.... for a total of 198 extracted files, each with a different name.
Now I want to import the data from the old form into a new form. So the new form is just a blank form with all of the same fields which just rearranged.
So I have been doing it like this. I open the Blank file called "Blank Luminaire for Tablet", then I use the second java code you sent me this.importAnFDF(); I import the data file HML0873001_data.fdf and then rename the newly updated form to HML0873001.pdf. right now I have to do 1 at a time and have a total of 198 of them to do.
Copy link to clipboard
Copied
You would need to use a script as a part of an Action to do both things.
But do the files you want to import the data into have the same names as the ones you're exporting it from?
If not, how should it know which FDF file to import into each PDF?
Copy link to clipboard
Copied
This would be the procedure
I have a blank form called "Blank Luminaire for Tablet", and lets say the fpf file is named "HML1093005_data.fdf"
I would like to open the Blank Luminaire for Tablet file then import the HML1093005_data.fdf into the Blank Luminaire for Tablet file, and then save this file as HML1093005.pdf
and then open the Blank Luminaire for Tablet. Import the next file in the same directory, which would be HML1093006_data. pdf, save it as HML1093006.pdf, and so on until all 198 files have been updated.
Copy link to clipboard
Copied
I don't think that would work in an Action, so it processes each PDF file only once. You will need to create a list of all the FDF file names, and then run the code to import them one by one (and save under a new name each time) from the Console, or using a Custom Command, or a new button added to Acrobat by the script.
If you're interested in hiring a professional to set it all up for you, feel free to contact me privately by clicking my user-name and then on the blue "Message" button.
Copy link to clipboard
Copied
To create the .fdf files you could have named them, set the location, and ran them all in one Action. Conversely, you can import them automatically by name and path then save the PDF files. An Action does the same thing to every file in a folder, so I would first suggest creating 198 copies of Blank Luminaire for Tablet, but naming them HML0873000 through HML0873198. You can doe this by opening Blank Luminaire for Tablet in a directory that only contains that form and running the following script in the console:
var fileName="HML0";
var pth=this.path.replace(this.documentFileName, "");
for(var i=873000; i<873198; i++)
{this.saveAs(pth + fileName + i +".pdf");}
Next, write an Action that Executes JavaScript, then saves the file. The JavaScript to execute would be:
var flder = "/C/Desktop/Folder/"; //Change this to the actual path containing the .fdf files.
this.importAnFDF({cPath: flder + this.documentFileName.replace(".pdf", "_data.fdf"});