diff --git a/cpdfcommand.ml b/cpdfcommand.ml index 2a1dccf..1416d7b 100644 --- a/cpdfcommand.ml +++ b/cpdfcommand.ml @@ -2018,7 +2018,7 @@ and specs = " -shift \"dx dy\" shifts the chosen pages"); ("-shift-boxes", Arg.String setshiftboxes, - " -shift \"dx dy\" shifts the chosen pages"); + " -shift-boxes \"dx dy\" shifts boxes on the chosen pages"); ("-rotate", Arg.Int setrotate, " Set rotation of pages to 0, 90, 180, 270"); @@ -4031,7 +4031,6 @@ let go () = let range = parse_pagespec_allow_empty pdf (get_pagespec ()) in let dxdylist = Cpdfcoord.parse_coordinates pdf args.coord in let dx, dy = match dxdylist with (a, b)::_ -> a, b | _ -> 0.0, 0.0 in - Printf.printf "dx = %f, dy = %f\n" dx dy; let f (xmin, xmax, ymin, ymax) = (xmin +. dx, xmax +. dx, ymin +. dy, ymax +. dy) in let fpage _ p = Cpdfpage.change_boxes f pdf p in write_pdf false (Cpdfpage.process_pages (Pdfpage.ppstub fpage) pdf range) diff --git a/cpdfmanual.pdf b/cpdfmanual.pdf index b1b74b1..a695c22 100644 Binary files a/cpdfmanual.pdf and b/cpdfmanual.pdf differ diff --git a/cpdfmanual.tex b/cpdfmanual.tex index 1045b8c..b92d6cf 100644 --- a/cpdfmanual.tex +++ b/cpdfmanual.tex @@ -1339,6 +1339,9 @@ The encryption parameters described in Chapter \ref{encryption} may be added to \vspace{1.5mm} \small\noindent\verb!cpdf -shift " " [-fast] in.pdf [] -o out.pdf! + \vspace{1.5mm} + \small\noindent\verb!cpdf -shift-boxes " " in.pdf [] -o out.pdf! + \vspace{1.5mm} \small\noindent\verb!cpdf -rotate in.pdf [] -o out.pdf! @@ -1479,9 +1482,18 @@ by X points horizontally and Y points vertically. \vspace{2.5mm} \noindent Shift pages to the right by 50 points (for instance, to increase -the binding margin). +the binding margin).\end{framed} + +\noindent The \texttt{-shift-boxes} operation has the same effect, but operates by moving the page boxes only, avoiding processing the page contents. It is therefore faster. Of course, the numbers must be inverted, since it is the boxes being moved not the page: + + \begin{framed} + \small\noindent\verb!cpdf -shift-boxes "-50 0" in.pdf even -o out.pdf! + + \vspace{2.5mm} + + \noindent Shift pages to the right by 50 points (for instance, to increase +the binding margin).\end{framed} - \end{framed} \section{Rotating Pages} \index{rotate!pages}