CaseLeaf

Handbook / The `readpictures` command

The readpictures command

A document is searchable except for one screenshot, and the term everybody is looking for is inside it.

Reads the words inside the pictures on a sheet. A figure, a screenshot or a stamped label carries text that no amount of searching will find, because as far as the document is concerned it is a picture. Use it when a document is searchable and one thing in it still cannot be found.

How you run it

caseleaf readpictures report.pdf

caseleaf readpictures report.pdf --page 1

What each part means

In full, every part it will take:

caseleaf readpictures <file> [--page <n>]
part what it is for
<file> The PDF to work on, as a path, such as report.pdf beside you, or the full path to it. This command writes to it, so keep a copy if the original matters.
--page Which sheet, counting from 1, so --page 4 is the fourth sheet as it sits in the file, whatever number is printed on it. Left out, every sheet.

The words become the page's own text, so search, copy and a screen reader all find them. A separate act from ocr, which reads a sheet that is a scan.

What comes back

Asked of a short sample document, it answers as below. The sample has eight sheets, a highlight and a note left by a reviewer, a web link, a small table, two pictures and one form field already filled in.

{
  "pictures" : 1,
  "read" : 1
}

The same thing from AppleScript

Everything above can be asked for from a script instead. There is one AppleScript command, perform: on names the document, and options takes the rest exactly as you would type it.

tell application "CaseLeaf"
    perform "readpictures" on "/path/to/report.pdf"
end tell

tell application "CaseLeaf"
    perform "readpictures" on "/path/to/report.pdf" ¬
        options "--page 1"
end tell

All the commands · Asking from a script · Contents