Highlighted

Import Data from excel into non-fillable pdf

Community Beginner ,
Oct 16, 2020

Copy link to clipboard

Copied

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

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript, Scan documents and OCR

Views

66

Likes

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

Import Data from excel into non-fillable pdf

Community Beginner ,
Oct 16, 2020

Copy link to clipboard

Copied

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

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
Acrobat SDK and JavaScript, Scan documents and OCR

Views

67

Likes

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
Oct 16, 2020 0
Most Valuable Participant ,
Oct 16, 2020

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Oct 16, 2020 0
Community Beginner ,
Oct 16, 2020

Copy link to clipboard

Copied

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?

Likes

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
Reply
Loading...
Oct 16, 2020 0
Most Valuable Participant ,
Oct 16, 2020

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Oct 16, 2020 0
Community Beginner ,
Oct 18, 2020

Copy link to clipboard

Copied

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?

 

Likes

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
Reply
Loading...
Oct 18, 2020 0