CaseLeaf

Handbook / The `blackout` command

The blackout command

A name has to come out of a document that is going to be published, and a black rectangle over it is how that goes wrong.

Draws a black square over a rectangle you name on a page you name, and marks it as due for removal. Nothing is deleted yet: the words are still there, searchable and selectable, until redact runs. Marking first means a script can flag exactly what has to go before anything is destroyed, and a wrong mark costs nothing to put right.

How you run it

caseleaf blackout report.pdf --page 1 --bounds 72,540,180,24

caseleaf blackout report.pdf --page 1 --bounds 72,540,180,24 --to reviewed.pdf

What each part means

In full, every part it will take:

caseleaf blackout <file> --page <n> --bounds x,y,w,h [--to <output>]
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 unless you send the result somewhere else with --to.
--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. This command needs it.
--bounds The rectangle, as four numbers: distance from the left, distance from the bottom, width, height, all in points, 72 to the inch. 72,540,180,24 is a box an inch in from the left, near the top of an A4 sheet. Commas, semicolons or spaces all separate them, and since a semicolon ends a command in most shells, that spelling wants quoting: --bounds "72;540;180;24".
--to Where to write the result, as a path. The shape above shows which format this command writes. Left out, the document you named is rewritten where it stands, because --to chooses where, not whether. Give one to keep the original.

Part of the legal option.

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.

{
  "note" : "marked only - `caseleaf redact` removes what is under it",
  "page" : 1,
  "to" : "report.pdf",
  "written" : true
}

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 "blackout" on "/path/to/report.pdf" ¬
        options "--page 1 --bounds 72,540,180,24"
end tell

tell application "CaseLeaf"
    perform "blackout" on "/path/to/report.pdf" ¬
        options "--page 1 --bounds 72,540,180,24 --to reviewed.pdf"
end tell

All the commands · Asking from a script · Contents