I have a multipage pdf document and would like to include only the upper part (say 3cm down and 2cm right from upper left corner) of a given page. Including part of a single page can be done with \includegraphics,



\includegraphics*[page=7,width=\textwidth,viewport=30 30 120 120]{file.pdf}


but how do change the units to something like cm or inches?

  • Nobody keeps you from putting the unit cm after the numbers. – user9588 Jan 7 '12 at 16:31
  • use it, e.g.: viewport=1cm 1cm 4cm 5cm – user2478 Jan 7 '12 at 16:37
  • that simple, who would have thought... – D.Roepo Jan 7 '12 at 17:08

I'd measure the graphics (original size) and then trim it. I assume that you want to enlarge that zone to the text width

  trim=0 {\dimexpr\dimen8-3cm\relax} {\dimexpr\dimen6-2cm\relax} 0,
\caption{Particular of the upper left corner of the page}

The four parameters for trim= are the amount to be trimmed on the left, below, on the right and above respectively. With clip you are telling pdftex to not show the trimmed part.

Note that this doesn't require measuring manually the graphics. However, you find the bounding box information in the log file.

The scratch registers used are \dimen6 and \dimen8 that are not used by graphicx.sty; one must, however, check that the result is what's expected. The safest way would be to define two lengths for the purpose.

  • What are the \dimenX's in {\dimexpr\dimenX-Ycm\relax} if I now also want to clip off the top and the left? Where can i find documentation on this? – D.Roepo Oct 15 '13 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.