Jump to content

How to search contents of PDFs?


Recommended Posts

This workflow allows you to search through PDF files.

 

However I really wish I could search through the contents of these PDF files. I am not really sure how I can do that. I searched on this forum too but did not find anything on this.

 

Thank you for any help.

Edited by nikivi
Link to comment
  • 2 months later...

This is brilliant! I've been putting off getting out of Evernote because I have a ton of PDFs and Evernote can search their text. You may have just saved me the subscription price. Can I buy you a hypothetical cup of coffee?

Edited by LynneS
Link to comment

@LynneS note that Alfred and Spotlight would search inside PDF when the text is inside the Metadata of the file. I mean, if you have PDFs that contain only images (ex: simple scanned PDF where no optical character recognition (OCR) was done), then they won't be able to search the content. I don't really use Evernote, but if I remember well, they would scan the PDF to extract the characters from it to make it searchable (they have an OCR feature built-in). However, this depend on the PDFs that you use, if you are already able to search for them in Alfred or Spotlight, then you are good to go! But, if some of your PDF doesn't embed the characters but only the images, then you would need an extra application that do an optical character recognition and add it to the PDF to make it searchable (some that I know that should do the job: PDFpenPro, DEVONthink Pro Office, OCRKit, Prizmo, or search for OCR applications).

 

If you're not sure if the file contains the character, try opening it in Preview and try to select some text. If you are able, then you should be fine, if not, then your PDF must contains only images.

Link to comment
  • 1 year later...

Hello,

 

Does this workflow yield more results than the "inside files" option within "File Search" (v.3.7 [938])?

 

On 8/15/2017 at 3:09 PM, nikivi said:

This workflow allows you to search through PDF files.

 

However I really wish I could search through the contents of these PDF files. I am not really sure how I can do that. I searched on this forum too but did not find anything on this.

 

Thank you for any help.

1

 

Since...

On 10/30/2017 at 12:03 PM, dfay said:

Spotlight, built into the last 8 or so iterations of macos, also searches PDF content...

 

Thanks!

Link to comment
  • 5 months later...
  • 4 years later...

Am I understanding this correctly? Or barking up the wrong tree...

The bottom one is configured to search via "kMDItemTextContent" 

ScreenShot2024-03-18at08_38_13.png.b9c206713504756da542c852482fe0fb.png 

 

"The value can be (query), (var:varname) or constant strings.
The constructed query is grouped by value type, for example: (query OR query) AND (var AND var) AND (const AND const)"

ScreenShot2024-03-18at08_38_35.png.522e51ca1906e3b47847b77a00513aeb.png

 

(I don't understand what this means... Should I create a {const} parameter to find a string...?)

Am I mistaken in thinking this Workflow should be able to search for a specific string of text within a library of PDFs and present the result that matches the string...?

For example, I've decided I want to find this random paragraph contained within a PDF:
"In the silence of the early morning, I’m in my office, preparing for the day’s

trading."
 

ScreenShot2024-03-18at08_43_33.thumb.png.b6f686b96eb3d29f96deefc9b3a8ff70.png

 

So in theory I was hoping the Workflow would return the result, Best Loser Wins, since that's the PDF where this sentence was taken from.

ScreenShot2024-03-18at08_47_36.png.0a650e468a049fb4c0c4b0f6f2dd7148.png

 

But obviously no such luck (I'm misguided or I haven't configured it correctly...)

When I paste the quote into the Workflow, it can't find any PDF containing the phrase and so just returns these default search options:

ScreenShot2024-03-18at08_49_20.thumb.png.f5f48f610b1000964358d866de1e35a5.png

 

 

Can you shed some light... Ideally I'm trying to see if it's possible for me to link from ANKI (Flashcard / Memory Aid) to specific quotes within PDFs via Alfred... If anyone knows how I might go about it, I'd be very grateful. (Is it possible to hyperlink to anchors within a PDF...? Which admittedly is another topic altogether...!)

Much obliged,

Dan

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...