Page 1 of 1

Feature request? Ability to check on PDF content

PostPosted: 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.

Re: Feature request? Ability to check on PDF content

PostPosted: Wed Apr 24, 2019 5:40 pm
by Robert
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