CaseLeaf

Handbook / The `picture` command

The picture command

A signature block has to go on the last page of two hundred letters.

Puts a picture on a sheet. It is for the thing that has to go into the document rather than beside it: a signature block, a stamp, a diagram, placed where you say rather than wherever an editor decides.

How you run it

caseleaf picture report.pdf --from stamp.png

caseleaf picture report.pdf --from stamp.png --page 1 --at 72,540

What each part means

In full, every part it will take:

caseleaf picture <file> --from <file> [--page <n>] [--at x,y]
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.
--from The picture to place, as a path such as signature.png. Whatever the system reads as a picture will do: PNG, JPEG, HEIC, TIFF and the rest. It arrives as a mark, so it can be moved or removed afterwards.
--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, the first sheet.
--at Where the picture's middle goes, as x,y in points from the foot of the sheet, for example 300,300. Left out, the middle of the sheet.

It arrives as a mark, so it can be moved, reshaped, turned and burned in like any other.

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.

{
  "bounds" : {
    "height" : 2,
    "width" : 2,
    "x" : 296.5,
    "y" : 420
  },
  "drawnForOtherReaders" : true,
  "page" : 1,
  "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 "picture" on "/path/to/report.pdf" ¬
        options "--from stamp.png"
end tell

tell application "CaseLeaf"
    perform "picture" on "/path/to/report.pdf" ¬
        options "--from stamp.png --page 1 --at 72,540"
end tell

All the commands · Asking from a script · Contents