CaseLeaf

Handbook / The `restyle` command

The restyle command

The fields on a form look like software put them there, and the form is going to a client.

Writes a copy whose form fields are drawn with the outline and fill you name. Fields as an application generates them look like an application generated them; this is how a form ends up looking like the rest of the document it is part of.

How you run it

caseleaf restyle report.pdf --to reviewed.pdf

What each part means

In full, every part it will take:

caseleaf restyle <file> --to <output> [--border none|r,g,b] [--fill none|r,g,b]
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. It is read and not written.
--to Where to write the result, as a path. The shape above shows which format this command writes. This command needs it, and writes only there: the document you named is left exactly as it was.
--border The fields' outline, as three numbers between 0 and 1 for red, green and blue, for example 0.2,0.2,0.2 for near black, or the word none for no outline at all.
--fill The fields' background, given the same way, for example 0.97,0.97,0.95 for a faint tint, or none to leave the page showing through.

Nothing else changes.

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.

{
  "fields" : 1,
  "lost" : [

  ],
  "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 "restyle" on "/path/to/report.pdf" ¬
        options "--to reviewed.pdf"
end tell

All the commands · Asking from a script · Contents