• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Auto-populating a form with data in two other PDF files.

Community Beginner ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

Hello!

Is it possible with a JavaScript code/Action to auto-populate fields in a fillable PDF with data from two different PDF files?

More specifically, I am looking for a way to automate the process of filling out a W-2C tax form with data from two sets of W-2 forms. The first PDF file of W-2 forms contain the data for the "Previously Reported" column in the W-2C form and the second PDF file of W-2 forms contain the figures for the "Correct information" column of the same W-2C form. Each PDF file of W-2 forms can contain from 1 W-2 form to 150 W-2 forms.

I've been able to automate the separation of the W-2C form with an action I created in Acrobat, but I was wondering if we could automate the process of filling out the W-2C's entirely. All the data I need is consistently provided in two PDF files. For example, the before.pdf and the after.pdf. What we do now is copy and paste all the values into the W-2C form and with 100 plus W-2C's that need to be done, it can take up a lot time.

I am looking for help on writing the code needed or if someone can point me in the right direction for help, I would greatly appreciate it!! I don't have a lot of experience coding, but I am trying to learn.

I've searched around the web to see if someone might have done something similar, but I cannot seem to find anything related that fits my scenario.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

630

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

It's very hard to say for sure without seeing the actual files.

If the form fields are named the same in all files (which I doubt) then you could simply export the data from the other two files and then import it in the new one. Otherwise it will require a more complex script that maps the fields from the old files into the new one.

On top of that, governmental forms tend to be created in LCD, which makes things even more complicated...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

Thanks for the reply try67! I was actually considering just exporting the W2 before and after files to excel and then importing that data into the W-2C. I think that would be the easiest method for me to use. I do have a fillable W-2C with specific field names in each box.

Do you know of a good way to export only specific data such as the dollar figures and employee name, address and SSN? I attached a pic of one W2 before form, this is consistent with with both the before and after files. Just different employee info and dollar figures. I can export the entire form to excel, but it pretty much just copies the entire form into the spreadsheet, which makes it messy. We do have a macro that fills out the W-2C for us, but it requires us to copy and paste all the information into a specific spreadsheet. And having to do that kind of makes the macro pointless to use since we aren't really saving time.

I did come across this: Import data from Excel into fillable pdf using Acrobat XI Pro - is it possible? How?

Perhaps if I can get it to export in a specific way that matches the name of the fields in my W-2C I can get it to import easily.

2017 W2 Before Packet_Page_1.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

Do you know whether this is an Acrobat form or an LCD form? Do you know the field names of the fields you want to export?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

The files are acrobat forms. I do know the names of the fields for the fillable W-2C form. But the W-2 forms do not have identifiable fields. They are auto generated with the data I need. I have attached copies of what I am working with below if you'd like to see.

https://drive.google.com/open?id=1o0jJQYrgcXyaX9l15I4MHPXA2f7DwQl3 - Fillable W2C

https://drive.google.com/open?id=1sE6K_BjqALJ81dLGsPMDYHYqO_eX2o3e - W2 Before

https://drive.google.com/file/d/1kGzWHgRblAqC6TMmErSnDKLL2apMvogE/view?usp=sharing - W2 After

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

Ok - That's a totally different problem; you're not migrating data from one form to another. You need to scrape text out of some defined areas on a page and use the results to populate a form. This is a non-trivial exercise and you should seriously consider hiring a professional.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

LATEST

Daniel,

   There are many ways to acquire data and use it to populate a form. Here is some general info on using Excel with form data:

https://www.pdfscripting.com/public/ExcelAndAcrobat.cfm

This is just one way. It is also easy to transfer data from on from to another.

However, if it is as Joel says and you need to scrape the data, then there is no general technique. It has to be a solution customized to your documents and you'll need a custom script.  I've done exactly this sort of thing many times. Message me if you are interested in custom work.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines