What for does pdfcrop execute pdftex internally?


It basically creates a TeX document which includes the original PDF as image(s) while setting the correct clipping parameter to remove the excess space.

You can do something like this manually using the pdfpages package (which uses \includegraphics internally, see also grfguide):

\includepdf[fitpaper,clip,trim=<llx> <lly> <urx> <ury>]{file}

(here ll= lower left, ur = upper right)

The pdfcrop script however does this manually by apparently adjusted the parameters like \pdfhorigin, \pdfvorigin, \pdfpagewidth, \pdfpageheight etc.

The preview package can crop documents down to their true bounding box for you. It works great for pdflatex, but I didn't got it working for latex by myself. The standalone class uses this package and also sets all other necessary parameters (like empty page style, etc.) so that a tight PDF image from e.g. a tikzpicture is produced.

  • Do we need to pass -interaction=nonstopmode to pdfcrop?
    – xport
    Jul 9 '11 at 17:33
  • @xport: I never needed to do this. Jul 9 '11 at 17:36

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.