CaseLeaf

Handbook / The `resize` command

The resize command

A bundle has to be one paper size throughout before it goes to the court.

Draws sheets again at another size. It is for a bundle that has to be one paper size throughout, where the alternative is printing at a scale nobody chose and losing the margins.

How you run it

caseleaf resize report.pdf --width 1200

caseleaf resize report.pdf --width 1200 --height 1200 --pages 1,2,3 --to reviewed.pdf

caseleaf resize report.pdf --percent 1

caseleaf resize report.pdf --percent 1 --pages 1,2,3 --to reviewed.pdf

What each part means

In full, every part it will take:

caseleaf resize <file> --width <pixels> [--height <pixels>] [--pages 1,2,3] [--to <output>]
caseleaf resize <file> --percent <n> [--pages 1,2,3] [--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.
--width How wide each sheet becomes, in points: 595 is A4, 612 letter. On its own the height follows and each sheet keeps its own proportions, which is what a deck of mixed sizes wants. Add --height and both are taken exactly, so the sheets can come out stretched.
--height How tall. Left out, each sheet keeps its own proportions and the width leads. (optional)
--pages Which sheets, as numbers or ranges separated by commas, so 1,3,5-7 is five sheets. Every command reads that spelling the same way, and a number the document does not have is refused rather than skipped.
--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.
--percent A fraction of each sheet's own size, as a percentage. 50 is half.

A sheet made from a picture is one point per pixel, so its size is its picture's size. Each sheet is drawn again at the new size and put in its own place; a sheet that cannot be drawn is left as it was rather than failing the rest.

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.

{
  "height" : 1698,
  "sheets" : [
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8
  ],
  "to" : "report.pdf",
  "width" : 1200,
  "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 "resize" on "/path/to/report.pdf" ¬
        options "--width 1200"
end tell

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

All the commands · Asking from a script · Contents