Copy link to clipboard
Copied
Hi,
I have two pdf forms or better I have split a document into two seperate forms for easy use (so that I can keep resetting documentA and keep documentB. Now some fields that are in documentA need to be copied into documentB (not many only about 5 or 6). However this is not a field where I can just copy it across. It will be filled with text in documentA and then I would like the answer also to change/appear in pdf document B.
I have read that you can do this with a script or/ and a button?
So I put a button on documentA or a code on fieldA that I want to copy to documentB fieldB? And whats the code I would need, please?
Copy link to clipboard
Copied
Why can't you copy-paste the filled fields?
Using shortcuts or the Edit menu.
Copy link to clipboard
Copied
I would like to copy the data that is written into the form to appear in the other form in the same field.
Copy link to clipboard
Copied
Doing it automatically is quite tricky. What you can do, though, is use two buttons: One to save the data into a global variable and another to populate the fields from that variable.
Then you open file A, click button #1, switch to file B and click button #2, and the data will be copied over.
Copy link to clipboard
Copied
There are many different ways to do this. But all techniques require a specially designed tool/script, or the JavaScript skills to create a tool/script. Do you have such skills?
One of the basic requirments of such a script is that there needs to be a way to map field names in one form to field names in another form. The simplest solution is to use the same field names. But the exact solution depends on your particular situation.
So how exactly do you want this to work? Do you control the field names on the form? Do you want a button on the PDF to transfer data? Can you install a folder level script on the system where this will be used, or does it all have to happen from scripts on the document? Is this a one time transfer, or does the data need to be saved so it can be reused?
Here's some general discussion on Form data handling:
https://www.pdfscripting.com/public/Form-Data-Handling.cfm
For example, data transfer can be done quite easily with an Acrobat Automation Script, and made to work exactly the same on both Reader and Professional.
https://www.pdfscripting.com/public/Automating-Acrobat.cfm
It can also be done from scripts on the documents if both documents are "disclosed".
Copy link to clipboard
Copied
Thank you for that information. I have added the two pdf Documents that I am trying to link. I would like to be able to type into Form "DocA" and when I press "Link to DocB" I would like the data from the red and the blue box (from DocA) to be copied or transferred into "DocB". Where would I need to put the java script for the data to be copied into DocB?
Copy link to clipboard
Copied
So the steps in a script to directly copy data from one document to another, from a script on one of the documents are
1. Get the document object of the other document. To do this the other document must be "disclosed", and have a well known name, title, or some other metadata property that will allow it to be identified by the script. All disclosed documents are visible in the app.activeDocs array. The document should already be open in Acrobat.
2. loop over all fields in the other document,
3. if fields with the same name exist in both, then move the data.
Pretty simple in concept. To make this work, the form fields that will be copied on each PDF will need to be named the same, and each PDF needs this document level script
this.disclosed = true;
Copy link to clipboard
Copied
Or you could join the site and get this tool:
https://www.pdfscripting.com/public/Copy-Form-Data-Between-PDFs-Description.cfm
Find more inspiration, events, and resources on the new Adobe Community
Explore Now