Skip to main content
Participant
April 18, 2024
Question

tryin to have javascript grab info from excel and fill out pdf.

  • April 18, 2024
  • 1 reply
  • 532 views

Hi, I am at a loss. I am trying to have javascript use the info from a text box to search an excel file with muitiple tabs at the bottom. Then return the dat of last inspection into a a text box on pdf and the last grade in anothor text box. So below is a few snipits of what i am trying to do. I want to use the rig line to search the excel file and grab the last (inspection date) BOPE date and grade.  I am generally pretty good with adobe and javascript and excel but at a loss on this one. PLEASE HELP if you can.

 

 

  

 

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
April 18, 2024

Acrobat cannot read an Excel file directly. In fact there aren't any built in tools, or even 3rd party tools that fit the requirements you've described. 

However, it is possible to create such a tool with an Acrobat Automation Script. 

First though you'll need to save the Excel sheets to a text format such as CSV. Ideally, the entire workbook should be saved to a single  file format, such as XER, that can handle multiple sheets. But if you'll need to save the sheets that are needed separtely. 

Writing such a script is non-trivial. You can read about Acrobat Automation Scripts here:

https://www.pdfscripting.com/public/Automating-Acrobat.cfm

 

Alternatively you can use the Acrobat IAC to write a VBA script in Excel that opens the PDF form and fills it with the appropiate information. 

Here's the IAC Reference:

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/interapp/index.html

 

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