cpdf でPDFを抜粋する
cpdf でPDFを抜粋する
cpdf で特定のページのみ抜き出すには下記のようなコマンドになる。
例:input.pdf
から3,6ページのみ抜き出してoutput.pdf
に出力。
cpdf input.pdf 3,6 -o output.pdf
今回の作業では54ページまで、3ページ目ごとに抜き出す必要があったので、3の倍数をAppleScriptで生成した。
set numbersList to {} repeat with i from 1 to 54 if (i mod 3 = 0) then set end of numbersList to i end if end repeat set the clipboard to joinList(numbersList, ",") on joinList(theList, aDelimiter) set tmp to AppleScript's text item delimiters set AppleScript's text item delimiters to aDelimiter set theText to theList as string set AppleScript's text item delimiters to tmp return theText end joinList -- -> 3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54