How to Read Content Inside a PDF File?


I want reading during moving pdf to another folder,
their name and amount filed inside in pdf, it is possible?

How I can do it?

Hey @ddbss,

Welcome to the forum!ย  :sunglasses:

Well, first spend a couple of minutes searching the forum...ย  :sunglasses:

See this post:

Download Bank Statement almost working - #20 by ccstone


Hey @peternlewis,

Reading PDF files has come up on the forum many times and with some regularity over the years...

Hazel is the only Mac automation utility I know of offhand that can do it.

Please consider this a feature request.

Yes, reading PDFs can be done with AppleScriptObjC and with a couple of 3rd party Unix executables, but it would be very nice if Keyboard Maestro had a native action.

It would also be nice if like Xpdf's pdttotext tool the action was capable of preserving the layout of the PDF. Normal methods of text extraction do not do that, and it's very useful when you need to parse the text.

pdftotext -layout "<#path#>" -


1 Like

I use an older Mac OS, so I don't know what's in newer versions, but Automator has long had its Extract PDF Text action.


Yes. Shortcuts can extract text from a PDF. Here is an example. It should be fairly easy to create one that gets a PDF filename passed in then returns the PDF text back to a KM variable.

Thatโ€™s nice as far as it goes...

Now parse a bank statement, and tell me if it retains the layout.