Skip to main content
October 16, 2020
Answered

Import Data from excel into non-fillable pdf

  • October 16, 2020
  • 2 replies
  • 2277 views

I am looking for a way to

1. Check if any word on PDF page matches a word in an excel spreadsheet.

2. Copy a corresponding cell's data and place it on the PDF. (not in a form).

 

I'll attach a sample pdf page.

I would like to see if the word Sample appears in the excel sheet and

pull out the corresponding data (Test) and paste it inside. 

Thanks in advance

Correct answer try67

You can't do it with an Excel file directly. You will have to first convert it to a plain-text file, like a CSV or a tab-delimited file. Then you'll be able to read its contents using a script, search for matches and then copy that "cell" into the file, for example using a comment. This is not a trivial scripting task, though.

2 replies

October 18, 2020

Just wondering, I have much more experience with vba I'm excel. Would it be easier (if possible) to do this sorry of thing through vba?

 

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 16, 2020

You can't do it with an Excel file directly. You will have to first convert it to a plain-text file, like a CSV or a tab-delimited file. Then you'll be able to read its contents using a script, search for matches and then copy that "cell" into the file, for example using a comment. This is not a trivial scripting task, though.

October 16, 2020

Thanks Right I know about the cab part. I assumed that it wouldn't be a simple scripting task but any direction would be a great help. I'm dealing with thousands of pdf pages. Where would I go to find how to do this?

try67
Community Expert
Community Expert
October 16, 2020

Reading the file can be done using the readFileIntoStream method of the util object. Searching it is just a simple string manipulation. Inserting the result can be done using the addAnnot method to create a comment.