How to detect a string text in a pdf file and return in excel the location of the string (i.e. pdf page number)

gonjin

New Member
Joined
Apr 4, 2025
Messages
10
Office Version
  1. Prefer Not To Say
Platform
  1. Windows
Hello fellows,
I work with some drawings in .PDF format and I have been tried to identify some text string, comparing the info that I have in excel sheet with the info on .PDF file, as shown below:
1743791013527.png
those are the texts that I have to locate inside the PDF document...

1743791148934.png

the same information in the excel sheet are shown above in the PDF document (drawing), surrounded by the red pencil....
I am using the 365 apps and Adobe Acrobat Reader (not Pro). The applications softwares are under IT governance by the company that I've been working in the moment, so I have limitations for implement some customization...
What I desire to do is to identify the texts that I paste above (column from excel) in the PDF example and have another column in excel, with the page number of the texts that could be located, as a manner to validate the information.
Can someone helps me in the VBA and/or a solution for that, please?
Many thanks in advance!
 
The "text" in your PDF file is almost certainly graphics. I can't say with 100% certainty without the file but from the looks of it, I am 98% certain. Which means what you want to do can't be done, unless you use some kind of OCR tool to convert everything to text first.
 
Upvote 0
When you open the PDF file in a PDF reader, and are in "text select" mode, can you select/copy any of the text in that diagram?
 
Upvote 0
When you open the PDF file in a PDF reader, and are in "text select" mode, can you select/copy any of the text in that diagram?
Hi!
Yep, I can...
The PDF file was created as 'searchable' one...
Thanks a lot!
 
Upvote 0
The "text" in your PDF file is almost certainly graphics. I can't say with 100% certainty without the file but from the looks of it, I am 98% certain. Which means what you want to do can't be done, unless you use some kind of OCR tool to convert everything to text first.
Hello Jazzer!
Thanks for reply my quote...
The texts inside the PDF can be selected and copy and transfer to another place (i.e. Word or Notepad. Because of this, I thought to automatize the search compare of those text string, in order to validate the info's that I have in Excel sheet.... this flow will help me a lot and makes my work very accurate.
Regards!
 
Upvote 0
Without Adobe Acrobat Pro I think it's still possible but it requires parsing the internal codes used to create the PDF file. I have an idea of how to do that. Is your file proprietary? It would help to have a sample to test with.
 
Upvote 0
Without Adobe Acrobat Pro I think it's still possible but it requires parsing the internal codes used to create the PDF file. I have an idea of how to do that. Is your file proprietary? It would help to have a sample to test with.
Hi Jeff,
Thanks again for your interesting in my battle here...
Unfortunately, the PDF file is proprietary and under rules of information control and governance. The table in excel I can share with you...
Is it possible to browse your ideas using another sources as example? I could learned with you how can I have to adjust the PDF file and the sheet in excel to do the match compare between the files that I am ask for helps here....
Once more, many thanks...
Regards,
 
Upvote 0
Just give a try and see how data is populating since it is searchable,

1743894830458.png
 
Upvote 0
That's a good suggestion. I am not as familiar with data queries, but some very powerful features have been added in recent years.

Also, PowerQuery may be able to do this (but I am not experienced with it).

Just speaking as another member, providing "Prefer not to say" for Excel version will cause a lot of confusion when people give you solutions that might not work in your version. I've never seen anyone not want to offer that information.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top