Skip to main content
kirstinf65418680
Participant
Mar 26, 2020 8:02 PM UTC
Question

Setting up buttons to export FDF data then import FDF data onto a different form for Reader users

Hi, 

So I an not a programmer the best that I can do is copy/paste javascript that I've searched for on these forums. 

 

I have a copy of Adobe acrobat pro DC to create forms but the rest of my team does not. I am trying to export form data (FDF) from one PDF (PDF#1) and then import that data into a second form (PDF#2). Since the rest of my team does not have pro verions I am trying to set up a button to export the FDF from PDF#1 and then importing that FDF file into PDF#2. Theses are fillable forms that will have a different names/ values each time. 

 

First I tried creating a button that did this 

exportAsFDF();

which worked for my version of adobe but the button did nothign for non pro users. 

 

Non pro users can email out an FDF file but I only know how to do that with an export out button (Mouse up > Submit a form). The problem is that I will have to direct  the the eport to a specific email address. This will not work because we need each person to be able to deal with their own form data and we don't have a shared email account. We do heave a OneDrive but its behind a password so everytime I try to export to that I end up generating a PDF of the log in  screen for OneDrive (even while logged in on the browser).  Does anyone know of a Javascript that will allow a non pro user to export out FDF to a mailbox of their choice?  

 

The next issue is importing the FDF from PDF#1 into PDF#2.  The import button feature Mouse Up > Import form data  requires you to select a specific file containing form data. This will not work because the form data file will change names each time and can't be directed to a specific location on my desktop. Is there a script out there that will allow a non DC pro user import an FDF file from a location of their choosing? 

 

I really appreciate any hep or tips i've been searching replies for days. I feel like the submit for review/ editing feature could be the answer but I don't know that non pro users will be able to utilize that feature. 

 

Thanks!

K

12 replies

Thom Parker
Community Expert
Community Expert
Mar 26, 2020 9:28 PM UTC

Unfortunately, Reader does not allow the export of data without special "Reader Rights". But reader can load data from an FDF.  And if it is done from a privileged script, then there is no problem. 

 

However, what a script in Reader can do is open two PDFs and copy data from one to the other. Would this work for you?

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
kirstinf65418680
Participant
Mar 26, 2020 10:53 PM UTC

Yes! I didn't know that was an option!

Translate
Thom Parker
Community Expert
Community Expert
Mar 27, 2020 12:42 AM UTC

There are a few different ways of doing this.

1) Copy all the data from one form into the global object, then a script can copy it into any open document. This is good when the data from on form goes to many.

There are paid for scripts for this here:

https://www.pdfscripting.com/public/Form-Data-PreFill-Tool.cfm

 

2) Just use the two open documents. Copy data from the current (front) PDF into the other one. 

Use a loop to go through all the fields on the form

 

var oOtherDoc = (app.activeDocs[0]==this)?app.activeDocs[1]:app.activeDocs[0];

for(var i=0;i<this.numFields;i++)

{ 

     var oFld1 = this.getField(this.getNthFieldName(i));

     var oFld2 = oOtherDoc.getField(this.getNthFieldName(i));

      if(oFld2 && (oFld1.type != "button"))

               oFld1.value  = oFld2.value;

}

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participating Frequently
Mar 26, 2020 9:07 PM UTC
kirstinf65418680
Participant
Mar 26, 2020 10:54 PM UTC

Wouldn't this still require me to open all of the response files and manipulate them? I need my team to transfer data from one pdf to another with their reader version of adobe without me.

Translate