Feature request? Ability to check on PDF content

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Feature request? Ability to check on PDF content Wed Apr 24, 2019 10:33 am • by luoto
Hello.

Is there the possibility to add this "contents" examination for PDF files within Hazel in a future release?https://blog.houdah.com/2018/02/find-pdf-files-that-need-ocr-processing/

I have tried in Hazel to replicate the rules, e.g. if none of the following conditions are met (contents CONTAIN ...)

per the example above, to then move the file to a given directory for processing (leaving the "already OCRed ones in the directory.

However looking at my sample files, it did move a file that failed to find a period (.) or space ( ) when opened with Preview.


Thank you for the consideration.
luoto
 
Posts: 11
Joined: Thu Apr 18, 2019 3:54 am

So I am using pdffonts (Shellscript)
In the condition add: passes shell script:

Code: Select all
#! /bin/bash
if  [ `pdffonts "$1" | grep Type | sed -n '$='` ]

# FAIL when the file is OCRed
then
   exit 1
else
   exit 0
fi


That works pretty accurate for me!

Image
"Behind all the inhuman aspects of automation (...) its real possibilities appear: the genesis of a technological world in which man can finally withdraw from (...) the apparatus of his labor – in order to experiment freely with it." /Marcuse
Robert
 
Posts: 52
Joined: Sun Dec 16, 2018 8:05 am


Return to Support

cron